Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.6.0] Fix race condition with multiplex sandboxed workers #25491

Open
wants to merge 1 commit into
base: release-7.6.0
Choose a base branch
from

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Mar 6, 2025

Prior to this change, multiplex sandboxed workers shared a working directory per mnemonic. This caused a race condition when a new multiplex sandboxed worker with the same mnemonic was launched because when launching it cleaned the working directory. That could cause problems for any actions executing in that directory.

This change makes it so each multiplex sandbox worker process has a unique working directory. It does so while ensuring each SandboxedWorkerProxy and the associated sandbox are still associated with the correct multiplexer process and working directory.

Resolves #22589

I couldn't figure out if the Bazel repo has an autoformatter somewhere, so I did my best to manually format the code with a style that follows the existing code.

Closes #25400.

PiperOrigin-RevId: 732256101
Change-Id: If8deea240fda77780feaeac352cf099fb9bfcee3 (cherry picked from commit d54fc62)

Fixes #25460

@fmeum fmeum requested a review from a team as a code owner March 6, 2025 19:48
@fmeum fmeum requested a review from oquenchil March 6, 2025 19:49
@github-actions github-actions bot added awaiting-review PR is awaiting review from an assigned reviewer team-Local-Exec Issues and PRs for the Execution (Local) team labels Mar 6, 2025
Prior to this change, multiplex sandboxed workers shared a working directory per mnemonic. This caused a race condition when a new multiplex sandboxed worker with the same mnemonic was launched because when launching it cleaned the working directory. That could cause problems for any actions executing in that directory.

This change makes it so each multiplex sandbox worker process has a unique working directory. It does so while ensuring each SandboxedWorkerProxy and the associated sandbox are still associated with the correct multiplexer process and working directory.

Resolves bazelbuild#22589

I couldn't figure out if the Bazel repo has an autoformatter somewhere, so I did my best to manually format the code with a style that follows the existing code.

Closes bazelbuild#25400.

PiperOrigin-RevId: 732256101
Change-Id: If8deea240fda77780feaeac352cf099fb9bfcee3
(cherry picked from commit d54fc62)
@fmeum fmeum force-pushed the 25460-worker-race branch from e656861 to 81a24e7 Compare March 6, 2025 20:03
@iancha1992 iancha1992 enabled auto-merge March 6, 2025 21:31
@fmeum
Copy link
Collaborator Author

fmeum commented Mar 6, 2025

The test failure on macOS is very likely unrelated, but pretty persistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review PR is awaiting review from an assigned reviewer team-Local-Exec Issues and PRs for the Execution (Local) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants