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.

Unable to acquire subscription lock

See original GitHub issue

During relatively high load (~150-250 requests per minute), I often see this error

Caused by: org.redisson.client.RedisTimeoutException: Unable to acquire subscription lock after 3000ms. Increase 'subscriptionsPerConnection' and/or 'subscriptionConnectionPoolSize' parameters.
	at org.redisson.pubsub.PublishSubscribe.lambda$subscribe$2(PublishSubscribe.java:69)
	at io.netty.util.HashedWheelTimer$HashedWheelTimeout.run(HashedWheelTimer.java:715)
	at io.netty.util.concurrent.ImmediateExecutor.execute(ImmediateExecutor.java:34)
	at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:703)
	at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:790)
	at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:503)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:833)

I doubled the subscriptionsPerConnection from 5 to 10, the subscriptionConnectionPoolSize from 50 to 100, and the connectionPoolSize from 64 to 128, but it doesn’t seem to have helped.

How can I go about diagnosing/debugging this? Do I need to just keep increasing these parameters till it works?

Redis version

6.x

Redisson version

3.16.8

Redisson configuration

config.useSingleServer().apply {
    path.toIntOrNull()?.also {
        database = it
    } ?: run {
        logger.warn { "Unable to parse database number: $path from redis configuration" }
    }
    
    subscriptionsPerConnection = 10
    subscriptionConnectionPoolSize = 100
    connectionPoolSize = 128
    timeout = 6000
}
config.nettyThreads = 64

I have also tried using Redisson versions 12.0, 13.0, 14.0, 15.0, 16.0 and 17.0 without luck.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:33 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
Sovietacedcommented, Jul 29, 2022

Please try 3.17.4 version, since it has fix for #4294

We have been experiencing this issue for years. I had raised a similar thread a while ago. It started happening to us again recently so I decided to search again and found this thread.

For us the indication that something was very obviously broken on the client side is that the operation would timeout immediately despite claiming that the timeout was many seconds.

2022-07-29T17:56:07.021Z - Acquiring lock for fleet-info-cache:fleet-info-sync-task task… 2022-07-29T17:56:07.021Z - org.redisson.client.RedisTimeoutException: Subscribe timeout: (7500ms). Increase ‘subscriptionsPerConnection’ and/or ‘subscriptionConnectionPoolSize’ …

We had very similar issues where seemingly only some of our kubernetes pods would experience this issue. It would remain throughout reboots.

So I took this opportunity to try upgrading to 3.17.5 and it appears to have solved the problem!

0reactions
mrnikocommented, Jul 31, 2022

@Sovietaced

Thanks for feedback!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to lock release using subscription-manager
We have to test new storage devices against several rhel releases/versions. Therefore, I use subscription-manager to lock the release.
Read more >
IBM InfoSphere Change Data Capture Unable to set a lock for ...
(Access Manager, right click on the Datastore->Properties->Require subscriptions to be locked before editing) on both the source and the target.
Read more >
Protect your Azure resources with a lock - Microsoft Learn
A read-only lock on a subscription prevents Azure Advisor from working correctly. Advisor is unable to store the results of its queries.
Read more >
Paid for a subscription but premium content is still locked
If you are already logged in, log out and force-quit the app, then re-open it and log back in. If you purchased your...
Read more >
Learn about the Nest × Yale Lock before you buy
When someone enters an incorrect passcode five times; If you lock goes offline for more than 10 minutes; When your deadbolt is unable...
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