You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@artemis.apache.org by "jbertram (via GitHub)" <gi...@apache.org> on 2026/08/24 02:27:27 UTC

[PR] ARTEMIS-6199 Fix race in WildcardAddressManager [artemis]

jbertram opened a new pull request, #6637:
URL: https://github.com/apache/artemis/pull/6637

   When a message is routed, the Bindings for the address is fetched from the address manager. If the Bindings doesn't already exist then it is created. Creating the bindings involves traversing the address tree map to find all matching wildcard addresses. When a matching address is found its bindings are copied.
   
   Traversing the address tree map is performed without any kind of synchronization. Therefore, a concurrent operation to remove a binding can modify a wildcard address's Bindings mid-copy. This produces a Bindings that is missing the binding being concurrently removed. The removeBinding visitor then walks matching addresses to remove the binding from each, but fails with IllegalStateException on the address where the binding was never copied. This can also leak entires in addressMap & mappings eventually leading to OOME, since the exception aborts the visitor traversal and skips cleanup of remaining addresses.
   
   - Add addressMapLock to synchronize the lazy-creation path in getBindingsForRoutingAddress with addBinding, removeBinding, removeAddressInfo, and clear. The common path (cache hit) does not acquire the lock.
   - Catch IllegalStateException in the removeBinding visitor as defense-in-depth so that a missing binding does not abort the traversal and leak remaining entries.
   - Add tests to reproduce the race: a deterministic test that simulates the inconsistent state and verifies the visitor handles the missing binding, and a concurrent stress test that exercises getBindingsForRoutingAddress against wildcard binding add/remove.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6199 Fix race in WildcardAddressManager [artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on PR #6637:
URL: https://github.com/apache/artemis/pull/6637#issuecomment-5397765092

   (I am assuming the tests reproduced the issue and no regressions happened on the whole testsuite) if those are good.. I aprove the changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6199 Fix race in WildcardAddressManager [artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on PR #6637:
URL: https://github.com/apache/artemis/pull/6637#issuecomment-5397758871

   looked though it and LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6199 Fix race in WildcardAddressManager [artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram commented on PR #6637:
URL: https://github.com/apache/artemis/pull/6637#issuecomment-5390021234

   FYI - The full test-suite is green on this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6199 Fix race in WildcardAddressManager [artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram merged PR #6637:
URL: https://github.com/apache/artemis/pull/6637


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org