I met the problem that many async-thread-macro
thread will be created and stay in parking.
This is the stacktrace of the parking thread:
"async-thread-macro-149" #535 daemon prio=5 os_prio=0 tid=0x00007f5468032800 nid=0x3e89 waiting on condition [0x00007f541e4e3000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000006cfae0d30> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:997)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1304)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231)
at clojure.core$promise$reify__8486.deref(core.clj:7109)
at clojure.core$deref.invokeStatic(core.clj:2320)
at clojure.core$deref.invoke(core.clj:2306)
at clojure.core.async$_LT__BANG__BANG_.invokeStatic(async.clj:115)
at clojure.core.async$_LT__BANG__BANG_.invoke(async.clj:107)
at clojure.core.async$pipeline_STAR_$fn__11939.invoke(async.clj:506)
at clojure.core.async$thread_call$fn__11850.invoke(async.clj:442)
at clojure.lang.AFn.run(AFn.java:22)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
the stacktrace can't give me detail where the problem happens.
how can I investigate further?It's likely caused by I didn't close the channel while another process consuming this channel. I found the problem process one by one testing.
doesn't that just mean that the thread didn't exit yet?
it looks like (thread (<!! ...)) and it's just waiting for that <!!
LT_BANG__BANG is <!!
yes
you have a pipeline-blocking somewhere and didn't close the input to it
maybe not a pipeline-blocking
actually, you know, I bet you put a <!!
blocking op in a pipeline or a pipeline-async
no, line 506 is pipeline-blocking, so you have a pipeline-blocking that is up and waiting for work