#2263 improve race condition for getNextRelease / images
Merged by tkopecek. Opened by tkopecek.
tkopecek/koji issue2138  into  master

Download 2263.patch

Fixes: https://pagure.io/koji/issue/2138

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

:thumbsup:

Metadata Update from @tkopecek:
- Pull-request untagged with: testing-ready
- Pull-request tagged with: no_qe

I'm a little worried about the scratch case here. If the release is not specified, we're going to pass None through to the subtasks. I don't think it will cause a failure, but it's going to be visible and possibly confusing.

Three possibilities come to mind to set a release value for scratch builds:

  1. use a fixed release value. e.g. 1.scratch, since these are just scratch builds
  2. incorporate a timestamp. e.g. "%i-scratch" % time.time()
  3. just use getNextRelease() as before for the scratch case. The race is not an issue for scratch builds
  4. same as previous, but append .scratch for emphasis

Option 1 is the easiest, but I'd be a little worried that even though Koji won't mind these scratch builds having the same names, some other external process could be confused.

Option 2 seems safe, but is different than what we were doing before. The scratch nvrs would appear out of order compared to normal image builds.

Option 3 is probably the safest, as it preserves the behavior we had for scratch builds before.

Option 4 seems like a nice variation on the above, but is a behavior change.

On the whole, I would lean towards option 3.

I would also stay with 3 for now.

Commit fc4cb3d3 fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata