ReceiveCommits: Retry inserting changes and patch sets
If there are concurrent updates, the creation of the new patch sets may fail due to LOCK_FAILURE. In this case we should retry the patch set creation. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: Ib96cbe650a97be3cf29e3065af2f7a11b23166b7
This commit is contained in:
@@ -932,9 +932,17 @@ class ReceiveCommits {
|
||||
updateGroups.forEach(r -> r.addOps(bu));
|
||||
|
||||
logger.atFine().log("Executing batch");
|
||||
|
||||
try {
|
||||
bu.execute();
|
||||
} catch (UpdateException e) {
|
||||
retryHelper
|
||||
.changeUpdate(
|
||||
"insertChangesAndPatchSets",
|
||||
() -> {
|
||||
bu.execute();
|
||||
return null;
|
||||
})
|
||||
.call();
|
||||
} catch (Exception e) {
|
||||
throw asRestApiException(e);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user