Remove redundant specification of LockFailureExceptions for retrying
ExceptionHookImpl#shouldRetry(Throwable) controls globally that all
actions should be retried on LockFailureExceptions. Specifying retrying
on LockFailureExceptions also on individual calls with RetryHelper is
redundant and can be removed.
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I3ac1c52c18e2f00e78d0726696c3b0c7f6b49c4b
diff --git a/java/com/google/gerrit/plugins/checks/db/NoteDbCheckersUpdate.java b/java/com/google/gerrit/plugins/checks/db/NoteDbCheckersUpdate.java
index 19ae2a5..72b01c2 100644
--- a/java/com/google/gerrit/plugins/checks/db/NoteDbCheckersUpdate.java
+++ b/java/com/google/gerrit/plugins/checks/db/NoteDbCheckersUpdate.java
@@ -17,7 +17,6 @@
import com.google.common.base.Throwables;
import com.google.gerrit.entities.Project;
import com.google.gerrit.exceptions.DuplicateKeyException;
-import com.google.gerrit.git.LockFailureException;
import com.google.gerrit.git.RefUpdateUtil;
import com.google.gerrit.plugins.checks.Checker;
import com.google.gerrit.plugins.checks.CheckerCreation;
@@ -139,7 +138,6 @@
return retryHelper
.pluginUpdate(
"createChecker", () -> createCheckerInNoteDb(checkerCreation, checkerUpdate))
- .retryOn(LockFailureException.class::isInstance)
.call();
} catch (Exception e) {
Throwables.throwIfUnchecked(e);
@@ -233,7 +231,6 @@
try {
return retryHelper
.pluginUpdate("updateChecker", () -> updateCheckerInNoteDb(checkerUuid, checkerUpdate))
- .retryOn(LockFailureException.class::isInstance)
.call();
} catch (Exception e) {
Throwables.throwIfUnchecked(e);
diff --git a/java/com/google/gerrit/plugins/checks/db/NoteDbChecksUpdate.java b/java/com/google/gerrit/plugins/checks/db/NoteDbChecksUpdate.java
index 05ad0dc..e9cb9bb 100644
--- a/java/com/google/gerrit/plugins/checks/db/NoteDbChecksUpdate.java
+++ b/java/com/google/gerrit/plugins/checks/db/NoteDbChecksUpdate.java
@@ -21,7 +21,6 @@
import com.google.common.base.Throwables;
import com.google.common.collect.Maps;
import com.google.gerrit.exceptions.DuplicateKeyException;
-import com.google.gerrit.git.LockFailureException;
import com.google.gerrit.git.RefUpdateUtil;
import com.google.gerrit.plugins.checks.Check;
import com.google.gerrit.plugins.checks.CheckKey;
@@ -144,7 +143,6 @@
return retryHelper
.pluginUpdate(
"createCheck", () -> upsertCheckInNoteDb(checkKey, checkUpdate, Operation.CREATE))
- .retryOn(LockFailureException.class::isInstance)
.call();
} catch (Exception e) {
Throwables.throwIfUnchecked(e);
@@ -160,7 +158,6 @@
return retryHelper
.pluginUpdate(
"updateCheck", () -> upsertCheckInNoteDb(checkKey, checkUpdate, Operation.UPDATE))
- .retryOn(LockFailureException.class::isInstance)
.call();
} catch (Exception e) {
Throwables.throwIfUnchecked(e);