From ab632b4946d1a95e72f67c2c23c6d7f1293b8d9b Mon Sep 17 00:00:00 2001 From: wilwell Date: Mon, 22 Nov 2021 06:21:38 -0800 Subject: [PATCH] Add retry time for LocalSpawnRunner retries. PiperOrigin-RevId: 411543169 --- .../google/devtools/build/lib/exec/local/LocalSpawnRunner.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java b/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java index 2dc57b1a1cb612..7decb9357a6934 100644 --- a/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java +++ b/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java @@ -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())) { @@ -234,6 +235,7 @@ public SpawnResult run() result.exitCode(), attempts); Thread.sleep(attempts * 1000); + spawnMetrics.addRetryTime(result.exitCode(), rertyStopwatch.elapsed()); attempts++; } }