Microsoft Azure and Redisson: Unable to init enough connections amount
See original GitHub issueContext
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:
- Created 4 years ago
- Reactions:1
- Comments:30 (15 by maintainers)
It shouldn’t. If Azure doesn’t have any limitation then try to increase connection timeout. Though, even 10 connections should be enough.
@asarkar You’re forgetting those running in serverless environments. We’re running into this issue in our production AWS Lambda environment.