bdmendes opened a new pull request, #2063:
URL: https://github.com/apache/pekko-connectors/pull/2063

   `AmqpCachedConnectionProvider` has two issues when several stages share it:
   
   - **Busy-wait:** while one caller connects or closes, other `get`/`release` 
callers spin, keeping a thread at full CPU for up to the connection timeout.
   - **Closed-connection reuse:** after the broker closes the connection, `get` 
keeps returning it until every client releases it, so restarting stages fail 
again on it.
   
   Changes:
   - Guard `get`/`release` with a lock instead of the compare-and-set loop.
   - Replace the cached connection on `get` when it is closed. The old 
connection is released once its last client releases it.
   
   Tests cover closed-connection replacement and concurrent `get` waiting on 
the lock while a connect is in progress.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to