exec: detaches scope finaliser on termination - #64
Merged
Merged
Conversation
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.
What type of PR is this? (check all applicable)
Description
Fixes a lifetime leak in
fibers.io.execwhere completed commands retained their scope finaliser until the parent scope exited.Previously, each command registered a scope finaliser when started. Commands that completed normally kept that finaliser attached, which retained the command object and associated process/stream/backend state for the lifetime of the parent scope. In long-lived scopes that repeatedly run short commands, this caused completed exec commands to accumulate.
Changes:
run_op()/ wait semantics by returning cached terminal status on subsequent waits.Manual test
Manual test description
Ran the full fibers test suite successfully with both Lua and LuaJIT.
The new regression test verifies that completed commands detach their scope finalisers before scope exit, and that repeated waits on a completed command continue to return the same status.
Added tests?
Added to documentation?