Running several instances of snapcraft in parallel for a given snap name results in failures to acquire an apt lock file

Bug #1869030 reported by Olivier Tilloy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Confirmed
Undecided
Chris Patterson

Bug Description

Use case: I'm working on upstreaming the snap packaging of chromium, and the chromium CI jobs try to build 3 snaps in parallel (for stable, beta and unstable). Those are initiated from three separate directories but different instances of snapcraft compete for the same apt lock file, because the three snaps have the same name, and thus use the same shared multipass VM.

This is the error:

Sorry, an error occurred in Snapcraft:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apt/cache.py", line 67, in __enter__
return self._lock.__enter__()
SystemError: E:Could not get lock /home/chrome-bot/.cache/snapcraft/stage-packages/apt/0a910a73dbfd95c039f21b0fb2811cf7f339c9ad5da3b03eb5ba0c07fdc735c7cf8239eae76c933d6abf4a5b5847feff/var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)

Should snapcraft allow specifying a unique VM/container name, to avoid clashes?

Chris Patterson (cjp256)
Changed in snapcraft:
status: New → Confirmed
assignee: nobody → Chris Patterson (cjp256)
Revision history for this message
Chris Patterson (cjp256) wrote :

We will likely take the current project path into account like remote-build does, so a project can be built simultaneously when using multiple copies (with different paths).

It may also be useful to add a `--transient` option for snapping that spins up a VM/container for the run and immediately dispose of it upon completion.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.