Skip to content

[IOTDB-5786] Fix potential deadlock in DriverScheduler#9640

Merged
JackieTien97 merged 2 commits intoapache:masterfrom
lancelly:fixDeadLock
Apr 19, 2023
Merged

[IOTDB-5786] Fix potential deadlock in DriverScheduler#9640
JackieTien97 merged 2 commits intoapache:masterfrom
lancelly:fixDeadLock

Conversation

@lancelly
Copy link
Contributor

@lancelly lancelly commented Apr 18, 2023

This pr aims to fix potential deadlock in DriverScheduler caused by concurrently calling abortFramentInstance and toAborted.
See https://apache-iotdb.feishu.cn/docx/KFsvdMwL4orqkCxrdARc37W8nxf for more details.

} finally {
task.unlock();
}
task.setAbortCause(DriverTaskAbortedException.BY_QUERY_CASCADING_ABORTED);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a little problem. If we set abort cause without lock, the origin cause may be occupied.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, even though we set it with lock, it can be occupied too. Maybe a status check is necessary, or just delete the abort cause, it seems we don't care it...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it seems that the last write wins

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, even though we set it with lock, it can be occupied too. Maybe a status check is necessary, or just delete the abort cause, it seems we don't care it...

For now we just need it not to be NULL

@JackieTien97 JackieTien97 merged commit b9fa37c into apache:master Apr 19, 2023
@lancelly lancelly deleted the fixDeadLock branch April 23, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants