Hello Sailesh Mukil, Dan Hecht, I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/9446 to look at the new patch set (#5). Change subject: IMPALA-6554: Fix a race in DequeueDeferredRpc() ...................................................................... IMPALA-6554: Fix a race in DequeueDeferredRpc() Previously, KrpcDataStreamRecvr::DequeueDeferredRpc() will call RespondAndReleaseRpc() outside the of sender queue's lock. Another thread can race ahead and call KrpcDataStreamRecvr::Close() before MemTracker::Release() is called on the receiver's MemTracker. This may lead to update to the receiver's MemTracker after it has been closed. This change fixes the problem by updating the MemTracker before dropping the lock in DequeueDeferredRpc(). This change also changes RespondAndReleaseRpc() to update the MemTracker first before responding to the RPC. The order doesn't really matter much because the response of an RPC is handled asynchronously by reactor threads so there is always a window between when the MemTracker is updated and when the actual RPC payload is freed. The order is updated so it's consistent with that of DequeueDeferredRpc(). Change-Id: I4a3b0789633c7b8bc898381d509e2af769f0e069 --- M be/src/rpc/impala-service-pool.cc M be/src/runtime/krpc-data-stream-mgr.cc M be/src/runtime/krpc-data-stream-mgr.h M be/src/runtime/krpc-data-stream-recvr.cc M be/src/runtime/krpc-data-stream-recvr.h M be/src/service/data-stream-service.cc M be/src/service/data-stream-service.h 7 files changed, 60 insertions(+), 47 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/46/9446/5 -- To view, visit http://gerrit.cloudera.org:8080/9446 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4a3b0789633c7b8bc898381d509e2af769f0e069 Gerrit-Change-Number: 9446 Gerrit-PatchSet: 5 Gerrit-Owner: Michael Ho <k...@cloudera.com> Gerrit-Reviewer: Dan Hecht <dhe...@cloudera.com> Gerrit-Reviewer: Michael Ho <k...@cloudera.com> Gerrit-Reviewer: Sailesh Mukil <sail...@cloudera.com>