Snapcraft concurrent build
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Confirmed
|
Undecided
|
Chris Patterson |
Bug Description
When running multiple instances of snapcraft concurrently there is a race condition in the `$HOME/
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:/
I'm using snapcraft in docker following this guide here: https:/
I looked at making a contribution to resolve the issue but the code responsible appears to be in the XDG package not in the snapcraft code on github. One option to resolve would be to update the docs for docker image to include the creation of those folders or use a different method to ensure they're creation, capturing a `FileExists` error and suppressing it.