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.

Microsoft Azure and Redisson: Unable to init enough connections amount

See original GitHub issue

Context

We are in the process of migrating to Microsoft Azure and are planning to make use of the Azure Redis Cache. Because of this, I am in the process of investigating Redisson and have been for the most part impressed by the performance and feature set.

However, I have been running into this intermittent issue for a few days now. Every now and again, when the application starts up, Redisson will throw an error, telling me that it’s only able to initialise 31 of 32 connections. My experiments with Lettuce didn’t seem to run into anything similar to this.

Anyone have any thoughts or suggestions on things to look into to resolve this? Is there something particular about Azure Redis Cache that might need to be configured? Does Redisson need all 32 connections or would reducing the required number potentially resolve this?

Expected behavior

Successfully connects to Redis every time.

Actual behavior

Infrequently throws the following error on application start-up:

<21-Jun-2019 09:14:07,916 o'clock BST> <Error> <HTTP> <BEA-101216> <Servlet: "InitSWCTest" failed to preload on startup in Web application: "test/app".
java.lang.ExceptionInInitializerError
	at com.demo.test.ejb.permissions.engine.cache.PermissionCacheManager.createManager(PermissionCacheManager.java:27)
	at com.demo.test.ejb.permissions.engine.cache.PermissionCacheManager.<clinit>(PermissionCacheManager.java:9)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at com.demo.test.common.ClassUtil.initialise(ClassUtil.java:30)
	Truncated. see log file for complete stacktrace
Caused By: org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 31 from 32 were initialized. Redis server: test.redis.cache.windows.net/XX.XXX.XX.XXX:YYYY
	at org.redisson.connection.pool.ConnectionPool$1.lambda$run$0(ConnectionPool.java:160)
	at org.redisson.misc.RedissonPromise.lambda$onComplete$0(RedissonPromise.java:183)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:502)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:476)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:415)
	Truncated. see log file for complete stacktrace
Caused By: io.netty.channel.ConnectTimeoutException: connection timed out: test.redis.cache.windows.net/XX.XXX.XX.XXX:YYYY
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:267)
	at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38)
	at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:127)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)

Redis version

3.2.7

Redisson version

5.10.7

Redisson configuration

Config config = new Config();
config.useSingleServer()
    .setAddress(redisConnectionString)
    .setPassword(redisPassword);

RedissonClient redissonClient = Redisson.create(config);

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:30 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
mrnikocommented, Jun 21, 2019

it then at a later date it starts only managing to initialise 29

It shouldn’t. If Azure doesn’t have any limitation then try to increase connection timeout. Though, even 10 connections should be enough.

0reactions
colonelpopcorncommented, Oct 5, 2021

@asarkar You’re forgetting those running in serverless environments. We’re running into this issue in our production AWS Lambda environment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to init enough connections amount - Stack Overflow
Today I start the spring boot project in MacBook Pro with M1 pro(with 8 performance core and 2 efficient core), shows error:
Read more >
Best practices for connection resilience - Azure Cache for Redis
Configure your client library to use a connect timeout of five seconds, giving the system sufficient time to connect even under higher CPU ......
Read more >
A Guide to Redis with Redisson - Baeldung
A quick and practical guide to using Redisson for accessing Redis from a Java application.
Read more >
redisson - Bountysource
Redisson - distributed and scalable Java data structures (Set, SortedSet, Map, ... redisson connection fail, but other redis client, connection success.
Read more >
Overview of Redisson: The Redis Java Client - DZone
Why Redisson? Redis is an open-source, in-memory data structure store that can be used as a NoSQL key-value database, as well as a...
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