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

Fix deadlock when only calling Executor::tick to drive it #102

Closed
wants to merge 3 commits into from

Conversation

james7132
Copy link
Contributor

@james7132 james7132 commented Feb 22, 2024

Pre-1.9.0, you could spawn tasks on one thread, and then manually tick on another without issue since all tasks were queued into the global injector queue. Now that spawn prioritizes local queues over the global injector queue, this no longer works properly. To fix this, this PR changes Ticker::runnable to steal one task from the other thread-local queues.

Ticker::drop was also not taking and dropping the Waker from the thread local queue.

@james7132 james7132 changed the title Steal tasks when ticking executor manually Fix deadlock when only calling Executor::tick to drive it Feb 23, 2024
Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

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

I created a new set of tests to catch this deadlock at #104. However it appears that this PR does not fix the deadlock.

LGTM otherwise

@james7132
Copy link
Contributor Author

As in those tests pass even in the base #93 without this fix? Or that this PR doesn't fix those tests?

@notgull
Copy link
Member

notgull commented Feb 25, 2024

Yes, these tests pass on master when #93 is removed via rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants