Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Prioritize blocked task messaging over idle tasks #627
Prioritize blocked task messaging over idle tasks #627
Changes from 6 commits
3d1be8d
43a1bf2
654a8c8
9d1e074
fa918be
0dca5de
f02ebd8
4e045d7
43ec2af
1261092
6904938
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here (back ref: solana-labs#34676 (comment))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced that the multi-channel set up works correctly without
select_biased!
.Let's say we have something along the lines of:
The idle tasks should be for the new context, but as far as I can tell, there's nothing preventing them from being randomly picked up before the new context in the handler threads.
I do believe this will work with a
select_biased!
call and the proper ordering, but with the randomselect
ing it seems like there's random chance of the chained channel stuff getting messed up wrt to the idle tasks.Maybe I am missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am wrong about this, it'd be great to add a test to convince me 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're totally correct. You saved me. This is a race condition...: f02ebd8, 4e045d7
Well, this won't work even with
select_biased!
... It'll firstly try to receive blocked, then idle. After that, it'llsched_yield
. Before thesched_yeild
, the handler thread still could see the idle task for the next context, if it became visible to the thread just after trying to receive blocked and missed to see new context. this means scheduler thread managed to send the new context then the context's idle task successively between the twotry_recv
s.I think this is the root cause of a mysterious panic, which i only observed once while running against mb...