mirror of https://github.com/apache/druid.git
fix concurrency problem
This commit is contained in:
parent
5ac2d1db0b
commit
83b96ee507
|
@ -227,10 +227,9 @@ public class Announcer
|
|||
boolean created = false;
|
||||
synchronized (toAnnounce) {
|
||||
if (started) {
|
||||
byte[] oldBytes = subPaths.get(pathAndNode.getNode());
|
||||
byte[] oldBytes = subPaths.putIfAbsent(pathAndNode.getNode(), bytes);
|
||||
|
||||
if (oldBytes == null) {
|
||||
subPaths.put(pathAndNode.getNode(), bytes);
|
||||
created = true;
|
||||
} else if (!Arrays.equals(oldBytes, bytes)) {
|
||||
throw new IAE("Cannot reannounce different values under the same path");
|
||||
|
|
Loading…
Reference in New Issue