Skip to content

Releases: aeron-io/agrona

2.3.2

08 Nov 09:40
fd43567

Choose a tag to compare

  • Prevent concurrent MarkFile activation when org.agrona.MarkFile.mapNewOrExistingMarkFile is 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

03 Nov 13:51
c1c1558

Choose a tag to compare

  • Fixed racy file creation in org.agrona.MarkFile.mapNewOrExistingMarkFile. (#340)
  • Upgrade to ByteBuddy 1.17.8.
  • Upgrade to Checkstyle 12.1.1.
  • Upgrade to JUnit 6.0.1.

2.3.0

29 Sep 09:03

Choose a tag to compare

  • [Breaking] Changed org.agrona.concurrent.ShutdownSignalBarrier to use shutdown hooks instead of signals.

    Previously ShutdownSignalBarrier relied on intercepting SIGINT and SIGTERM 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 ShutdownSignalBarrier to be explicitly closed.

    NB: Failure to close ShutdownSignalBarrier might result in JVM not terminating!

    As the result the code using ShutdownSignalBarrier needs 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 ShutdownSignalBarrier is closed last to ensure that service terminates completely before ShutdownSignalBarrier closes which in turn allows JVM to exit.

  • [Breaking] Deprecated org.agrona.concurrent.SigInt for removal. Use org.agrona.concurrent.ShutdownSignalBarrier instead.

    NB: org.agrona.concurrent.SigInt.register(java.lang.Runnable) is unsafe as it overrides SIGINT signal handling of the JVM thus preventing shutdown hooks from being executed.

    An example using ShutdownSignalBarrier instead of 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] Agrona jars no longer provide OSGI metadata as bnd plugin was removed, because it breaks
    compatibility with Gradle 9.1 and causes self-dependency via baseline task.

  • AtomicCounter minor javadoc improvements. (#338)

  • Upgrade to Gradle 9.1.0.

  • Upgrade to ByteBuddy 1.17.7.

  • Upgrade to Checkstyle 11.1.0.

  • Upgrade to JUnit 5.13.4.

  • Upgrade to Mockito 5.20.0.

  • Upgrade to Shadow 9.2.2.

  • Upgrade to Versions 0.53.0.

2.3.0-rc1

03 Sep 19:17
85f6118

Choose a tag to compare

2.3.0-rc1 Pre-release
Pre-release
  • Breaking: Deprecated org.agrona.concurrent.SigInt for removal. Use
    org.agrona.concurrent.ShutdownSignalBarrier instead.

    NB: org.agrona.concurrent.SigInt.register(java.lang.Runnable) is unsafe as it overrides SIGINT signal
    handling of the JVM thus preventing shutdown hooks from being executed.

    Using ShutdownSignalBarrier instead of org.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.ShutdownSignalBarrier to use shutdown hooks instead of signals.

    Previously ShutdownSignalBarrier relied on intercepting SIGINT and SIGTERM
    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 ShutdownSignalBarrier to be explicitly closed
    (typically last).

    NB: Failure to close ShutdownSignalBarrier might result in JVM not terminating.

    As the result the code using ShutdownSignalBarrier needs 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 ShutdownSignalBarrier is closed last to ensure that service terminates completely before
      ShutdownSignalBarrier closes which in turn allows JVM to exit.

  • AtomicCounter minor javadoc improvements. (#338)

  • Bump Gradle to 9.0.0.

  • Bump ByteBuddy to 1.17.7.

  • Bump Checkstyle to 11.0.1.

  • Bump JUnit to 5.13.4.

  • Bump Mockito to 5.19.0.

  • Bump Shadow to 9.1.0.

2.2.4

27 Jun 13:40
6cccef4

Choose a tag to compare

Changed

  • Bump JUnit to 5.13.2.
  • Bump Checkstyle to 10.26.0.
  • Bump Shadow to 8.3.7.

Fixed

  • Fix possible IndexOutOfBoundsException in MarkFile constructor which creates the parent directory. (#337)

2.2.3

20 Jun 12:57
418849c

Choose a tag to compare

Changed

  • Publish release artifacts to Central Portal using OSSRH Staging API service.
  • Bump ByteBuddy to 1.17.6.
  • Bump JUnit to 5.13.1.
  • Bump Gradle to 8.14.2.

Added

  • Add SystemEpochNanoClock#INSTANCE constant.

Removed

  • Remove unused and broken CompilerUtil#compileOnDisk and CompilerUtil#persist methods.

2.2.2

05 Jun 13:58
8150c7f

Choose a tag to compare

Changed

  • Publish release artifacts to Central Portal using OSSRH Staging API service.
  • Bump Checkstyle to 10.25.0.

2.2.1

02 Jun 08:25
353c3c7

Choose a tag to compare

Changed

  • IntHashSet#retainAll(Collection) and IntHashSet#retainAll(IntHashSet) no longer change the capacity of the set.
  • Bump JUnit to 5.13.0.

Fixed

  • Infinite loop in IntHashSet when retainAll leaves collections with a power of two number of elements.

2.2.0

26 May 14:35

Choose a tag to compare

Changed

  • Protect against numeric overflow when recording errors at the end of the large buffer.
  • CI: Use gradle/actions/setup-gradle action for caching Gradle dependencies.
  • CI: Enable JDK 24 GA build.
  • Bump Gradle to 8.14.1.
  • Bump Checkstyle to 10.24.0.
  • Bump ByteBuddy to 1.17.5.
  • Bump Shadow to 8.3.6.
  • Bump JUnit to 5.12.2.
  • Bump Mockito to 5.18.0.
  • Bump Guava TestLib to 33.4.8-jre.

Added

  • Add SystemUtil#isMac method.
  • Add tests for file mapping.

2.1.0

26 Feb 16:31
8ebc7ab

Choose a tag to compare

Changed

  • Move get method declaration to the ReadablePosition class. (eb3b7d284d)
  • Bump Gradle to 8.13.
  • Bump Checkstyle to 10.21.3.
  • Bump ByteBuddy to 1.17.1.
  • Bump Shadow to 8.3.6.
  • Bump JUnit to 5.12.0.

Added

  • Add compareAndExchange methods to AtomicBuffer. (#334)
  • Add getAndAddPlain to AtomicCounter. (#328)
  • Add acquire/release methods to AtomicBuffer. (#314)
  • Add acquire/release methods to AtomicCounter. (#315)
  • Add acquire/release methods to Position. (#316)
  • Add plain methods to AtomicCounter. (#317)
  • Add opaque methods to AtomicCounter. (#319)
  • Add opaque methods to AtomicBuffer. (#313)
  • Add opaque methods to Position. (#324)
  • Add timestampRelease method to MarkFile. (#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#arrayBaseOffset forwards compatible with JDK 25+ which changed the return type to long whereas we keep it as int.