Skip to content

Commit

Permalink
Clean up dead code in Server (#4514)
Browse files Browse the repository at this point in the history
Motivation:

Clean up dead code that was introduced by aa647fa and removed by 84dd0cf

Modifications:

- Remove dead code `Server#shutdownExecutor`

Result:

- No impact
  • Loading branch information
jrhee17 authored Nov 7, 2022
1 parent 4a52826 commit ded665c
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions core/src/main/java/com/linecorp/armeria/server/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -728,38 +728,6 @@ protected void closeFailed(Throwable cause) {
private void logStopFailure(Throwable cause) {
logger.warn("Failed to stop a server: {}", cause.getMessage(), cause);
}

private void shutdownExecutor(Iterable<ScheduledExecutorService> executors) {
for (ScheduledExecutorService executor : executors) {
if (executor instanceof UnstoppableScheduledExecutorService) {
executor = ((UnstoppableScheduledExecutorService) executor).getExecutorService();
}

executor.shutdown();
}

boolean interrupted = false;
for (ScheduledExecutorService executor : executors) {
if (executor instanceof UnstoppableScheduledExecutorService) {
executor = ((UnstoppableScheduledExecutorService) executor).getExecutorService();
}

try {
while (!executor.isTerminated()) {
try {
executor.awaitTermination(1, TimeUnit.DAYS);
} catch (InterruptedException ignore) {
interrupted = true;
}
}
} catch (Exception e) {
logger.warn("Failed to shutdown the blockingTaskExecutor: {}", executor, e);
}
}
if (interrupted) {
Thread.currentThread().interrupt();
}
}
}

/**
Expand Down

0 comments on commit ded665c

Please sign in to comment.