From e6809c90ecc0ef5783faa39e63188fc33a79b80e Mon Sep 17 00:00:00 2001 From: Lars Clausen Date: Fri, 30 Jul 2021 15:04:32 +0200 Subject: [PATCH] Revert "Check the result of Future.cancel() when cancelling the other branch of dynamic execution." This reverts commit 5b95d9162b56b51c8e8f66258981ddf3c5d96765. --- .../build/lib/actions/DynamicStrategyRegistry.java | 4 ---- .../build/lib/dynamic/DynamicSpawnStrategy.java | 12 +----------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/actions/DynamicStrategyRegistry.java b/src/main/java/com/google/devtools/build/lib/actions/DynamicStrategyRegistry.java index 3c9c633a1c3c58..18e063c2f4e601 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/DynamicStrategyRegistry.java +++ b/src/main/java/com/google/devtools/build/lib/actions/DynamicStrategyRegistry.java @@ -34,10 +34,6 @@ enum DynamicMode { public String toString() { return name; } - - public DynamicMode other() { - return this == REMOTE ? LOCAL : REMOTE; - } } /** diff --git a/src/main/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategy.java b/src/main/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategy.java index 5e05f4b6ad1804..78ce0e876be25f 100644 --- a/src/main/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategy.java +++ b/src/main/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategy.java @@ -166,17 +166,7 @@ private static void stopBranch( spawn.getMnemonic(), strategyThatCancelled.get()))); } - if (!branchToCancel.cancel(true)) { - // This can happen if the other branch is local under local_lockfree and has returned - // its result but not yet cancelled this branch, or if the other branch was already - // cancelled for other reasons. - if (!branchToCancel.isCancelled()) { - throw new DynamicInterruptedException( - String.format( - "Execution of %s strategy stopped because %s strategy could not be cancelled", - cancellingStrategy, cancellingStrategy.other())); - } - } + branchToCancel.cancel(true); branchDone.acquire(); } else { throw new DynamicInterruptedException(