Releases: aeron-io/agrona
2.3.2
-
Prevent concurrent
MarkFileactivation whenorg.agrona.MarkFile.mapNewOrExistingMarkFileis used.If the mark file already exists and is not active, then the activity timestamp (
timestampFieldOffset) is atomically
set to a special sentinel value (org.agrona.MarkFile.ACTIVATION_IN_PROGRESS_TIMESTAMP) to prevent other processes from
concurrent activation.NB: If the current activation fails it will leave the activity timestamp at a sentinel value which will prevent a
restart of the process. Therefore, it is recommended to reset the activity timestamp upon failure.
2.3.1
2.3.0
-
[Breaking] Changed
org.agrona.concurrent.ShutdownSignalBarrierto use shutdown hooks instead of signals.Previously
ShutdownSignalBarrierrelied on interceptingSIGINTandSIGTERMOS signals by overriding JVM's signal handling which was preventing shutdown hooks from be executed. This in turn was breaking applications and frameworks that relied on shutdown hooks for clean termination.New implementation uses shutdown hooks instead and requires
ShutdownSignalBarrierto be explicitly closed.NB: Failure to close
ShutdownSignalBarriermight result in JVM not terminating!As the result the code using
ShutdownSignalBarrierneeds to be updated:- Old:
class UsageSample { public static void main(final String[] args) { try (MyService service = new MyService()) { new ShutdownSignalBarrier().await(); } } }
- New:
class UsageSample { public static void main(final String[] args) { try (ShutdownSignalBarrier barrier = new ShutdownSignalBarrier(); MyService service = new MyService()) { barrier.await(); } } }
In the above example
ShutdownSignalBarrieris closed last to ensure thatserviceterminates completely beforeShutdownSignalBarriercloses which in turn allows JVM to exit. -
[Breaking] Deprecated
org.agrona.concurrent.SigIntfor removal. Useorg.agrona.concurrent.ShutdownSignalBarrierinstead.NB:
org.agrona.concurrent.SigInt.register(java.lang.Runnable)is unsafe as it overridesSIGINTsignal handling of the JVM thus preventing shutdown hooks from being executed.An example using
ShutdownSignalBarrierinstead ofSigInt:- Old:
class FlagSample { public static void main(final String[] args) { final AtomicBoolean running = new AtomicBoolean(false); SigInt.register(() -> running.set(false)); while(running.get()) { ... } } }
- New:
class FlagSample { public static void main(final String[] args) { final AtomicBoolean running = new AtomicBoolean(true); try (ShutdownSignalBarrier barrier = new ShutdownSignalBarrier(() -> running.set(false)) { while (running.get()) { ... } } } }
-
[Breaking] Agrona jars no longer provide OSGI metadata as
bndplugin was removed, because it breaks
compatibility with Gradle 9.1 and causes self-dependency viabaselinetask. -
AtomicCounter minor javadoc improvements. (#338)
-
Upgrade to
Gradle9.1.0. -
Upgrade to
ByteBuddy1.17.7. -
Upgrade to
Checkstyle11.1.0. -
Upgrade to
JUnit5.13.4. -
Upgrade to
Mockito5.20.0. -
Upgrade to
Shadow9.2.2. -
Upgrade to
Versions0.53.0.
2.3.0-rc1
-
Breaking: Deprecated
org.agrona.concurrent.SigIntfor removal. Use
org.agrona.concurrent.ShutdownSignalBarrierinstead.NB:
org.agrona.concurrent.SigInt.register(java.lang.Runnable)is unsafe as it overridesSIGINTsignal
handling of the JVM thus preventing shutdown hooks from being executed.Using
ShutdownSignalBarrierinstead oforg.agrona.concurrent.SigInt:-
Old:
class FlagSample { public static void main(final String[] args) { final AtomicBoolean running = new AtomicBoolean(false); SigInt.register(() -> running.set(false)); while(running.get()) { ... } } }
-
New:
class FlagSample { public static void main(final String[] args) { final AtomicBoolean running = new AtomicBoolean(true); try (ShutdownSignalBarrier barrier = new ShutdownSignalBarrier(() -> running.set(false)) { while (running.get()) { ... } } } }
-
-
Breaking: Changed
org.agrona.concurrent.ShutdownSignalBarrierto use shutdown hooks instead of signals.Previously
ShutdownSignalBarrierrelied on interceptingSIGINTandSIGTERM
OS signals by overriding JVM's signal handling which was
preventing shutdown hooks from be executed. This in turn was breaking applications and frameworks that relied on
shutdown hooks for clean termination.New implementation uses shutdown hooks instead and requires
ShutdownSignalBarrierto be explicitly closed
(typically last).NB: Failure to close
ShutdownSignalBarriermight result in JVM not terminating.As the result the code using
ShutdownSignalBarrierneeds to be updated:-
Old (before
2.3.0):class UsageSample { public static void main(final String[] args) { final ShutdownSignalBarrier barrier = new ShutdownSignalBarrier(); try (MyService service = new MyService()) { barrier.await(); } } }
-
New:
class UsageSample { public static void main(final String[] args) { try (ShutdownSignalBarrier barrier = new ShutdownSignalBarrier(); MyService service = new MyService()) { barrier.await(); } } }
In the above example
ShutdownSignalBarrieris closed last to ensure thatserviceterminates completely before
ShutdownSignalBarriercloses which in turn allows JVM to exit.
-
-
AtomicCounter minor javadoc improvements. (#338)
-
Bump
Gradleto 9.0.0. -
Bump
ByteBuddyto 1.17.7. -
Bump
Checkstyleto 11.0.1. -
Bump
JUnitto 5.13.4. -
Bump
Mockitoto 5.19.0. -
Bump
Shadowto 9.1.0.
2.2.4
2.2.3
Changed
- Publish release artifacts to Central Portal using OSSRH Staging API service.
- Bump
ByteBuddyto 1.17.6. - Bump
JUnitto 5.13.1. - Bump
Gradleto 8.14.2.
Added
- Add
SystemEpochNanoClock#INSTANCEconstant.
Removed
- Remove unused and broken
CompilerUtil#compileOnDiskandCompilerUtil#persistmethods.
2.2.2
Changed
- Publish release artifacts to Central Portal using OSSRH Staging API service.
- Bump
Checkstyleto 10.25.0.
2.2.1
Changed
IntHashSet#retainAll(Collection)andIntHashSet#retainAll(IntHashSet)no longer change the capacity of the set.- Bump
JUnitto 5.13.0.
Fixed
- Infinite loop in
IntHashSetwhenretainAllleaves collections with a power of two number of elements.
2.2.0
Changed
- Protect against numeric overflow when recording errors at the end of the large buffer.
- CI: Use
gradle/actions/setup-gradleaction for caching Gradle dependencies. - CI: Enable JDK 24 GA build.
- Bump
Gradleto 8.14.1. - Bump
Checkstyleto 10.24.0. - Bump
ByteBuddyto 1.17.5. - Bump
Shadowto 8.3.6. - Bump
JUnitto 5.12.2. - Bump
Mockitoto 5.18.0. - Bump
Guava TestLibto 33.4.8-jre.
Added
- Add
SystemUtil#isMacmethod. - Add tests for file mapping.
2.1.0
Changed
- Move
getmethod declaration to theReadablePositionclass. (eb3b7d284d) - Bump
Gradleto 8.13. - Bump
Checkstyleto 10.21.3. - Bump
ByteBuddyto 1.17.1. - Bump
Shadowto 8.3.6. - Bump
JUnitto 5.12.0.
Added
- Add
compareAndExchangemethods toAtomicBuffer. (#334) - Add
getAndAddPlaintoAtomicCounter. (#328) - Add
acquire/releasemethods toAtomicBuffer. (#314) - Add
acquire/releasemethods toAtomicCounter. (#315) - Add
acquire/releasemethods toPosition. (#316) - Add
plainmethods toAtomicCounter. (#317) - Add
opaquemethods toAtomicCounter. (#319) - Add
opaquemethods toAtomicBuffer. (#313) - Add
opaquemethods toPosition. (#324) - Add
timestampReleasemethod toMarkFile. (#318) - Add different flavors of concurrent methods to
StatusIndicator. (#323)
Fixed
- CI: Fix crash logs upload on Windows + compress test data before upload.
- Make
UnsafeApi#arrayBaseOffsetforwards compatible with JDK 25+ which changed the return type tolongwhereas we keep it asint.