Skip to content

[AMQ-7452] Fix "Timer already cancelled" on new connections when shared inactivity timer dies - #1963

Closed
jbonofre wants to merge 345 commits into
apache:activemq-6.2.xfrom
jbonofre:fix/inactivity-monitor-cancelled-timer
Closed

jbonofre wants to merge 345 commits into
apache:activemq-6.2.xfrom
jbonofre:fix/inactivity-monitor-cancelled-timer

Conversation

@jbonofre

Copy link
Copy Markdown
Member

The static READ_CHECK_TIMER and WRITE_CHECK_TIMER in AbstractInactivityMonitor are shared across all transport instances. Java's Timer permanently marks itself cancelled when its internal thread exits due to an unhandled Error thrown by a TimerTask. SchedulerTimerTask rethrows Error subclasses, so an OutOfMemoryError in any timer task kills the shared timer thread while the static field remains non-null. All subsequent schedule() calls on new connections then throw IllegalStateException ("Timer already cancelled"), which propagates to TransportConnector.onAcceptError() and is logged as WARN "Could not accept connection: Timer already cancelled."

Here's my fix proposal: wrap the schedule() calls in startConnectCheckTask() and startMonitorThreads() in try/catch(IllegalStateException). On catch, the dead timer is cancelled (to let its thread exit), replaced with a fresh instance, and the task is rescheduled. The guard condition in startConnectCheckTask() is also extended with || READ_CHECK_TIMER == null to cover the case where the field is unexpectedly null when CHECKER_COUNTER > 0.

I added three regression tests to InactivityMonitorTest covering:

  • READ_CHECK_TIMER cancelled with CHECKER_COUNTER == 0 (startConnectCheckTask path)
  • READ_CHECK_TIMER cancelled with CHECKER_COUNTER > 0 (production scenario)
  • WRITE_CHECK_TIMER cancelled (startMonitorThreads path)

Also, tests use Wait.waitFor() instead of Thread.sleep() for reliability on slow CI.

jeanouii and others added 30 commits February 5, 2026 10:12
* [#] Too aggressive now. Only 4 times a day is enough because it needs anyways 3+ hours to complete
Bumps [org.ops4j.pax.url:pax-url-aether](https://github.com/ops4j/org.ops4j.pax.url) from 2.6.17 to 2.7.0.
- [Changelog](https://github.com/ops4j/org.ops4j.pax.url/blob/main/changes-3.0.adoc)
- [Commits](ops4j/org.ops4j.pax.url@url-2.6.17...url-2.7.0)

---
updated-dependencies:
- dependency-name: org.ops4j.pax.url:pax-url-aether
  dependency-version: 2.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps `netty-version` from 4.2.9.Final to 4.2.10.Final.

Updates `io.netty:netty-buffer` from 4.2.9.Final to 4.2.10.Final
- [Commits](netty/netty@netty-4.2.9.Final...netty-4.2.10.Final)

Updates `io.netty:netty-common` from 4.2.9.Final to 4.2.10.Final
- [Commits](netty/netty@netty-4.2.9.Final...netty-4.2.10.Final)

Updates `io.netty:netty-handler` from 4.2.9.Final to 4.2.10.Final
- [Commits](netty/netty@netty-4.2.9.Final...netty-4.2.10.Final)

Updates `io.netty:netty-codec-http` from 4.2.9.Final to 4.2.10.Final
- [Commits](netty/netty@netty-4.2.9.Final...netty-4.2.10.Final)

Updates `io.netty:netty-transport` from 4.2.9.Final to 4.2.10.Final
- [Commits](netty/netty@netty-4.2.9.Final...netty-4.2.10.Final)

---
updated-dependencies:
- dependency-name: io.netty:netty-buffer
  dependency-version: 4.2.10.Final
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: io.netty:netty-common
  dependency-version: 4.2.10.Final
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: io.netty:netty-handler
  dependency-version: 4.2.10.Final
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: io.netty:netty-codec-http
  dependency-version: 4.2.10.Final
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: io.netty:netty-transport
  dependency-version: 4.2.10.Final
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps `shiro-version` from 2.0.6 to 2.1.0.

Updates `org.apache.shiro:shiro-core` from 2.0.6 to 2.1.0
- [Release notes](https://github.com/apache/shiro/releases)
- [Changelog](https://github.com/apache/shiro/blob/main/RELEASE-NOTES)
- [Commits](apache/shiro@shiro-root-2.0.6...shiro-root-2.1.0)

Updates `org.apache.shiro:shiro-spring` from 2.0.6 to 2.1.0

---
updated-dependencies:
- dependency-name: org.apache.shiro:shiro-core
  dependency-version: 2.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.shiro:shiro-spring
  dependency-version: 2.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* [#] NO-JIRA: Update Jenkinsfile to add JDK 25
* [AMQ-9563] Add a SubjectShim to support JAAS API JDK 24+
* [AMQ-9366] Add DataFileFactroy to KahaDBPersistenceAdapter and update test to remove SecurityManager

Co-authored-by: Gurpartap Singh <gurpartap0306>

* Add support for Java 25 in CI configurations

Ensure builds under Java 21 will still work with Security Manager

Only run required tests

* AMQ-9825: ActiveMQ on Java 25
Use Java 25 compatible version of Mockito
Use Mockito Agent because self attaching an agent is now unavailable since Java 21+
Split integration tests (MRJAR dependent) into a specific integration-test phase so they use the jar in the classpath
Do not rely on activeByDefault because when other profiles activate, quick becomes inactive

* Remove unused import for AccessController in SubjectShim.java because the API will be removed anyways

* Do not use * imports

* Attempt to build the MRJAR earlier so tests can use it and we can avoid the failsafe integration tests

* Update Maven Enforcer Plugin to require Java 24+ for builds

---------

Co-authored-by: Matt Pavlovich <mattrpav@apache.org>
…he#1493)

* [AMQ-9769] Add name property to connector interface and MBean.

* [AMQ-9769] Use connector name property in web console.

* Add getConnectionId() to ConnectionViewMBeanAdd.
…q pool tests connection leaks to other tests (apache#1657)

* [AMQ-9861] activemq-pool tests have resource leaks causing test interference
 activemq-pool tests use default broker name causing BrokerRegistry collisions
 Missing waitUntilStopped() after broker.stop() in tests

* [AMQ-9860] Refactor async exception handling to improve resource management and prevent task execution on closed connections

* Increase timeout for exception event propagation in ConnectionFailureEvictsFromPoolTest

* Refactor PooledConnectionFactory to remove AutoCloseable implementation and improve resource management in tests
Bumps `spring-version` from 6.2.15 to 6.2.16.

Updates `org.springframework:spring-aop` from 6.2.15 to 6.2.16
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.2.15...v6.2.16)

Updates `org.springframework:spring-beans` from 6.2.15 to 6.2.16
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.2.15...v6.2.16)

Updates `org.springframework:spring-context` from 6.2.15 to 6.2.16
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.2.15...v6.2.16)

Updates `org.springframework:spring-core` from 6.2.15 to 6.2.16
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.2.15...v6.2.16)

Updates `org.springframework:spring-expression` from 6.2.15 to 6.2.16
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.2.15...v6.2.16)

Updates `org.springframework:spring-jms` from 6.2.15 to 6.2.16
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.2.15...v6.2.16)

Updates `org.springframework:spring-tx` from 6.2.15 to 6.2.16
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.2.15...v6.2.16)

Updates `org.springframework:spring-webmvc` from 6.2.15 to 6.2.16
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.2.15...v6.2.16)

Updates `org.springframework:spring-web` from 6.2.15 to 6.2.16
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.2.15...v6.2.16)

Updates `org.springframework:spring-test` from 6.2.15 to 6.2.16
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.2.15...v6.2.16)

Updates `org.springframework:spring-oxm` from 6.2.15 to 6.2.16
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.2.15...v6.2.16)

---
updated-dependencies:
- dependency-name: org.springframework:spring-aop
  dependency-version: 6.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-beans
  dependency-version: 6.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-context
  dependency-version: 6.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-core
  dependency-version: 6.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-expression
  dependency-version: 6.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-jms
  dependency-version: 6.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-tx
  dependency-version: 6.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-webmvc
  dependency-version: 6.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-web
  dependency-version: 6.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-test
  dependency-version: 6.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-oxm
  dependency-version: 6.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
apache#1667)

For connections created outside the global field, use try-with-resources to avoid leaks
…1680)

testConsumerLateToBigPartyGetsNewGroup had two errors on line 220:
   1. Checked messageCount.get("worker1") instead of "worker2"
   2. Expected 2*perBatch (4) instead of perBatch (2)
- allow merge and rebase on PR
- need at least one review before merging
Bumps `jolokia-version` from 2.4.3 to 2.5.0.

Updates `org.jolokia:jolokia-server-core` from 2.4.3 to 2.5.0
- [Release notes](https://github.com/jolokia/jolokia/releases)
- [Commits](jolokia/jolokia@v2.4.3...v2.5.0)

Updates `org.jolokia:jolokia-service-jmx` from 2.4.3 to 2.5.0

Updates `org.jolokia:jolokia-service-serializer` from 2.4.3 to 2.5.0

---
updated-dependencies:
- dependency-name: org.jolokia:jolokia-server-core
  dependency-version: 2.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.jolokia:jolokia-service-jmx
  dependency-version: 2.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.jolokia:jolokia-service-serializer
  dependency-version: 2.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps `karaf-version` from 4.4.9 to 4.4.10.

Updates `org.apache.karaf.shell:org.apache.karaf.shell.console` from 4.4.9 to 4.4.10

Updates `org.apache.karaf:apache-karaf` from 4.4.9 to 4.4.10

---
updated-dependencies:
- dependency-name: org.apache.karaf.shell:org.apache.karaf.shell.console
  dependency-version: 4.4.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.karaf:apache-karaf
  dependency-version: 4.4.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…e PR one does not have the flag so we can still spot the flaky tests (apache#1685)
…#1679)

Thread.sleep(3000) is unreliable on slow CI machines for waiting on cluster formation and client rebalancing. Replace all sleep-based synchronization with Wait.waitFor polling:
- testClusterConnectedAfterClients: poll for clients on multiple brokers
- testClusterURIOptionsStrip: same polling for client rebalance
- testClusterConnectedBeforeClients: poll for bridge formation, then poll for client failover after broker stop

This also fixes AutoFailoverClusterTest which inherits these methods.
cshannon and others added 28 commits June 23, 2026 13:16
…che#2139)

This change adds support for limiting the maximum inflation size of a
message body when a message needs to be decompressed. This new setting
will help prevent OOM errors from large buffers being allocated.

The primary concern this is addressing is that compressed messages may
be smaller than maxFrameSize and the broker will accept them, but if an
event triggers a decompression a huge buffer could be created and cause
OOM.

The broker will have a new maxInflateDataSize config that is broker wide
because te value isn't tied to a protocol and it will default to 100 MB.
Clients are tied to a transport, so it makes more sense to make it as a
ratio of maxFrameSize. The default is 10x maxFrameSize if configured
which should be enough of a buffer under normal circumstances. The ratio
can be changed using maxInflatedDataSizeRatio on a connection.
…y to skip O(n) expiry scan TopicSubscription

When a slow-consumer's pending-message buffer exceeds the high-water mark
(default: 1000 messages), TopicSubscription.add() calls removeExpiredMessages()
on every single message add. That method iterates every pending message and
calls isExpired(), which is an O(n) scan over the full buffer.
When messages carry no TTL (isExpired() always returns false), this scan
provides no benefit -- it iterates the entire buffer on every add with zero
messages removed. With a large pending limit (e.g. 20,000), this adds up to
millions of no-op iterations per second on busy topics.
This commit adds an expiryCheckEnabled boolean (default true) to MessageEvictionStrategy.
Setting it to false inserts a single guard in TopicSubscription.add():
    if (expiryCheckEnabled  && !matched.isEmpty() && matched.size() > max) {
        removeExpiredMessages();
    }

Also adds:
- TopicSubscriptionEnableExpiryTest: 11 correctness/propagation/integration tests
- TopicSubscriptionEnableExpiryThroughputTest: throughput comparison test
Bumps `shiro-version` from 2.2.0 to 2.2.1.

Updates `org.apache.shiro:shiro-core` from 2.2.0 to 2.2.1
- [Release notes](https://github.com/apache/shiro/releases)
- [Changelog](https://github.com/apache/shiro/blob/main/RELEASE-NOTES)
- [Commits](apache/shiro@shiro-root-2.2.0...shiro-root-2.2.1)

Updates `org.apache.shiro:shiro-spring` from 2.2.0 to 2.2.1

---
updated-dependencies:
- dependency-name: org.apache.shiro:shiro-core
  dependency-version: 2.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.shiro:shiro-spring
  dependency-version: 2.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
apache#2154)

This update makes the following changes/improvements:

* If the wrapped stream is finished and returns -1 this is now returned
  correctly and availableBytes are not decremented.
* Partial reads now will be attempted up to the availableBytes limit
* If 0 is passed in for the length for a partial read then no attempt to
  read is done and 0 is returned, in line with the spec.
…ors (apache#2123)

NetworkConnectorProcessor.configMatch compared raw DTO values (still
holding ${...} placeholders) against the live NetworkConnector whose
attributes had already been resolved by Spring. A connector declared
with placeholders could therefore never be matched for removal or
modification by the RuntimeConfigurationPlugin. Filter the DTO props
through placeHolderUtil before comparing.
…apache#2131)

Bumps [org.javassist:javassist](https://github.com/jboss-javassist/javassist) from 3.31.0-GA to 3.32.0-GA.
- [Release notes](https://github.com/jboss-javassist/javassist/releases)
- [Changelog](https://github.com/jboss-javassist/javassist/blob/master/Changes.md)
- [Commits](https://github.com/jboss-javassist/javassist/commits)

---
updated-dependencies:
- dependency-name: org.javassist:javassist
  dependency-version: 3.32.0-GA
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [org.apache:apache](https://github.com/apache/maven-apache-parent) from 38 to 39.
- [Release notes](https://github.com/apache/maven-apache-parent/releases)
- [Commits](https://github.com/apache/maven-apache-parent/commits)

---
updated-dependencies:
- dependency-name: org.apache:apache
  dependency-version: '39'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [commons-logging:commons-logging](https://github.com/apache/commons-logging) from 1.3.6 to 1.4.0.
- [Changelog](https://github.com/apache/commons-logging/blob/master/RELEASE-NOTES.txt)
- [Commits](apache/commons-logging@rel/commons-logging-1.3.6...rel/commons-logging-1.4.0)

---
updated-dependencies:
- dependency-name: commons-logging:commons-logging
  dependency-version: 1.4.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The previous default was 100 MB but 10 MB makes more sense as a default,
especially with maxInflatedDataSize defaulting to 100 MB.
Add a negative size check for AMQP NIO transports.
This also adds a similar check to OpenWire. For OpenWire
the same IllegalArgumentException is thrown but this
improves the error message in the NIO transport.
This fixes a bug in FilePendingMessageCursor that could cause the
temporary store to exceed 100% usage. The cursor now properly checks the
temporary usage limits when writing messages from memory to the
temporary store. If the store is full, messages are now discarded and
a discarded advisory will be fired (if enabled) and the messages will be
DLQ'd if the processNonPersistent flag is true. This commit also fixes
an issue with Topic subs possibly sending expired messages to the DLQ
twice which was noticed while working on this fix.
In apache#2136 the broker was updated to handle corrupt messages and to send
them to the DLQ and discarding them. This change further improves on
that by sending the message discarded advisory, if it has been enabled
on the destination. By default the discard advisory will be off.
Bumps `log4j-version` from 2.26.0 to 2.26.1.

Updates `org.apache.logging.log4j:log4j-api` from 2.26.0 to 2.26.1

Updates `org.apache.logging.log4j:log4j-core` from 2.26.0 to 2.26.1

Updates `org.apache.logging.log4j:log4j-slf4j2-impl` from 2.26.0 to 2.26.1

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-api
  dependency-version: 2.26.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.logging.log4j:log4j-core
  dependency-version: 2.26.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.logging.log4j:log4j-slf4j2-impl
  dependency-version: 2.26.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
This fixes a bug that prevented broker usage limit updates from being
applied to topics. Previousy topics did not call start() on the usage
trackers for the store or temp store which means those trackers didn't
get registered with the parent tracker. Registering with the parent is
required in order to get notified of updates.

Queues already properly called start/stop to register and deregister the
usage trackers so this commit just brings Topics in line with Queues and
adds a test to verify the trackers now correctly register themselves
with the broker's parent tracker and the limits are applied on updates.
Lastly, the the test verifies the trackers are cleaned up correctly on
destination deletion.
Bumps `jackson-version` from 2.22.0 to 2.22.1.

Updates `com.fasterxml.jackson.core:jackson-core` from 2.22.0 to 2.22.1
- [Commits](FasterXML/jackson-core@jackson-core-2.22.0...jackson-core-2.22.1)

Updates `com.fasterxml.jackson.core:jackson-databind` from 2.22.0 to 2.22.1
- [Commits](https://github.com/FasterXML/jackson/commits)

Updates `com.fasterxml.jackson.dataformat:jackson-dataformat-xml` from 2.22.0 to 2.22.1
- [Commits](FasterXML/jackson-dataformat-xml@jackson-dataformat-xml-2.22.0...jackson-dataformat-xml-2.22.1)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-core
  dependency-version: 2.22.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-version: 2.22.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.fasterxml.jackson.dataformat:jackson-dataformat-xml
  dependency-version: 2.22.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps `xbean-version` from 4.30 to 4.31.

Updates `org.apache.xbean:xbean-spring` from 4.30 to 4.31

Updates `org.apache.xbean:maven-xbean-plugin` from 4.30 to 4.31

Updates `org.apache.xbean:xbean-blueprint` from 4.30 to 4.31

Updates `org.apache.xbean:xbean-finder` from 4.30 to 4.31

Updates `org.apache.xbean:xbean-asm-util` from 4.30 to 4.31

Updates `org.apache.xbean:xbean-bundleutils` from 4.30 to 4.31

---
updated-dependencies:
- dependency-name: org.apache.xbean:xbean-spring
  dependency-version: '4.31'
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.xbean:maven-xbean-plugin
  dependency-version: '4.31'
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.xbean:xbean-blueprint
  dependency-version: '4.31'
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.xbean:xbean-finder
  dependency-version: '4.31'
  dependency-type: direct:development
  update-type: version-update:semver-minor
- dependency-name: org.apache.xbean:xbean-asm-util
  dependency-version: '4.31'
  dependency-type: direct:development
  update-type: version-update:semver-minor
- dependency-name: org.apache.xbean:xbean-bundleutils
  dependency-version: '4.31'
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…e#2190)

Bumps [org.apache.groovy:groovy](https://github.com/apache/groovy) from 5.0.6 to 5.0.7.
- [Commits](https://github.com/apache/groovy/commits)

---
updated-dependencies:
- dependency-name: org.apache.groovy:groovy
  dependency-version: 5.0.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This fixes the rare null body issues seen on the broker when using text
messages by using synchronization when marshaling or unmarshaling the
body into a String to prevent a race condition from causing the body to
end up null. This has been optimized to use volatiles and double checked
locking to avoid synchronization unless needed.
…pache#2191)

Bumps [org.apache.groovy:groovy-ant](https://github.com/apache/groovy) from 5.0.6 to 5.0.7.
- [Commits](https://github.com/apache/groovy/commits)

---
updated-dependencies:
- dependency-name: org.apache.groovy:groovy-ant
  dependency-version: 5.0.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ed inactivity timer dies

The static READ_CHECK_TIMER and WRITE_CHECK_TIMER in AbstractInactivityMonitor are
shared across all transport instances. Java's Timer permanently marks itself cancelled
when its internal thread exits due to an unhandled Error thrown by a TimerTask.
SchedulerTimerTask rethrows Error subclasses, so an OutOfMemoryError in any timer task
kills the shared timer thread while the static field remains non-null. All subsequent
schedule() calls on new connections then throw IllegalStateException ("Timer already
cancelled"), which propagates to TransportConnector.onAcceptError() and is logged as
WARN "Could not accept connection: Timer already cancelled."

Fix: wrap the schedule() calls in startConnectCheckTask() and startMonitorThreads()
in try/catch(IllegalStateException). On catch, the dead timer is cancelled (to let its
thread exit), replaced with a fresh instance, and the task is rescheduled. The guard
condition in startConnectCheckTask() is also extended with || READ_CHECK_TIMER == null
to cover the case where the field is unexpectedly null when CHECKER_COUNTER > 0.

Add three regression tests to InactivityMonitorTest covering:
- READ_CHECK_TIMER cancelled with CHECKER_COUNTER == 0 (startConnectCheckTask path)
- READ_CHECK_TIMER cancelled with CHECKER_COUNTER > 0 (production scenario)
- WRITE_CHECK_TIMER cancelled (startMonitorThreads path)

Tests use Wait.waitFor() instead of Thread.sleep() for reliability on slow CI.
@jbonofre
jbonofre force-pushed the fix/inactivity-monitor-cancelled-timer branch from 0a37622 to 0601849 Compare July 9, 2026 14:31
@jbonofre jbonofre closed this Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.