lhotari commented on code in PR #21496:
URL: https://github.com/apache/pulsar/pull/21496#discussion_r1379004388


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:
##########
@@ -639,20 +639,23 @@ private synchronized void resetMetricsServlet() {
     }
 
     private CompletableFuture<Void> addTimeoutHandling(CompletableFuture<Void> 
future) {
-        ScheduledExecutorService shutdownExecutor = 
Executors.newSingleThreadScheduledExecutor(
-                new 
ExecutorProvider.ExtendedThreadFactory(getClass().getSimpleName() + 
"-shutdown"));
-        FutureUtil.addTimeoutHandling(future,
-                Duration.ofMillis(Math.max(1L, 
getConfiguration().getBrokerShutdownTimeoutMs())),
-                shutdownExecutor, () -> 
FutureUtil.createTimeoutException("Timeout in close", getClass(), "close"));
-        future.handle((v, t) -> {
-            if (t != null && getConfiguration().getBrokerShutdownTimeoutMs() > 
0) {
-                LOG.info("Shutdown timed out after {} ms", 
getConfiguration().getBrokerShutdownTimeoutMs());
-                LOG.info(ThreadDumpUtil.buildThreadDiagnosticString());
-            }
-            // shutdown the shutdown executor
-            shutdownExecutor.shutdownNow();
-            return null;
-        });
+        long brokerShutdownTimeoutMs = 
getConfiguration().getBrokerShutdownTimeoutMs();

Review Comment:
   Thanks. Updated. PTAL



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to