diff --git a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java index c436f129789764..bba970045acac8 100644 --- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java +++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java @@ -892,9 +892,9 @@ private void shutdownExecutors() throws PulsarClientException { } } } - if (createdScheduledProviders && scheduledExecutorProvider != null && !scheduledExecutorProvider.isShutdown()) { + if (createdScheduledProviders && !scheduledExecutorProvider.isShutdown()) { try { - externalExecutorProvider.shutdownNow(); + scheduledExecutorProvider.shutdownNow(); } catch (Throwable t) { log.warn("Failed to shutdown scheduledExecutorProvider", t); pulsarClientException = PulsarClientException.unwrap(t);