Michael Smith has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/23379 )

Change subject: IMPALA-14392: Fix a crash in AdmissionD in GetQueryStatus 
PrintId()
......................................................................

IMPALA-14392: Fix a crash in AdmissionD in GetQueryStatus PrintId()

The GetQueryStatus RPC could crash due to a use-after-free error
when accessing the reqest. When a query was rejected, the
function would call RespondAndReleaseRpc(), which can free the "req"
object, and then attempt to access req->query_id() for logging and
to delete the entry from the admission_state_map_.

This commit fixes the crash by moving the call to
RespondAndReleaseRpc() to the end of the function. This change
aligns this function with others like
AdmissionControlService::ReleaseQuery(), which also deletes from
admission_state_map_ before RespondAndReleaseRpc(), it ensures
that all logic is completed before the RPC resources are released.

Tests:
Reproduced the issue by running 100 times
TestAdmissionControllerStressWithACService::test_mem_limit, and
after the change, it can successfully run 100 times.
Passed exhaustive tests.

Change-Id: I688954c5c671671cc2dc669ecfdf2405476302d7
Reviewed-on: http://gerrit.cloudera.org:8080/23379
Reviewed-by: Michael Smith <[email protected]>
Tested-by: Michael Smith <[email protected]>
---
M be/src/scheduling/admission-control-service.cc
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Michael Smith: Looks good to me, approved; Verified

--
To view, visit http://gerrit.cloudera.org:8080/23379
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I688954c5c671671cc2dc669ecfdf2405476302d7
Gerrit-Change-Number: 23379
Gerrit-PatchSet: 3
Gerrit-Owner: Yida Wu <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Riza Suminto <[email protected]>

Reply via email to