fix a separate race case
In a very close race, one side can first see the duplicate nvr during the get_build check in new_build, which leads to an attempt to recycle, which fails because the duplicate is in the BUILDING state.
This commit is contained in:
parent
bf27153e1e
commit
ecfa7766b5
1 changed files with 3 additions and 2 deletions
|
|
@ -4861,8 +4861,9 @@ def get_next_build(build_info):
|
|||
for try_no in range(2, 10):
|
||||
savepoint = Savepoint('get_next_build_pre_insert')
|
||||
try:
|
||||
return new_build(build_info)
|
||||
except IntegrityError:
|
||||
# using strict so we don't try to recycle
|
||||
return new_build(build_info, strict=True)
|
||||
except (IntegrityError, koji.GenericError):
|
||||
savepoint.rollback()
|
||||
build_info['release'] = get_next_release(build_info, try_no)
|
||||
# otherwise
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue