Skip to content

Commit 3071413

Browse files
authored
aeron 1.50.4 (#2937)
* aeron 1.51.0 * temp enable aeron tests * try to remove unused code imports Update AeronStat.java Update AeronStat.java * Update DaemonicSpec.scala * aeron 1.50.4 * bring back RemoteTransportException behaviour * Update ArteryFailedToBindSpec.scala * Update remoting-artery.md * Remove pull_request trigger from nightly builds Removed pull_request trigger from nightly builds workflow.
1 parent 1d3c313 commit 3071413

6 files changed

Lines changed: 18 additions & 98 deletions

File tree

.scala-steward.conf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
updates.pin = [
22
# https://github.com/apache/pekko/issues/2329
3-
{ groupId = "io.aeron", version = "1.48." },
3+
{ groupId = "io.aeron", version = "1.50." },
44
# Scala 3.3 is the latest LTS version
55
{ groupId = "org.scala-lang", artifactId = "scala3-library", version = "3.3." }
66
# sbt-assembly 2.3 causes build issues (https://github.com/apache/pekko/pull/1744)
77
{ groupId = "com.eed3si9n", artifactId = "sbt-assembly", version = "2.2." }
8-
# agrona major+minor version should match the one brought
9-
# in by aeron
10-
{ groupId = "org.agrona", artifactId = "agrona", version = "2.2." }
8+
# agrona major+minor version should match the one brought in by aeron
9+
{ groupId = "org.agrona", artifactId = "agrona", version = "2.4." }
1110
]
1211

1312
updates.ignore = [

docs/src/main/paradox/remoting-artery.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,10 +745,10 @@ Given that Aeron jar files are in the classpath the standalone media driver can
745745
java io.aeron.driver.MediaDriver
746746
```
747747

748-
The needed classpath:
748+
The classpath would be approximately (but you will need to fix up the version numbers):
749749

750750
```
751-
Agrona-0.5.4.jar:aeron-driver-1.0.1.jar:aeron-client-1.0.1.jar
751+
agrona-2.4.1.jar:aeron-driver-1.50.4.jar:aeron-client-1.50.4.jar
752752
```
753753

754754
You find those jar files on [Maven Central](https://search.maven.org/), or you can create a

project/Dependencies.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ object Dependencies {
3030
val junit6Version = "6.0.3"
3131
val slf4jVersion = "2.0.17"
3232
// also update agrona version when updating aeron:
33-
val aeronVersion = "1.48.10"
33+
val aeronVersion = "1.50.4"
3434
// Use the major+minor agrona versions matching aeron at
3535
// https://github.com/aeron-io/aeron/blob/1.x.y/gradle/libs.versions.toml
3636
// (remember to also update the scala-steward pin)
37-
val agronaVersion = "2.2.4"
37+
val agronaVersion = "2.4.1"
3838
val nettyVersion = "4.2.13.Final"
3939
val logbackVersion = "1.5.32"
4040

remote-tests/src/test/scala/org/apache/pekko/remote/artery/ArteryFailedToBindSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ArteryFailedToBindSpec extends AnyWordSpec with Matchers {
5858
}
5959
RARP(as).provider.transport.asInstanceOf[ArteryTransport].settings.Transport match {
6060
case ArterySettings.AeronUpd =>
61-
ex.getMessage should ===("Inbound Aeron channel is in errored state. See Aeron logs for details.")
61+
ex.getMessage should startWith("Failed to create Aeron subscription")
6262
case ArterySettings.Tcp | ArterySettings.TlsTcp =>
6363
ex.getMessage should startWith("Failed to bind TCP")
6464
}

remote/src/main/scala/org/apache/pekko/remote/artery/aeron/AeronSource.scala

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ import scala.concurrent.{ Future, Promise }
1919
import scala.util.control.NonFatal
2020

2121
import io.aeron.{ Aeron, FragmentAssembler, Subscription }
22-
import io.aeron.exceptions.DriverTimeoutException
22+
import io.aeron.exceptions.{ AeronException, DriverTimeoutException }
2323
import io.aeron.logbuffer.FragmentHandler
2424
import io.aeron.logbuffer.Header
2525
import org.agrona.DirectBuffer
2626

2727
import org.apache.pekko
28+
import pekko.remote.RemoteTransportException
2829
import pekko.stream.Attributes
2930
import pekko.stream.Outlet
3031
import pekko.stream.SourceShape
@@ -106,7 +107,14 @@ private[remote] class AeronSource(
106107
override def createLogicAndMaterializedValue(inheritedAttributes: Attributes) = {
107108
val logic = new GraphStageLogic(shape) with OutHandler with AeronLifecycle with StageLogging {
108109

109-
private val subscription = aeron.addSubscription(channel, streamId)
110+
private val subscription = try {
111+
aeron.addSubscription(channel, streamId)
112+
} catch {
113+
case e: AeronException =>
114+
throw new RemoteTransportException(
115+
s"Failed to create Aeron subscription for channel [$channel] and streamId [$streamId]",
116+
e)
117+
}
110118
private var backoffCount = spinning
111119
private var delegateTaskStartTime = 0L
112120
private var countBeforeDelegate = 0L

remote/src/test/java/org/apache/pekko/remote/artery/aeron/AeronStat.java

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,10 @@
3131
import java.io.File;
3232
import java.io.PrintStream;
3333
import java.nio.MappedByteBuffer;
34-
import java.util.Date;
35-
import java.util.concurrent.atomic.AtomicBoolean;
3634
import java.util.function.Supplier;
3735
import java.util.regex.Pattern;
3836
import org.agrona.DirectBuffer;
3937
import org.agrona.IoUtil;
40-
import org.agrona.concurrent.SigInt;
4138
import org.agrona.concurrent.status.CountersReader;
4239

4340
/**
@@ -144,73 +141,6 @@ public static CountersReader mapCounters(final File cncFile) {
144141
createCountersValuesBuffer(cncByteBuffer, cncMetaData));
145142
}
146143

147-
public static void main(final String[] args) throws Exception {
148-
Pattern typeFilter = null;
149-
Pattern identityFilter = null;
150-
Pattern sessionFilter = null;
151-
Pattern streamFilter = null;
152-
Pattern channelFilter = null;
153-
154-
if (0 != args.length) {
155-
checkForHelp(args);
156-
157-
for (final String arg : args) {
158-
final int equalsIndex = arg.indexOf('=');
159-
if (-1 == equalsIndex) {
160-
System.out.println("Arguments must be in name=pattern format: Invalid '" + arg + "'");
161-
return;
162-
}
163-
164-
final String argName = arg.substring(0, equalsIndex);
165-
final String argValue = arg.substring(equalsIndex + 1);
166-
167-
switch (argName) {
168-
case COUNTER_TYPE_ID:
169-
typeFilter = Pattern.compile(argValue);
170-
break;
171-
172-
case COUNTER_IDENTITY:
173-
identityFilter = Pattern.compile(argValue);
174-
break;
175-
176-
case COUNTER_SESSION_ID:
177-
sessionFilter = Pattern.compile(argValue);
178-
break;
179-
180-
case COUNTER_STREAM_ID:
181-
streamFilter = Pattern.compile(argValue);
182-
break;
183-
184-
case COUNTER_CHANNEL:
185-
channelFilter = Pattern.compile(argValue);
186-
break;
187-
188-
default:
189-
System.out.println("Unrecognised argument: '" + arg + "'");
190-
return;
191-
}
192-
}
193-
}
194-
195-
final AeronStat aeronStat =
196-
new AeronStat(
197-
mapCounters(), typeFilter, identityFilter, sessionFilter, streamFilter, channelFilter);
198-
final AtomicBoolean running = new AtomicBoolean(true);
199-
SigInt.register(() -> running.set(false));
200-
201-
while (running.get()) {
202-
System.out.print("\033[H\033[2J");
203-
204-
System.out.format("%1$tH:%1$tM:%1$tS - Aeron Stat%n", new Date());
205-
System.out.println("=========================");
206-
207-
aeronStat.print(System.out);
208-
System.out.println("--");
209-
210-
Thread.sleep(ONE_SECOND);
211-
}
212-
}
213-
214144
public void print(final PrintStream out) {
215145
counters.forEach(
216146
(counterId, typeId, keyBuffer, label) -> {
@@ -221,23 +151,6 @@ public void print(final PrintStream out) {
221151
});
222152
}
223153

224-
private static void checkForHelp(final String[] args) {
225-
for (final String arg : args) {
226-
if ("-?".equals(arg) || "-h".equals(arg) || "-help".equals(arg)) {
227-
System.out.format(
228-
"Usage: [-Daeron.dir=<directory containing CnC file>] AeronStat%n"
229-
+ "\tfilter by optional regex patterns:%n"
230-
+ "\t[type=<pattern>]%n"
231-
+ "\t[identity=<pattern>]%n"
232-
+ "\t[sessionId=<pattern>]%n"
233-
+ "\t[streamId=<pattern>]%n"
234-
+ "\t[channel=<pattern>]%n");
235-
236-
System.exit(0);
237-
}
238-
}
239-
}
240-
241154
private boolean filter(final int typeId, final DirectBuffer keyBuffer) {
242155
if (!match(typeFilter, () -> Integer.toString(typeId))) {
243156
return false;

0 commit comments

Comments
 (0)