Skip to content

Commit d6c35df

Browse files
authored
Ignore single domain failures in remove contacts from all domains action (#2836)
When running the action in sandbox on 1.5M domains, it failed a few times updating individual domains (requiring a manual restart of the entire action). It's better to just log the individual failures for manual inspection and then otherwise continue running the action to process the vast majority of other updates that won't fail. BUG = http://b/439636188
1 parent 7caa0ec commit d6c35df

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

core/src/main/java/google/registry/batch/RemoveAllDomainContactsAction.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,18 @@ private void runLocked() {
159159
private void runDomainUpdateFlow(String repoId) {
160160
// Create a new transaction that the flow's execution will be enlisted in that loads the domain
161161
// transactionally. This way we can ensure that nothing else has modified the domain in question
162-
// in the intervening period since the query above found it.
163-
boolean success = tm().transact(() -> runDomainUpdateFlowInner(repoId));
164-
if (success) {
165-
successes++;
166-
} else {
167-
failures++;
162+
// in the intervening period since the query above found it. If a single domain update fails
163+
// permanently, log it and move on to not block processing all the other domains.
164+
try {
165+
boolean success = tm().transact(() -> runDomainUpdateFlowInner(repoId));
166+
if (success) {
167+
successes++;
168+
} else {
169+
failures++;
170+
}
171+
} catch (Throwable t) {
172+
logger.atWarning().withCause(t).log(
173+
"Failed updating domain with repoId %s; skipping.", repoId);
168174
}
169175
}
170176

0 commit comments

Comments
 (0)