green: Fix a scheduler assertion on yielding#12818
Closed
alexcrichton wants to merge 1 commit intorust-lang:masterfrom
Closed
green: Fix a scheduler assertion on yielding#12818alexcrichton wants to merge 1 commit intorust-lang:masterfrom
alexcrichton wants to merge 1 commit intorust-lang:masterfrom
Conversation
This commit fixes a small bug in the green scheduler where a scheduler task calling `maybe_yield` would trip the assertion that `self.yield_check_count > 0` This behavior was seen when a scheduler task was scheduled many times successively, sending messages in a loop (via the channel `send` method), which in turn invokes `maybe_yield`. Yielding on a sched task doesn't make sense because as soon as it's done it will implicitly do a yield, and for this reason the yield check is just skipped if it's a sched task. I am unable to create a reliable test for this behavior, as there's no direct way to have control over the scheduler tasks. cc rust-lang#12666, I discovered this when investigating that issue
Contributor
|
sounds reasonable... LGTM |
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
May 21, 2024
doc_lazy_continuation: do not warn on End events ``` changelog: none ``` This avoids event spans that would otherwise cause crashes, since an End's span covers the range of the tag (which will be earlier than the line break within the tag).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This commit fixes a small bug in the green scheduler where a scheduler task
calling
maybe_yieldwould trip the assertion thatself.yield_check_count > 0This behavior was seen when a scheduler task was scheduled many times
successively, sending messages in a loop (via the channel
sendmethod), whichin turn invokes
maybe_yield. Yielding on a sched task doesn't make sensebecause as soon as it's done it will implicitly do a yield, and for this reason
the yield check is just skipped if it's a sched task.
I am unable to create a reliable test for this behavior, as there's no direct
way to have control over the scheduler tasks.
cc #12666, I discovered this when investigating that issue