Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

work queue: fix some race conditions #14331

Merged
merged 2 commits into from
Mar 9, 2020
Merged

work queue: fix some race conditions #14331

merged 2 commits into from
Mar 9, 2020

Conversation

bkueng
Copy link
Member

@bkueng bkueng commented Mar 9, 2020

  • ScheduledWorkItem::ScheduleClear: remove item from runnable queue

The existing behavior is unexpected: if the work item is already on the
runnable queue, it will still be triggered after a call to ScheduleClear().
This can lead to race conditions.

  • uorb callbacks: fix unregister ordering to avoid race conditions

Mostly only relevant for driver/module stopping, so not critical for current users.

bkueng added 2 commits March 9, 2020 12:06
The existing behavior is unexpected: if the work item is already on the
runnable queue, it will still be triggered after a call to ScheduleClear().
This can lead to race conditions.
The order should be: first unregister, then remove the item from the
runnable queue.
@LorenzMeier LorenzMeier requested a review from dagar March 9, 2020 11:46
@LorenzMeier
Copy link
Member

@bkueng Could you please tag the person you expect to review? I've tagged Daniel now.

@dagar
Copy link
Member

dagar commented Mar 9, 2020

Thanks @bkueng. I lot of the "shutdown" behavior had been glossed over. I was hoping after #12191 (or similar) we could add a specialized version for WorkItems.

@dagar dagar added the bug label Mar 9, 2020
@dagar dagar merged commit 3fef401 into master Mar 9, 2020
@dagar dagar deleted the work_queue_race_fixes branch March 9, 2020 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants