You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/04/22 07:02:09 UTC

[GitHub] [pulsar] eolivelli commented on pull request #15139: [fix][broker]Fix create topic fail deadlock

eolivelli commented on PR #15139:
URL: https://github.com/apache/pulsar/pull/15139#issuecomment-1106077001

   in theory we should follow the semantics of computeIfAbsent, that is...if the operation fails we should return null, and not try to remove something that is not in the map
   
   
   what about this:
   
   ```
   if (topics.contains(topic)) {
     topics.remove(topic, topicFuture);
   }
   
   ```
   
   so, if we are in the case of "computeIfAbsent" when the topicFuture has not been added to the map, we do nothing.
   if we are in other code paths, in which the topic is already in the map, we do the remove operation
   


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