[#4834] Fix race in AddressResolverGroup
Motivation: We miss to use synchronized when remove the executor from the map. Modifications: Add synchronized(...) keyword Result: No more race.
This commit is contained in:
parent
a51e2c8769
commit
0f3d47199b
@ -73,7 +73,9 @@ public abstract class AddressResolverGroup<T extends SocketAddress> implements C
|
||||
executor.terminationFuture().addListener(new FutureListener<Object>() {
|
||||
@Override
|
||||
public void operationComplete(Future<Object> future) throws Exception {
|
||||
resolvers.remove(executor);
|
||||
synchronized (resolvers) {
|
||||
resolvers.remove(executor);
|
||||
}
|
||||
newResolver.close();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user