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

   > 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
   
   Make sense.  But there are some other cases like this. It is better to  fix 
this case in the same way, I think ...


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