1
0
mirror of https://github.com/google/nomulus synced 2025-12-23 06:15:42 +00:00

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
This commit is contained in:
Ben McIlwain
2025-10-02 14:58:23 -04:00
committed by GitHub
parent 7caa0ec9d6
commit d6c35df9bc

View File

@@ -159,12 +159,18 @@ public class RemoveAllDomainContactsAction implements Runnable {
private void runDomainUpdateFlow(String repoId) {
// Create a new transaction that the flow's execution will be enlisted in that loads the domain
// transactionally. This way we can ensure that nothing else has modified the domain in question
// in the intervening period since the query above found it.
boolean success = tm().transact(() -> runDomainUpdateFlowInner(repoId));
if (success) {
successes++;
} else {
failures++;
// in the intervening period since the query above found it. If a single domain update fails
// permanently, log it and move on to not block processing all the other domains.
try {
boolean success = tm().transact(() -> runDomainUpdateFlowInner(repoId));
if (success) {
successes++;
} else {
failures++;
}
} catch (Throwable t) {
logger.atWarning().withCause(t).log(
"Failed updating domain with repoId %s; skipping.", repoId);
}
}