最近项目经常报错,由于用户的登录信息存储在redis中,故导致用户无法登陆,已登录状态也无法进行其他操作。
关键信息:
JedisDataException: ERR max number of clients reachedRedis报错信息
2018-01-26 11:05:20.365,INFO ,o.s.c.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'redis.clients.jedis.JedisPoolConfig#69830c53' of type [class redis.clients.jedis.JedisPoolConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-26 11:05:20.383,INFO ,o.s.c.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'jedisPool' of type [class redis.clients.jedis.JedisPool] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
org.springframework.dao.InvalidDataAccessApiUsageException: ERR max number of clients reached; nested exception is redis.clients.jedis.exceptions.JedisDataException: ERR max number of clients reached
at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:44) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:36) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:37) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:37) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.data.redis.connection.jedis.JedisConnection.convertJedisAccessException(JedisConnection.java:195) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.data.redis.connection.jedis.JedisConnection.sMembers(JedisConnection.java:1879) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.data.redis.core.DefaultSetOperations$7.doInRedis(DefaultSetOperations.java:130) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.data.redis.core.DefaultSetOperations$7.doInRedis(DefaultSetOperations.java:127) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:190) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:152) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:85) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.data.redis.core.DefaultSetOperations.members(DefaultSetOperations.java:127) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.data.redis.core.DefaultBoundSetOperations.members(DefaultBoundSetOperations.java:91) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
at org.springframework.session.data.redis.RedisSessionExpirationPolicy.cleanExpiredSessions(RedisSessionExpirationPolicy.java:111) ~[spring-session-1.0.2.RELEASE.jar:na]
at org.springframework.session.data.redis.RedisOperationsSessionRepository.cleanupExpiredSessions(RedisOperationsSessionRepository.java:216) ~[spring-session-1.0.2.RELEASE.jar:na]
Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR max number of clients reached
at redis.clients.jedis.Protocol.processError(Protocol.java:113) ~[jedis-2.5.2.jar:na]
at redis.clients.jedis.Protocol.process(Protocol.java:131) ~[jedis-2.5.2.jar:na]
at redis.clients.jedis.Protocol.read(Protocol.java:200) ~[jedis-2.5.2.jar:na]
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:285) ~[jedis-2.5.2.jar:na]
at redis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:221) ~[jedis-2.5.2.jar:na]
at redis.clients.jedis.BinaryJedis.smembers(BinaryJedis.java:1298) ~[jedis-2.5.2.jar:na]
at org.springframework.data.redis.connection.jedis.JedisConnection.sMembers(JedisConnection.java:1877) ~[spring-data-redis-1.4.2.RELEASE.jar:1.4.2.RELEASE]
- 解决方案:
暂未解决
- 可能原因
飞哥在编写0208新年抽奖活动的代码,用redis做锁,可能导致redis出异常。