Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/8950 )
Change subject: IMPALA-6346: Potential deadlock in KrpcDataStreamMgr ...................................................................... IMPALA-6346: Potential deadlock in KrpcDataStreamMgr In KrpcDataStreamMgr::CreateRecvr() we take the lock_ and then call recvr->TakeOverEarlySender() for all contexts. recvr->TakeOverEarlySender() then calls recvr_->mgr_->EnqueueDeserializeTask((), which can block if the deserialize pool queue is full. The next thread to become available in that queue will also have to acquire lock_, thus leading to a deadlock. We fix this by moving the EarlySendersList out of the EarlySendersMap and dropping the lock before taking any actions on the RPC contexts in the EarlySendersList. All functions called after dropping 'lock_' do not require the lock to protect them as they are thread safe. Additionally modified the BE test data-stream-test to work with KRPC as well. Testing: Added a new test to data-stream-test to verify that the deadlock does not happen. Also, I verified that this test hangs without the fix. Change-Id: Ib7d1a8f12a4821092ca61ccc8a6f20c0404d56c7 Reviewed-on: http://gerrit.cloudera.org:8080/8950 Reviewed-by: Sailesh Mukil <sail...@cloudera.com> Tested-by: Impala Public Jenkins --- M be/src/runtime/data-stream-test.cc M be/src/runtime/krpc-data-stream-mgr.cc 2 files changed, 267 insertions(+), 59 deletions(-) Approvals: Sailesh Mukil: Looks good to me, approved Impala Public Jenkins: Verified -- To view, visit http://gerrit.cloudera.org:8080/8950 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib7d1a8f12a4821092ca61ccc8a6f20c0404d56c7 Gerrit-Change-Number: 8950 Gerrit-PatchSet: 13 Gerrit-Owner: Sailesh Mukil <sail...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Lars Volker <l...@cloudera.com> Gerrit-Reviewer: Michael Ho <k...@cloudera.com> Gerrit-Reviewer: Sailesh Mukil <sail...@cloudera.com>