Skip to content

Commit

Permalink
Signal timeout when locking task in getLongRunningOpCalls (#8511)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #8511

If there are some problem (e.g. deadlock) with the mutex in `Task`,
`getLongRunningOpCalls` would block forever waiting for it.  In this case we
should signal the error and let the caller to generate some form of alerts.
This is important as we rely on `getLongRunningOpCalls` to detect blocking and
the function itself should not block.

Reviewed By: xiaoxmeng

Differential Revision: D53048088

fbshipit-source-id: 5825ee5887a33ffcc97ab0acd54a3c6bab059441
  • Loading branch information
Yuhta authored and facebook-github-bot committed Jan 24, 2024
1 parent 54e87d8 commit 147ff30
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 60 deletions.
2 changes: 1 addition & 1 deletion velox/exec/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void BlockingState::setResume(std::shared_ptr<BlockingState> state) {
auto& driver = state->driver_;
auto& task = driver->task();

std::lock_guard<std::mutex> l(task->mutex());
std::lock_guard<std::timed_mutex> l(task->mutex());
if (!driver->state().isTerminated) {
state->operator_->recordBlockingTime(
state->sinceMicros_, state->reason_);
Expand Down
Loading

0 comments on commit 147ff30

Please sign in to comment.