You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "Asthenia0412 (via GitHub)" <gi...@apache.org> on 2026/09/28 09:20:26 UTC

[PR] [fix][client] Release connections opened after close [pulsar]

Asthenia0412 opened a new pull request, #26733:
URL: https://github.com/apache/pulsar/pull/26733

   ### Motivation
   
   If a producer or consumer closes while its connection is still being established, `connectionOpened` can receive the new connection after the client has already returned. In the unpooled configuration, the connection must be released explicitly; otherwise it can remain open for the lifetime of a shared event loop. Issue #26730 describes this leak when clients use `connectionsPerBroker(0)` with shared resources.
   
   ### Modifications
   
   Release the connection when producer or consumer state prevents it from being adopted. Add focused tests for both late connection callbacks and verify each callback returns the connection to the pool for cleanup.
   
   ### Checks
   
   - `./gradlew :pulsar-client-original:test --tests 'org.apache.pulsar.client.impl.ConsumerImplTest.testConnectionOpenedAfterConsumerCloseReleasesConnection' --tests 'org.apache.pulsar.client.impl.ProducerImplTest.testConnectionOpenedAfterProducerCloseReleasesConnection' -PtestRetryCount=0` (passed)
   - `./gradlew quickCheck` (passed)
   
   Fixes #26730
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [PR] [fix][client] Release connections opened after close [pulsar]

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


-- 
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: commits-unsubscribe@pulsar.apache.org

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