Skip to content

Commit

Permalink
flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoloboschi committed May 20, 2024
1 parent 64e00d8 commit 6ada992
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,7 @@ private CompletableFuture<ResponseEntity> handleServiceWithTopics(
topicConnectionsRuntimeRegistryProvider
.getTopicConnectionsRuntimeRegistry(),
clusterRuntimeRegistry);
completableFuture.thenRunAsync(
() -> {
if (consumeGateway != null) {
consumeGateway.close();
}
},
consumeThreadPool);
completableFuture.thenRunAsync(consumeGateway::close, consumeThreadPool);

final Gateway.ServiceOptions serviceOptions = authContext.gateway().getServiceOptions();
try {
Expand All @@ -297,7 +291,7 @@ record -> {
final AtomicBoolean stop = new AtomicBoolean(false);
consumeGateway.startReadingAsync(
consumeThreadPool,
() -> stop.get(),
stop::get,
record -> {
stop.set(true);
completableFuture.complete(ResponseEntity.ok(record));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public ServletServerContainerFactoryBean createWebSocketContainer() {

@PreDestroy
public void onDestroy() {
consumeThreadPool.shutdown();
log.info("Shutting down WebSocket");
consumeThreadPool.shutdownNow();
clusterRuntimeRegistry.close();
}
}

0 comments on commit 6ada992

Please sign in to comment.