Skip to content

fix(workspace): make Release idempotent (audit #14.2) - #268

Merged
sbalabanov merged 1 commit into
mainfrom
audit/fix-14-2-workspace-release
Aug 4, 2026
Merged

fix(workspace): make Release idempotent (audit #14.2)#268
sbalabanov merged 1 commit into
mainfrom
audit/fix-14-2-workspace-release

Conversation

@sbalabanov

@sbalabanov sbalabanov commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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 Release calls that could return the same workspace slot multiple times or block on a full pool channel.

Changes

  • Guard the release callback with sync.Once.
  • Document the idempotent Release contract.
  • Cover sequential and concurrent repeated releases.

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=false
  • make gazelle
  • aifx verify

Revert Plan

Revert this PR to restore the previous repeatable release callback behavior.

Jira Issues

None.

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.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sbalabanov
sbalabanov marked this pull request as ready for review August 3, 2026 23:50
@sbalabanov
sbalabanov requested review from a team as code owners August 3, 2026 23:51
@sbalabanov
sbalabanov merged commit 31cdf84 into main Aug 4, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants