Skip to content

Commit

Permalink
Improve the debug logging when dynamic execution is forced to run onl…
Browse files Browse the repository at this point in the history
…y remotely.

RELNOTE: None
PiperOrigin-RevId: 700331056
Change-Id: I249f03814cbc25248fefd7620d1e86aacefb7a20
  • Loading branch information
bigelephant29 authored and copybara-github committed Nov 26, 2024
1 parent 595e42f commit 8928880
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,24 @@ ImmutableList<SpawnResult> maybeExecuteNonDynamically(
getSpawnReadableId(spawn));
throw new UserExecException(failure);
} else if (!localCanExec && remoteCanExec) {
String spawnExplanation =
String.format(
"Local execution policy of the spawn %s dynamic execution, local strategies of the"
+ " spawn are %s",
executionPolicy.canRunLocally() ? "allows" : "forbids",
dynamicStrategyRegistry.getDynamicSpawnActionContexts(spawn, DynamicMode.LOCAL));
String postProcessingSpawnExplanation =
postProcessingSpawn == null
? "the post-processing spawn doesn't exist"
: String.format(
"local execution policy of the post-processing spawn %s dynamic execution, local"
+ " strategies of the post-processing spawn are %s",
postProcessingSpawnExecutionPolicy.canRunLocally() ? "allows" : "forbids",
dynamicStrategyRegistry.getDynamicSpawnActionContexts(
postProcessingSpawn, DynamicMode.LOCAL));
debugLog(
"Dynamic execution of %s can only be done remotely: Local execution policy %s it, "
+ "local strategies are %s.%n",
getSpawnReadableId(spawn),
executionPolicy.canRunLocally() ? "allows" : "forbids",
dynamicStrategyRegistry.getDynamicSpawnActionContexts(spawn, DynamicMode.LOCAL));
"Dynamic execution of %s can only be done remotely: %s. And %s.%n",
getSpawnReadableId(spawn), spawnExplanation, postProcessingSpawnExplanation);
return RemoteBranch.runRemotely(spawn, actionExecutionContext, null, delayLocalExecution);
} else if (localCanExec && !remoteCanExec) {
debugLog(
Expand Down

0 comments on commit 8928880

Please sign in to comment.