Fix #1591
This commit is contained in:
parent
d1127041cf
commit
8d453e62a8
@ -322,6 +322,11 @@ public class DistroConsistencyServiceImpl implements EphemeralConsistencyService
|
||||
if (!listeners.containsKey(key)) {
|
||||
listeners.put(key, new CopyOnWriteArrayList<>());
|
||||
}
|
||||
|
||||
if (listeners.get(key).contains(listener)) {
|
||||
return;
|
||||
}
|
||||
|
||||
listeners.get(key).add(listener);
|
||||
}
|
||||
|
||||
|
@ -143,6 +143,9 @@ public class ServiceManager implements RecordListener<Service> {
|
||||
|
||||
if (oldDom != null) {
|
||||
oldDom.update(service);
|
||||
// re-listen to handle the situation when the underlying listener is removed:
|
||||
consistencyService.listen(KeyBuilder.buildInstanceListKey(service.getNamespaceId(), service.getName(), true), oldDom);
|
||||
consistencyService.listen(KeyBuilder.buildInstanceListKey(service.getNamespaceId(), service.getName(), false), oldDom);
|
||||
} else {
|
||||
putService(service);
|
||||
service.init();
|
||||
|
Loading…
Reference in New Issue
Block a user