#2138 Race condition for getNextRelease / images
Closed: Fixed 3 years ago by tkopecek. Opened 3 years ago by tkopecek.

/copy from @mikem/

The image task calls getNextRelease at the beginning if no release value is passed in. Once it gets this release value, it uses it in an initImageBuild call. It is only after that init call completes that we have a build entry that would cause getNextRelease to return a higher value. So we have a timeline something like this.

Task A calls getNextRelease, gets 277
Task B calls getNextRelease, also gets 277
Task A calls initImageBuild, call succeeds
Task B calls initImageBuild, call fails

When we added getNextRelease, we weren't anticipating related builds on top of each other like this, so there is no accounting for this race.

Likely what we need to do is move the call to get_next_release into the initImageBuild handler itself, similar to maven builds. However, in this case we'd only trigger that if the given release was None, to avoid changing existing behavior when then release is specified. We'd alter the image build handlers to simply pass the release=None instead of calling getNextRelease themselves.

There would still be a race possibility if two builds made this call at the same time (though the race would be much harder to hit). We'd likely want to address that possibility as well. Likely that would be a try-rollback-retry loop.


Metadata Update from @tkopecek:
- Custom field Size adjusted to None

3 years ago

Metadata Update from @jcupova:
- Issue tagged with: testing-ready

3 years ago

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

3 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #2263 Merged 3 years ago