← Back to issue list

Snapcraft concurrent build

View original Launchpad issue

Metadata

Project
snapcraft
Number
#1889741
Type
issue
State
open
Author
~lawrencegripper
Labels
Created
2020-07-31 08:37:25.951483+00:00
Updated
2024-06-28 09:38:58.692212+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

When running multiple instances of snapcraft concurrently there is a race condition in the `$HOME/.cache/snapcraft/download` and `stage-packages` creation. Kicking off multiple instances of snapcraft where snapcraft hasn't already been run (like a CI system) causes a concurrency bug in the snapcraft python where two instances enter the check for the folders existing, both see the folder doesn't exist, then the first instance creates it and the second instance fails attempting to create it as it's already been done. Unlucky right? I wanted proof - the way I proved it was to test with a single instance starting for snapcraft and it fixed it. Also pre-creating the folders with `mkdir -p` before launching snapcraft also resolves the issue. For more details on the bug: https://github.com/goreleaser/goreleaser/issues/1715 I'm using snapcraft in docker following this guide here: https://snapcraft.io/docs/build-on-docker

Evaluation history

No evaluation history available.