MCPcopy Create free account
hub / github.com/apache/impala / Cancel

Method Cancel

be/src/runtime/coordinator.cc:1105–1119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1103}
1104
1105void Coordinator::Cancel(bool wait_until_finalized) {
1106 // Illegal to call Cancel() before Exec() returns, so there's no danger of the cancel
1107 // RPC passing the exec RPC.
1108 DCHECK(exec_rpcs_complete_.Load()) << "Exec() must be called first";
1109 discard_result(SetNonErrorTerminalState(ExecState::CANCELLED));
1110 // CancelBackends() is called for all transitions into a terminal state.
1111 // RETURNED_RESULTS, however, calls it with fire_and_forget=false and may be blocked
1112 // waiting for cancellation. In that case, we want explicit cancellation to unblock
1113 // backend_exec_complete_barrier_, which we do by forcing cancellation.
1114 if (ReturnedAllResults()) CancelBackends(/*fire_and_forget=*/ true);
1115
1116 // IMPALA-5756: Wait until finalized, in case a different thread was handling the
1117 // transition to the terminal state.
1118 if (wait_until_finalized) finalized_.Get();
1119}
1120
1121void Coordinator::CancelBackends(bool fire_and_forget) {
1122 int num_cancelled = 0;

Callers 6

TEST_FFunction · 0.45
CancelBackendsMethod · 0.45
TEST_FFunction · 0.45
TeardownMethod · 0.45
RetryQueryFromThreadMethod · 0.45
CancelQueriesMethod · 0.45

Calls 3

discard_resultFunction · 0.85
LoadMethod · 0.45
GetMethod · 0.45

Tested by 2

TEST_FFunction · 0.36
TEST_FFunction · 0.36