executor: mount isolated POSIX shared memory per action - #34
Open
zbarsky-openai wants to merge 1 commit into
Open
zbarsky-openai wants to merge 1 commit into
zbarsky-openai wants to merge 1 commit into
Conversation
Python multiprocessing fails inside an action sandbox while creating a POSIX
named semaphore:
```text
executor = ProcessPoolExecutor(max_workers=5, mp_context=multiprocessing.get_context("spawn"))
...
self._semlock = _multiprocessing.SemLock(...)
FileNotFoundError: [Errno 2] No such file or directory
```
Create `/dev/shm` alongside each action's existing base directories and mount a
private 64 MiB tmpfs after entering its mount namespace. Keep the mount
`nosuid,nodev,noexec`, give it the standard sticky world-writable mode, and
perform the mount before dropping sandbox privileges. Extend the existing base
directory test to cover the new mount point.
The failure was reproduced remotely with
`//project/oai_sandbox:pytest -k test_get_minijail_concurrent_calls_only_one_download`
using Bazel `9.3.0-actiond-dzbarsky14`.
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.
Python multiprocessing fails inside an action sandbox while creating a POSIX
named semaphore:
Create
/dev/shmalongside each action's existing base directories and mount aprivate 64 MiB tmpfs after entering its mount namespace. Keep the mount
nosuid,nodev,noexec, give it the standard sticky world-writable mode, andperform the mount before dropping sandbox privileges. Extend the existing base
directory test to cover the new mount point.
The failure was reproduced remotely with
//project/oai_sandbox:pytest -k test_get_minijail_concurrent_calls_only_one_downloadusing Bazel
9.3.0-actiond-dzbarsky14.After rebuilding the guest and preserving the existing CAS-maintenance wrapper, the same test passes remotely with 300 submitted process-pool calls (one real remote test execution; invocation
a36afe32-8b71-4ccf-ab6c-47f357cb77d8).