Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/925#discussion_r137955415
--- Diff:
exec/rpc/src/main/java/org/apache/drill/exec/rpc/RequestIdMap.java ---
@@ -54,10 +52,14 @@ void channelClosed(Throwable ex) {
isOpen.set(false);
if (ex != null) {
final RpcException e = RpcException.mapException(ex);
+ IntObjectHashMap<RpcOutcome<?>> clonedMap;
synchronized (map) {
- map.forEach(new SetExceptionProcedure(e));
+ clonedMap = map.clone();
map.clear();
}
+ if (clonedMap != null) {
--- End diff --
Please do. The if statement is a message to readers that clonedMap could be
null and so we must try to sleuth out the conditions under which that occurs.
Otherwise, I just go ahead and assume that Java is deterministic and that, once
we set variable x in a single-threaded environment, it stays at that value
until we change it...
---