apache / bookkeeper

Apache BookKeeper - a scalable, fault tolerant and low latency storage service optimized for append-only workloads
https://bookkeeper.apache.org/
Apache License 2.0
1.88k stars 893 forks source link

improve the monitor alibility of OrderedExecutor #3286

Open leizhiyuan opened 2 years ago

leizhiyuan commented 2 years ago

FEATURE REQUEST

  1. Please describe the feature you are requesting.

when we use OrderedExecutor, sometimes the task is slow, especially when we put the same ledgerId to one thread

now the timerRunnable will print

09:24:36.062 [bookkeeper-ml-scheduler-OrderedScheduler-6-0] WARN  org.apache.bookkeeper.common.util.OrderedExecutor - Runnable java.util.concurrent.CompletableFuture$UniAccept@1cb81e6c:class java.util.concurrent.CompletableFuture$UniAccept took too long 2056092 micros to execute.

it is not helpful for solving some problem

maybe we can start a monitor thread, when the time of one task exceeds threshold in the thread pool. we also printStackTrace , it will be very powerful

just like https://github.com/sofastack/sofa-common-tools/blob/master/src/main/java/com/alipay/sofa/common/thread/ThreadPoolMonitorRunner.java#L102

  1. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue?

  2. Provide any additional detail on your proposed use case for this feature.

azhsmesos commented 1 year ago

I feel like I can use AOP to monitor timeout threads, but I need to spend time to understand how OrderedExecutor works, if need to implement development , please assign to me

shoothzj commented 2 months ago

@azhsmesos Sorry for my late reply, assigned