Profile Image
Nagaratna H

Why do we see 1 blocked thread?

What is causing one blocked thread in this case? and ther are many Timed_Waiting threads, how do we anlayse on what are they waiting for? How can we optimize the code based on this thread report?

 


Report URL - https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjIvMDkvMTIvdGhyZWFkZHVtcDY1LnR4dC0tOS0yOC00

  • blocked thread

  • Timed Waiting threads

  • pulsar client API

Please Sign In or to post your comment or answer

Profile Image

sainath

Hello Nagaratna,

 

1) Blocked thread:

 

You're using the pulsar client API for the communication. This "pulsar-client-io-12-1" thread is blocked while sending the messages. Please find its stack trace:

 

java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0xca7362a0> (a java.util.concurrent.CompletableFuture$Signaller)
at java.util.concurrent.locks.LockSupport.park(Unknown Source)
at java.util.concurrent.CompletableFuture$Signaller.block(Unknown Source)
at java.util.concurrent.ForkJoinPool.managedBlock(Unknown Source)
at java.util.concurrent.CompletableFuture.waitingGet(Unknown Source)
at java.util.concurrent.CompletableFuture.get(Unknown Source)
at com.intuit.platform.messaging.pulsar.client.OMSClientImpl.createProducerAsyncInternal(OMSClientImpl.java:318)
at com.intuit.platform.messaging.pulsar.client.OMSClientImpl.createProducerAsync(OMSClientImpl.java:518)
at com.intuit.platform.messaging.pulsar.client.OMSTopicProducer.createOrResetProducer(OMSTopicProducer.java:124)
at com.intuit.platform.messaging.pulsar.client.OMSTopicProducer.retrySendAfterReconnect(OMSTopicProducer.java:175)
at com.intuit.platform.messaging.pulsar.client.OMSTopicProducer.handleSendTimeoutException(OMSTopicProducer.java:309)
- locked <0xce652330> (a com.intuit.platform.messaging.pulsar.client.OMSTopicProducer)
at com.intuit.platform.messaging.pulsar.client.OMSTopicProducer.lambda$internalSendAsync$3(OMSTopicProducer.java:338)
at com.intuit.platform.messaging.pulsar.client.OMSTopicProducer$$Lambda$188/3112017.apply(Unknown Source)
at java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)
at java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source)
at java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
at org.apache.pulsar.client.impl.ProducerImpl$1.sendComplete(ProducerImpl.java:349)
at org.apache.pulsar.client.impl.ProducerImpl$OpSendMsg.sendComplete(ProducerImpl.java:1383)
at org.apache.pulsar.client.impl.ProducerImpl.lambda$failPendingMessages$19(ProducerImpl.java:1925)
at org.apache.pulsar.client.impl.ProducerImpl$$Lambda$212/4444655.accept(Unknown Source)
at java.lang.Iterable.forEach(Unknown Source)
at org.apache.pulsar.client.impl.ProducerImpl$OpSendMsgQueue.forEach(ProducerImpl.java:1470)
at org.apache.pulsar.client.impl.ProducerImpl.failPendingMessages(ProducerImpl.java:1915)
at org.apache.pulsar.client.impl.ProducerImpl.lambda$failPendingMessages$20(ProducerImpl.java:1947)
- locked <0xce62f3c0> (a org.apache.pulsar.client.impl.ProducerImpl)
at org.apache.pulsar.client.impl.ProducerImpl$$Lambda$211/4166031.run(Unknown Source)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:

 

2) Timed Waiting:

 

To check what the threads are in the Timed waiting state click on the view details in the section, it will show all the threads and their stack traces of that state:

 

 

 

By following the stack traces of each thread you can able to find the reason why it is waiting for.

 

 

 

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • blocked thread

  • Timed Waiting threads

  • pulsar client API