Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Fix deadlock on task scheduling when VM start fails #164

Merged
merged 2 commits into from
Mar 22, 2024
Merged

Conversation

tuommaki
Copy link
Contributor

When VM startup fails, the task is rescheduled and after recent changes to scheduler state management, this structure caused deadlock.

Inline task rescheduling to avoid deadlock.

When VM startup fails, the task is rescheduled and after recent changes
to scheduler state management, this structure caused deadlock.

Inline task rescheduling to avoid deadlock.
@tuommaki tuommaki self-assigned this Mar 22, 2024
@@ -310,7 +310,9 @@ impl Scheduler {
state.task_queue.remove(&task.tx);
}

self.reschedule(&task).await?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

self.state is locked here, but fn reschedule() tried to lock it again, in order to push the task back to queue.

@tuommaki tuommaki requested a review from musitdev March 22, 2024 11:16
@tuommaki tuommaki merged commit c17a942 into main Mar 22, 2024
4 checks passed
@tuommaki tuommaki deleted the drop-deadlock branch March 22, 2024 11:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants