Preserve worker pool control flow during cancellation - #209
Merged
Conversation
It's possible for subsequent iterations of the loop to clear errinfo before we call rb_jump_tag with state so we should preserve both. See also https://bugs.ruby-lang.org/issues/22240
Signed-off-by: Samuel Williams <samuel.williams@shopify.com> Assisted-By: devx/ba580080-a8e3-4866-9330-83d33d37746c
Signed-off-by: Samuel Williams <samuel.williams@shopify.com> Assisted-By: devx/ba580080-a8e3-4866-9330-83d33d37746c
Member
|
Can you let me know if this solved your problem? |
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.
It is possible for subsequent iterations of the worker-pool wait loop to clear the pending Ruby control-flow state before it can be rethrown.
Use
rb_ensureso Ruby preserves the complete opaque jump state while the ensure callback cancels and drains unfinished work. Errors or other non-local exits raised while draining are discarded, after which Ruby restores and rethrows the original state.The tests cover both an exception followed by an internal rescue and a
throwfollowed by an internal rescue.See also https://bugs.ruby-lang.org/issues/22240
Types of Changes
Contribution