Skip to content

Commit

Permalink
Revert "Check the result of Future.cancel() when cancelling the other…
Browse files Browse the repository at this point in the history
… branch of dynamic execution."

This reverts commit 5b95d91.
  • Loading branch information
larsrc-google committed Jul 30, 2021
1 parent a3a1310 commit e6809c9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
Expand Up @@ -34,10 +34,6 @@ enum DynamicMode {
public String toString() {
return name;
}

public DynamicMode other() {
return this == REMOTE ? LOCAL : REMOTE;
}
}

/**
Expand Down
Expand Up @@ -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(
Expand Down

0 comments on commit e6809c9

Please sign in to comment.