Skip to content

Commit

Permalink
Add retry time for LocalSpawnRunner retries.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 411543169
  • Loading branch information
wilwell authored and copybara-github committed Nov 22, 2021
1 parent a6d13b0 commit ab632b4
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ public SpawnResult run()
// subprocess, so let them bubble up on first occurrence. In particular, we need this to
// be true for InterruptedException to ensure that the dynamic scheduler can stop us
// quickly.
Stopwatch rertyStopwatch = Stopwatch.createStarted();
SpawnResult result = runOnce();
if (attempts == localExecutionOptions.localRetriesOnCrash
|| !TerminationStatus.crashed(result.exitCode())) {
Expand All @@ -234,6 +235,7 @@ public SpawnResult run()
result.exitCode(),
attempts);
Thread.sleep(attempts * 1000);
spawnMetrics.addRetryTime(result.exitCode(), rertyStopwatch.elapsed());
attempts++;
}
}
Expand Down

0 comments on commit ab632b4

Please sign in to comment.