Bug #18920
closedPossible race condition when sync multiple puppet repos at the same time
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1421594
Description of problem:
Puppet repo sync has the following steps:
1) Unassociate all puppet modules from the repo
2) Sync the Repo
3) Remove all Orphans
Lets say we are syncing 'Repo 1' and 'Repo 2' at the same time. 'Module A' is only associated to 'Repo 1'
Unassociate 'Module A' from 'Repo 1' will make it an orphan, so the 'Repo 1' sync task will assume 'Module A' is still in Pulp and will not try to re-download it again. At the same time, 'Repo 2' sync task reaches the 'Remove all orphans step' and remove 'Module A' from Pulp. This will cause the 'Repo 1' sync to fail with the following error:
IOError: [Errno 2] No such file or directory: u'/var/lib/pulp/content/units/puppet_module/1f/37902b7b8dd30cd2f0a2a99914f703c1b1459bc905504b8c23225cee4b728b/mweetman-hosts-0.1.0.tar.gz'
How reproducible:
This issue is hard to reproduce, because this issue will only be triggered in a very specific timing.