Prior to #4413, get_next_build allowed recycling. That PR added the strict flag to new_build() to protect against races. Unfortunately this leads to #4490.
Here we drop the strict arg (hence allowing recycling), but add locking to to recycle_build to prevent two calls from recycling the same build in a race.
Fixes https://pagure.io/koji/issue/4490
Prior to #4413, get_next_build allowed recycling. That PR added the strict flag to new_build() to protect against races. Unfortunately this leads to #4490.
Here we drop the strict arg (hence allowing recycling), but add locking to to recycle_build to prevent two calls from recycling the same build in a race.