atiaomar1978-hub commented on PR #25001:
URL: https://github.com/apache/camel/pull/25001#issuecomment-5043014926

   Thanks for the thorough review, @gnodet!
   
   **Session receiver leak (fixed)** — you're right. `SessionLockRenewer.run()` 
removed entries from the tracking map on the max-duration and renewal-error 
paths without releasing the reference-counted session receiver, so the 
completion callback later saw a `null` entry and skipped 
`releaseSessionReceiver()`, leaving `inFlightCount` above zero and the receiver 
open. Both paths now call `releaseSessionReceiver(entry.sessionId)` guarded by 
`entries.remove(exchangeId) != null` so the atomic `remove` guarantees exactly 
one release regardless of whether `run()` or the completion callback wins the 
race.
   
   **Acquire/release race (hardened)** — also addressed. 
`acquireSessionReceiver()` and `releaseSessionReceiver()` are now both guarded 
by the same `sessionReceiverCreationLock`, making the increment/create and 
decrement/close operations atomic relative to each other. A newly arriving 
message can no longer increment a holder that a concurrently completing 
exchange is about to close.
   
   Added a test (`sessionLockRenewerReleasesSessionReceiverOnRenewalFailure`) 
verifying the receiver is closed when `renewSessionLock()` fails.
   
   Pushed in b2042a5. `mvn test -pl 
components/camel-azure/camel-azure-servicebus` passes.
   
   _Claude Opus 4.8 on behalf of atiaomar1978-hub_


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to