Forward error_call value in Pool$release - #205
Merged
Merged
Conversation
hadley
reviewed
Sep 14, 2026
| pool <- poolCreate(function() 1) | ||
| defer(poolClose(pool)) | ||
|
|
||
| expect_error(pool$release(1), "not an pooled object") |
Member
There was a problem hiding this comment.
Could you please use expect_snapshot() here so we can see the call it uses?
Contributor
Author
There was a problem hiding this comment.
Sure. Just a quick check: When I call it from the test, the caller is the test environment, which has no call to show. Do you want me to wrap it in a helper function so there is an actual call to see?
Member
There was a problem hiding this comment.
Yes please! (There's some trickiness sometimes with OO dispatch that I don't think affects R6, but is good to double check).
Member
|
Thank you! |
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.
Pool$release()forwarded its error context with:The local
error_callformal holds an environment, the result ofcaller_env(). R function lookup skips bindings that are not functions, soerror_call()resolved torlang::error_call(), which requirescalland errored withargument "call" is missing, with no default.pool_metadata()forceserror_callonly on its abort paths, so the bug is latent: releasing a valid pooled object works, but releasing an object that is not pooled or is no longer valid died with that error instead of the intended message. The value is now forwarded without the call parentheses.Found during my most recent ry audit.