← Back to issue list

Snapcraft concurrent build

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1889741
Type
issue
State
open
Author
~lawrencegripper
Labels
—
Created
Updated
Closed
—

Current evaluation

Concurrent first-time builds can race during pyxdg cache-path creation; the flaw was still reported on Snapcraft 8.2.12 despite a 2022 upstream fix attempt.

Suggested action: keep open

Reason: Maintainer ~cjp256 acknowledged the race, ~twpayne linked pyxdg merge request !14 as an upstream fix, and a 2024 commenter reproduced it on Snapcraft 8.2.12. Current code still obtains the shared cache through BaseDirectory.save_cache_path and locks pyxdg 0.28, so this remains a valid unresolved CI concurrency failure.

Evaluated by: mr-cal-bot

Impact: 56 Quick Win: 23 Complexity: 52 Confidence: 91 Actionability: 84

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

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 56
Quick Win: 23
Complexity: 52
Confidence: 91
Actionability: 84
keep open Concurrent first-time builds can race during pyxdg cache-path creation; the flaw was still reported on Snapcraft 8.2.12 despite a 2022 upstream fix attempt.
stealth/space-bunny-alpha
Impact: 58
Quick Win: 22
Complexity: 52
Confidence: 89
Actionability: 78
keep open Concurrent cold-cache Snapcraft builds race while creating cache directories. An upstream pyxdg fix was attempted, but the failure was still reported on Snapcraft 8.2.12.
stealth/space-bunny-alpha
Impact: 52
Quick Win: 24
Complexity: 38
Confidence: 77
Actionability: 74
needs triage Concurrent Snapcraft builds reportedly race when first creating the download and stage-packages cache directories; pre-creating them avoids the failure. The report has no maintainer triage or reproducer.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 24
Staleness: 85
Complexity: 40
Confidence: 55
Support Request: 10
needs triage Race condition when running multiple snapcraft instances concurrently: both check for $HOME/.cache/snapcraft/download and stage-packages, both see missing, one creates, other fails. Reported ~6 years ago, 0 comments, no maintainer response, no labels.
qwen/qwen3.6-35b-a3b
Staleness: 90
Complexity: 40
Confidence: 85
Support Request: 10
close stale Race condition in snapcraft when running concurrent builds, causing cache folder creation failures. The report remains unlabelled and inactive for over six years with no maintainer engagement.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 40
Confidence: 90
Support Request: 10
needs triage Reports a race condition when running multiple snapcraft instances concurrently, causing folder creation failures. Unlabeled, no maintainer comments, inactive for over two years.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 10
Confidence: 80
Support Request: 5
close stale Reports a race condition when running multiple snapcraft instances concurrently, causing folder creation failures. The issue is over 6 years old with no maintainer engagement or comments.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 30
Confidence: 85
Support Request: 10
close stale Concurrent snapcraft builds trigger a race condition during directory creation, causing failures. The report lacks maintainer labels or comments and has been inactive for over two years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 30
Confidence: 75
Support Request: 10
needs triage Reports a race condition when running multiple snapcraft instances concurrently, causing folder creation failures. Unlabeled, no maintainer response, and inactive for over two years.

Update history

Date Change
created

Related work

  • Related To: goreleaser#1715 (confidence 96%)

    The issue links this report for concrete downstream context and reproduction of the concurrent-build failure.

  • Likely Fixed By: pyxdg#14 (confidence 94%)

    A maintainer explicitly linked this pyxdg merge request as the upstream race fix; the supplied evidence does not show that it was merged or released.

Related issues

No related issues found above the similarity threshold.