oneby-wang opened a new pull request, #25947:
URL: https://github.com/apache/pulsar/pull/25947

   ### Motivation
   
   When the same `ServiceUrlProvider` instance is reused to build a second 
`PulsarClientImpl`, the provider rejects the second initialization because each 
provider instance is tied to one client lifecycle.
   
   The second client constructor currently enters the failure cleanup path and 
calls `shutdown()`, which closes `conf.getServiceUrlProvider()` 
unconditionally. This can close a provider that is still owned by the first 
live client.
   
   ### Modifications
   
   - Track whether the current `PulsarClientImpl` successfully initialized its 
`ServiceUrlProvider`.
   - Close the provider during `shutdown()` only when this client successfully 
initialized it.
   - Add a regression test that verifies a failed second client build does not 
close the provider used by the first client.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   ### Does this pull request potentially affect one of the following parts:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *If the box was checked, please highlight the changes*
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment
   


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