question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

threads blocked waiting on CountDownLatch

See original GitHub issue

Hello,

We are facing an an issue where some threads get blocked indefinitely waiting on the CountDownLatch in CommandAsyncService.get(). Relevant section of the thread dump:

- waiting on java.util.concurrent.CountDownLatch$Sync@1f2311a9
at java.util.concurrent.locks.LockSupport.park(LockSupport.java: at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:232)
at org.redisson.command.CommandAsyncService.get(CommandAsyncService.java:186)
...

The reason for why the requests aren’t able to complete isn’t relevant here (we are deploying redis in kubernetes, and are working through various upgrade/failure scenarios that currently can result in severed connections). However, it’s strange to me that the CommandAsyncService.get() method doesn’t respect timeout configuration, and simply calls l.await(). Is there any way around this? Please let me know if I am misunderstanding the situation.

Expected behavior

CommandAsyncService.get() should throw an exception if the future is unable to complete within a timeout.

Actual behavior

Many threads are hanging indefinitely in the CommandAsyncService.get() method.

Redis version

5.0.5

Redisson version

3.10.7

Redisson configuration

nettyThreads=16 masterConnectionPoolSize=200 masterConnectionMinimumIdleSize=100 subscriptionConnectionPoolSize=200 subscriptionConnectionMinimumIdleSize=100 subscriptionsPerConnection=10 connectionTimeout=10000 retryInterval=3000 retryAttempts=10 keepAlive=true tcpNoDelay=true clusterScanInterval=2000 pingConnectionInterval=10000

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:32 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
mrnikocommented, Sep 6, 2019

I did some changes to fix this issue. Please try attached version below:

redisson-3.11.4-SNAPSHOT.jar.zip

0reactions
mrnikocommented, Sep 23, 2019

Fixed! Please reopen it. If you encounter this issue again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Thread blocked on CountDownLatch await() when count is 0
While analyzing the logs of one of the production environments, I saw a thread in "WAITING" state on a countdownlatch await() ...sun.misc.
Read more >
Guide to CountDownLatch in Java - Baeldung
Essentially, by using a CountDownLatch we can cause a thread to block until other threads have completed a given task.
Read more >
CountDownLatch (Java Platform SE 7 ) - Oracle Help Center
The await methods block until the current count reaches zero due to invocations of the countDown() method, after which all waiting threads are...
Read more >
How to use CountDownLatch in Java? Example - Java67
CountDowaLatch is a high-level synchronization utility that is used to prevent a particular thread to start processing until all threads are ready.
Read more >
Indefinute wait on count down latch during crea... - JBoss.org
A stack dump shows all but one of the threads processing jms requests to be blocked waiting on a lock. The one thread...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found