containers / containers/bubblewrap

--lock-file doesn't wait for the lock, is this intentional?

Open
#226 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
8.7k
Forks
386
Avg merge
3d 17h
Merged PRs (30d)
11

Description

I intermittently see `test-run.sh` fail with:

```
Unable to lock file /var/tmp/tap-test.nlbsH3/lock: Resource temporarily unavailable
```

I believe this is a race condition between the `lockf-n.py` and `bwrap` children of `test-run.sh`. If the backgrounded shell process `$childshellpid` is unlucky, its `bwrap` child will try to take the lock while one of the `lockf-n.py` processes is holding it. `bwrap` doesn't wait for the lock (`F_SETLKW`), just does a fire-and-forget attempt to take it (`F_SETLK`), so this fails.

For the test, this can be fixed by running `bwrap` in a retry loop. However, the more I think about this, the more I wonder: is this really intentional? Should `bwrap` be using `F_SETLKW` for its `--lock-file`?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.