Skip to content

Commit

Permalink
SLLS-70 Close the message processor at exit time
Browse files Browse the repository at this point in the history
This way we are sure that communication remains possible until the end
  • Loading branch information
damien-urruty-sonarsource committed Apr 1, 2022
1 parent c68026d commit 40cf3aa
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ private static TextDocumentSyncOptions getTextDocumentSyncOptions() {
@Override
public CompletableFuture<Object> shutdown() {
List.<Runnable>of(
// start by not processing any more messages from the client
() -> Utils.shutdownAndAwait(threadPool, true),
// prevent creation of new engines
enginesFactory::shutdown,
analysisScheduler::shutdown,
Expand Down Expand Up @@ -301,6 +299,7 @@ private void invokeQuietly(Runnable call) {

@Override
public void exit() {
invokeQuietly(() -> Utils.shutdownAndAwait(threadPool, true));
// The Socket will be closed by the client, and so remaining threads will die and the JVM will terminate
}

Expand Down

0 comments on commit 40cf3aa

Please sign in to comment.