Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21110 )
Change subject: IMPALA-12878: Report invalid query if finalized ...................................................................... Patch Set 1: (1 comment) http://gerrit.cloudera.org:8080/#/c/21110/1/be/src/runtime/query-driver.cc File be/src/runtime/query-driver.cc: http://gerrit.cloudera.org:8080/#/c/21110/1/be/src/runtime/query-driver.cc@502 PS1, Line 502: } : > Can inject SLEEP using debug_actions option or flag here after L502 to dete I had to add it before line 500, and only if check_inflight is true. What happens in the failing case is that UnregisterQuery is called twice, once due to close() and once as part of CloseSessionInternal. The sequence of events is: 1. close() invokes UnregisterQuery(check_inflight=true); it gets the active query handle from query_driver_map_, then for some reason pauses. 2. CloseSessionInternal sees the query is still inflight and calls UnregisterQuery(check_inflight=false). It executes completely, and FinishUnregisterQuery runs on another thread at least as far as CloseClientRequestState (to remove the query from inflight_queries). If it goes further that doesn't matter because (1) already has a shared_ptr<QueryDriver>. 3. The 1st UnregisterQuery resumes and calls Finalize, which then sees check_inflight=true and is_inflight()=false, so it returns "Query not yet running". -- To view, visit http://gerrit.cloudera.org:8080/21110 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3bf910f499147a09352f9dcb755037b0d8616dfd Gerrit-Change-Number: 21110 Gerrit-PatchSet: 1 Gerrit-Owner: Michael Smith <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Riza Suminto <[email protected]> Gerrit-Comment-Date: Wed, 06 Mar 2024 22:50:18 +0000 Gerrit-HasComments: Yes
