Skip to content

Commit 7fee4d1

Browse files
joelebacopybara-github
authored andcommitted
[Skymeld] Make the shutting down of various executors interruptible.
... since there's no reason for them to be uninterruptible in the first place. PiperOrigin-RevId: 530580587 Change-Id: I9c7848f9d09599583cb7ca33f6397a0e87f9123b
1 parent 4e94f29 commit 7fee4d1

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/main/java/com/google/devtools/build/lib/skyframe/IncrementalArtifactConflictFinder.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,10 @@ private static void constructActionGraphAndArtifactList(
125125
}
126126
}
127127

128-
void shutdown() throws InterruptedException {
129-
if (!executorService.isShutdown() && ExecutorUtil.uninterruptibleShutdown(executorService)) {
130-
throw new InterruptedException();
128+
void shutdown() {
129+
if (!executorService.isShutdown() && ExecutorUtil.interruptibleShutdown(executorService)) {
130+
// Preserve the interrupt status.
131+
Thread.currentThread().interrupt();
131132
}
132133
}
133134

src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,7 +2492,7 @@ public void resetBuildDriverFunction() {
24922492
}
24932493

24942494
/** Resets the incremental artifact conflict finder to ensure incremental correctness. */
2495-
public void resetIncrementalArtifactConflictFindingStates() throws InterruptedException {
2495+
public void resetIncrementalArtifactConflictFindingStates() {
24962496
incrementalArtifactConflictFinder.shutdown();
24972497
incrementalTransitiveActionLookupKeysCollector.shutdown();
24982498
incrementalArtifactConflictFinder =
@@ -3856,9 +3856,10 @@ private boolean tryClaimVisitation(
38563856
&& collected.putIfAbsent(key, ClaimedLookupValueSentinel.INSTANCE) == null;
38573857
}
38583858

3859-
private void shutdown() throws InterruptedException {
3860-
if (!executorService.isShutdown() && ExecutorUtil.uninterruptibleShutdown(executorService)) {
3861-
throw new InterruptedException();
3859+
private void shutdown() {
3860+
if (!executorService.isShutdown() && ExecutorUtil.interruptibleShutdown(executorService)) {
3861+
// Preserve the interrupt status.
3862+
Thread.currentThread().interrupt();
38623863
}
38633864
}
38643865

0 commit comments

Comments
 (0)