Reduce RebaseChange max tries from 6 to 2

On failure, gerrit_util always retries HTTP requests the maximum
number of times. This doesn't always make sense, e.g. for RebaseChange
which gets 409 on a merge conflict and can't be retried into
succeeding.

Bug: b/341792235
Change-Id: I6f9e212c5b0365236a99768f056bab2eb60cddc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5773566
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
This commit is contained in:
Gavin Mak
2024-08-09 16:11:44 +00:00
committed by LUCI CQ
parent 5f6542c176
commit d4c6d40d50
3 changed files with 35 additions and 17 deletions

View File

@@ -4579,10 +4579,6 @@ def CMDcherry_pick(parser, args):
if parent_change_num:
try:
# TODO(b/341792235): gerrit_util will always retry failed Gerrit
# requests 5 times. This doesn't make sense if a rebase fails
# due to a merge conflict since the result won't change. Make
# RebaseChange retry at most once.
gerrit_util.RebaseChange(host, new_change_id, parent_change_num)
except gerrit_util.GerritError as e:
parent_change_url = gerrit_util.GetChangePageUrl(