The code from #3103 attempts to handle race conditions, but fails to recover because the transaction itself has failed. Rolling back to a savepoint allows us to keep going.
Fixes https://pagure.io/koji/issue/4414
~~I am so far unable to make this race happen locally. It was observed on a live system.~~
1 new commit added
fix a separate race case
Replicating a race with fakehub. Salt to taste
# set up two fake tasks and have a builder user open then $ ./devtools/fakehub -u mikem makeTask sleep '[120]' $ ./devtools/fakehub -u mikem makeTask sleep '[120]' $ ./devtools/fakehub -u builder-02 -x host.openTask 14475 $ ./devtools/fakehub -u builder-02 -x host.openTask 14476 # (the following in parallel should hit the race) $ while ./devtools/fakehub -u builder-02 -x host.initImageBuild 14475 "{'name':'foo', 'version':'100', 'epoch':None}"; do echo; done $ while ./devtools/fakehub -u builder-02 -x host.initImageBuild 14476 "{'name':'foo', 'version':'100', 'epoch':None}"; do echo; done
@julian8628
:thumbsup:
Metadata Update from @mikem: - Pull-request tagged with: testing-custom
Metadata Update from @mikem: - Pull-request tagged with: bug
Metadata Update from @mikem: - Pull-request untagged with: bug
Metadata Update from @mfilip: - Pull-request tagged with: testing-done
rebased onto 134ec54d56a1e74c3f8cf9a6322d76355e08650c
Commit adbe584a fixes this pull-request
Pull-Request has been merged by mikem
The code from #3103 attempts to handle race conditions, but fails to recover because the transaction itself has failed. Rolling back to a savepoint allows us to keep going.
Fixes https://pagure.io/koji/issue/4414