merlimat commented on code in PR #3585:
URL: https://github.com/apache/bookkeeper/pull/3585#discussion_r1009865143
##########
bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/SingleThreadExecutor.java:
##########
@@ -225,6 +246,26 @@ public void execute(Runnable r) {
}
}
+ private void monitorTimeoutTasks() {
+ for (Runnable task : queue) {
Review Comment:
The `queue` is meant to be used by a single consumer, so we cannot iterate
over it from a different thread.
##########
bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/SingleThreadExecutor.java:
##########
@@ -80,11 +92,14 @@ public SingleThreadExecutor(ThreadFactory tf, int
maxQueueCapacity, boolean reje
} else {
this.queue = new GrowableMpScArrayConsumerBlockingQueue<>();
}
+ this.executor = Executors.newSingleThreadScheduledExecutor(new
DefaultThreadFactory(EXECUTOR_NAME));
Review Comment:
This would be doubling the number of threads
--
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]