diff --git a/pulsar-common/src/main/java/org/apache/pulsar/common/util/RateLimiter.java b/pulsar-common/src/main/java/org/apache/pulsar/common/util/RateLimiter.java index 8f02bcc0e5cf3..33003af20a0de 100644 --- a/pulsar-common/src/main/java/org/apache/pulsar/common/util/RateLimiter.java +++ b/pulsar-common/src/main/java/org/apache/pulsar/common/util/RateLimiter.java @@ -21,6 +21,7 @@ import static com.google.common.base.Preconditions.checkArgument; import static org.apache.pulsar.common.util.Runnables.catchingAndLoggingThrowables; import com.google.common.base.MoreObjects; +import io.netty.util.concurrent.DefaultThreadFactory; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledThreadPoolExecutor; @@ -80,7 +81,8 @@ public class RateLimiter implements AutoCloseable{ this.executorService = scheduledExecutorService; this.externalExecutor = true; } else { - final ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1); + final ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1, + new DefaultThreadFactory("pulsar-rate-limiter")); executor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false); executor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false); this.executorService = executor;