fix(workspace): make Release idempotent (audit #14.2) - #268
Merged
Conversation
Summary: Audit #14.2 extracts workspace release safety from #262. Intent: - Prevent repeated releases from returning the same workspace slot more than once. - Make the lifecycle contract safe under concurrent cleanup paths. Changes: - Guard the release callback with sync.Once. - Document the idempotent Release contract. - Cover sequential and concurrent repeated releases.
|
|
xytan0056
approved these changes
Aug 4, 2026
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.
Summary
Audit #14.2. Make workspace release idempotent so a worker slot can be returned to its pool at most once.
Intent
Protect cleanup paths from duplicate or concurrent
Releasecalls that could return the same workspace slot multiple times or block on a full pool channel.Changes
sync.Once.Releasecontract.Test Plan
go test -race ./core/workspace./tools/bazel test //core/workspace:workspace_test --test_output=errors --test_env=GIT_CONFIG_COUNT=1 --test_env=GIT_CONFIG_KEY_0=commit.gpgsign --test_env=GIT_CONFIG_VALUE_0=falsemake gazelleaifx verifyRevert Plan
Revert this PR to restore the previous repeatable release callback behavior.
Jira Issues
None.