Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/9446 )
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 Reviewed-on: http://gerrit.cloudera.org:8080/9446 Reviewed-by: Dan Hecht <dhe...@cloudera.com> Tested-by: Impala Public Jenkins --- 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(-) Approvals: Dan Hecht: Looks good to me, approved Impala Public Jenkins: Verified -- 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: merged Gerrit-Change-Id: I4a3b0789633c7b8bc898381d509e2af769f0e069 Gerrit-Change-Number: 9446 Gerrit-PatchSet: 6 Gerrit-Owner: Michael Ho <k...@cloudera.com> Gerrit-Reviewer: Dan Hecht <dhe...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Michael Ho <k...@cloudera.com> Gerrit-Reviewer: Sailesh Mukil <sail...@cloudera.com>