在NES上有多个“发现工作者”和“保持活动”线程处于等待状态的预期行为吗?
"DiscoveryWorker-10"
Id=62 WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@3c7f9371
at sun.misc.Unsafe.park(Native Method)
- waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@3c7f9371
at java.util.concurrent.locks.LockSupport.park(Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
"KeepAliveWorker-4"
Id=61 WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@5ba8febe
at sun.misc.Unsafe.park(Native Method)
- waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@5ba8febe
at java.util.concurrent.locks.LockSupport.park(Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
答案 0 :(得分:1)
是的,这是预料之中的。看起来这些线程正在线程池中等待,直到发现或保持活动任务需要它们。
在NiMi或Netty代码中等待很长时间的线程(应该在堆栈跟踪中可见),可能意味着存在某种通信问题。 (例如,NimiConnectionImpl是DiscoveryWorker线程在写入Netty通道时等待的类之一)