Github user HeartSaVioR commented on the issue:
https://github.com/apache/storm/pull/2622
@revans2
Could you elaborate how protection works?
At the first time I thought it leverages atomicity of compute*, but reading
description of compute* in Map, looks like guaranteeing atomicity is not forced
to implementations.
https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#compute-K-java.util.function.BiFunction-
and HashMap doesn't mention about atomicity (`topologyBlobs` is a HashMap):
https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#compute-K-java.util.function.BiFunction-
whereas ConcurrentHashMap mentions about atomicity so at least this
guarantees atomicity:
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html#compute-K-java.util.function.BiFunction-
It may worth noting that implementation requirement in ConcurrentMap looks
like a bit different from what ConcurrentHashMap provides. `The default
implementation may retry these steps when multiple threads attempt updates
including potentially calling the remapping function multiple times.` It
doesn't mention locking but retrying.
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentMap.html#compute-K-java.util.function.BiFunction-
---