Avoid re-polling while reporting a Thread#raise#8478
Merged
headius merged 2 commits intojruby:masterfrom Dec 3, 2024
Merged
Conversation
1e2111e to
dab2510
Compare
dab2510 to
92ff9c9
Compare
This reverts commit 79ac759.
92ff9c9 to
e77566a
Compare
Member
Author
|
Initial naive attempt clearly doesn't pass. |
e77566a to
663b9d9
Compare
Member
Author
|
Replaced original attempt (clear interrupt queue when raising) with a new version that simply avoids polling during IO for the raise report. This should fix the original issue without substantially changing the way interrupts are handled. |
2a07e0f to
c8b08d9
Compare
Dynamically printing error output to the configured stderr stream may trigger additional thread interrupt polls, wiping out any thread interrupt currently being reported or propagated. This patch avoids such polls by writing directly to the underlying IO without using Ruby logic if and only if it is the original (boot) stderr stream. This also removes a second poll that happens when exiting the blocking task for a raise, a side effect of using afterBlockingCall to set the new status. The status update happens again after this point, and the poll is spurious. Fixes jruby#8479
c8b08d9 to
39cd7eb
Compare
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.
Avoid polling during propagation and report of a
Thread#raiseexception. If we dispatch dynamically to the configured stderr, we may hit additional polls that trigger new interrupts, wiping out the raise interrupt currently being handled.Fixes #8479