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

   ### Motivation
   
   Original from 
https://github.com/apache/pulsar/pull/15139#issuecomment-1098692062.
   
   If create topic fails, many code branch handle cleanup operation for 
`topics` map like `pulsar.getExecutor().execute(() -> topics.remove(topic, 
topicFuture));`, handle it in separate thread to avoid deadlock, and some code 
branch doesn't. IMO, it should be handled properly in just one place.
   
   ### Modifications
   
   1. handle cleanup operation before return future result
   2. delete other cleanup operation except one with specific reason 
https://github.com/Shawyeok/pulsar/blob/78bbbe66d5abf66fc0c6ce15624107227a17a360/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java#L1190
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
   Check the box below or label this PR directly.
   
   Need to update docs? 
   
   - [x] `no-need-doc` 
   Just refactor work


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