Impala Public Jenkins has submitted this change and it was merged. ( 
https://gerrit.cloudera.org/25566 )

Change subject: IMPALA-15848: Fix double unlock in SenderQueue::AddBatch()
......................................................................

IMPALA-15848: Fix double unlock in SenderQueue::AddBatch()

IMPALA-13475 added a lock_.unlock() call to the is-cancelled branch of
KrpcDataStreamRecvr::SenderQueue::AddBatch(). The unique_lock that
acquired the lock still owns it, so it unlocks lock_ again when the
function returns. base::SpinLock::Unlock() does not check the owner,
so the second unlock can release the lock while another thread holds
it.

The branch runs when a TransmitData RPC reaches a receiver that was
just cancelled, e.g. when a LIMIT closes the exchange early. A
dockerised test run crashed this way in test_limit: Close() emptied
the batch queue while a deserialization thread was still adding a
batch to it, so DCHECKs failed in ProcessDeferredRpc() and in
MemTracker::Close().

This patch unlocks through the unique_lock, as TakeOverEarlySender()
already does.

Testing:
 - Ran data-stream-test.

Change-Id: I0d8783b883b3acaf2746f510f180176867559216
Assisted-by: Claude Opus 5.5 (Claude Code)
Reviewed-on: https://gerrit.cloudera.org/25566
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
M be/src/runtime/krpc-data-stream-recvr.cc
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

--
To view, visit https://gerrit.cloudera.org/25566
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0d8783b883b3acaf2746f510f180176867559216
Gerrit-Change-Number: 25566
Gerrit-PatchSet: 3
Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>

Reply via email to