Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
Impala 2.7.0
-
None
-
None
Description
If debug action is set to "PREPARE:WAIT", Prepare() will call ExecDebugAction() and wait in a loop. However, the query cannot be cancelled.
Status ExecNode::ExecDebugAction() { ... if (debug_action_ == TDebugAction::WAIT) { while (!state->is_cancelled()) { sleep(1); } return Status::CANCELLED; } ... }
This is because Cancel() needs to get "prepare_lock_" to set cancel state. the lock is still hold by Prepare() which is stuck in a loop wait for cancel.
void PlanFragmentExecutor::Cancel() { VLOG_QUERY << "Cancelling plan fragment..."; lock_guard<mutex> l(prepare_lock_); is_cancelled_ = true; if (!is_prepared_) { VLOG_QUERY << "Cancel() called before Prepare()"; return; } DCHECK(runtime_state_ != NULL); VLOG_QUERY << "Cancel(): instance_id=" << runtime_state_->fragment_instance_id(); runtime_state_->set_is_cancelled(true); runtime_state_->stream_mgr()->Cancel(runtime_state_->fragment_instance_id()); }
Attachments
Issue Links
- duplicates
-
IMPALA-5202 Debug action WAIT in PREPARE leads to hung query that cannot be cancelled.
- Resolved