Skip to content

Commit

Permalink
[Skymeld] Make the shutting down of various executors interruptible.
Browse files Browse the repository at this point in the history
... since there's no reason for them to be uninterruptible in the first place.

PiperOrigin-RevId: 530580587
Change-Id: I9c7848f9d09599583cb7ca33f6397a0e87f9123b
  • Loading branch information
joeleba authored and copybara-github committed May 9, 2023
1 parent 4e94f29 commit 7fee4d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ private static void constructActionGraphAndArtifactList(
}
}

void shutdown() throws InterruptedException {
if (!executorService.isShutdown() && ExecutorUtil.uninterruptibleShutdown(executorService)) {
throw new InterruptedException();
void shutdown() {
if (!executorService.isShutdown() && ExecutorUtil.interruptibleShutdown(executorService)) {
// Preserve the interrupt status.
Thread.currentThread().interrupt();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2492,7 +2492,7 @@ public void resetBuildDriverFunction() {
}

/** Resets the incremental artifact conflict finder to ensure incremental correctness. */
public void resetIncrementalArtifactConflictFindingStates() throws InterruptedException {
public void resetIncrementalArtifactConflictFindingStates() {
incrementalArtifactConflictFinder.shutdown();
incrementalTransitiveActionLookupKeysCollector.shutdown();
incrementalArtifactConflictFinder =
Expand Down Expand Up @@ -3856,9 +3856,10 @@ private boolean tryClaimVisitation(
&& collected.putIfAbsent(key, ClaimedLookupValueSentinel.INSTANCE) == null;
}

private void shutdown() throws InterruptedException {
if (!executorService.isShutdown() && ExecutorUtil.uninterruptibleShutdown(executorService)) {
throw new InterruptedException();
private void shutdown() {
if (!executorService.isShutdown() && ExecutorUtil.interruptibleShutdown(executorService)) {
// Preserve the interrupt status.
Thread.currentThread().interrupt();
}
}

Expand Down

0 comments on commit 7fee4d1

Please sign in to comment.