jedis
jedis copied to clipboard
Stackoverflow error in jedis when unsubscribing listener
Expected behavior
For listener to get unsubscribed
Actual behavior
Going into stackoverfliw
java.lang.StackOverflowError: null
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:353)
at java.base/java.net.Socket.connect(Socket.java:615)
at redis.clients.jedis.DefaultJedisSocketFactory.createSocket(DefaultJedisSocketFactory.java:80)
at redis.clients.jedis.Connection.connect(Connection.java:226)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:140)
at redis.clients.jedis.Connection.sendCommand(Connection.java:163)
at redis.clients.jedis.Connection.sendCommand(Connection.java:154)
at redis.clients.jedis.BinaryClient.auth(BinaryClient.java:815)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:145)
at redis.clients.jedis.Connection.sendCommand(Connection.java:163)
at redis.clients.jedis.Connection.sendCommand(Connection.java:154)
at redis.clients.jedis.BinaryClient.auth(BinaryClient.java:815)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:145)
at redis.clients.jedis.Connection.sendCommand(Connection.java:163)
at redis.clients.jedis.Connection.sendCommand(Connection.java:154)
Steps to reproduce:
Dont have exact steps as it occurs sometime We subscribe to channels in a completable future and if for some reasons, future returns, we try to unsubscribe and subscribe again, thats when this issue occurs
Redis / Jedis Configuration
Jedis version:
3.7.1
Redis version:
Java version:
see same error in 3.9.0. When handle subscribe exceptions, java.lang.StackOverflowError is thrown and the subscribe is not recovered
at redis.clients.jedis.BinaryClient.auth(BinaryClient.java:825)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:146)
at redis.clients.jedis.Connection.sendCommand(Connection.java:163)
at redis.clients.jedis.Connection.sendCommand(Connection.java:154)
at redis.clients.jedis.BinaryClient.auth(BinaryClient.java:825)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:146)
at redis.clients.jedis.Connection.sendCommand(Connection.java:163)
at redis.clients.jedis.Connection.sendCommand(Connection.java:158)
at redis.clients.jedis.BinaryClient.unsubscribe(BinaryClient.java:837)
at redis.clients.jedis.BinaryJedisPubSub.unsubscribe(BinaryJedisPubSub.java:42)
at org.springframework.data.redis.connection.jedis.JedisSubscription.doClose(JedisSubscription.java:46)
at org.springframework.data.redis.connection.util.AbstractSubscription.close(AbstractSubscription.java:106)
at org.springframework.data.redis.connection.jedis.JedisConnection.close(JedisConnection.java:336)
at org.springframework.data.redis.listener.RedisMessageListenerContainer$Subscriber.closeConnection(RedisMessageListenerContainer.java:1323)
at org.springframework.data.redis.listener.RedisMessageListenerContainer.handleSubscriptionException(RedisMessageListenerContainer.java:893)
at org.springframework.data.redis.listener.RedisMessageListenerContainer$BlockingSubscriber.lambda$eventuallyPerformSubscription$2(RedisMessageListenerContainer.java:1437)
at java.base/java.lang.Thread.run(Unknown Source)
Same issue on jedis 3.8.0
java.lang.StackOverflowError: null
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/sun.net.spi.DefaultProxySelector.select(Unknown Source)
at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
at java.base/java.net.Socket.connect(Unknown Source)
at redis.clients.jedis.DefaultJedisSocketFactory.createSocket(DefaultJedisSocketFactory.java:80)
at redis.clients.jedis.Connection.connect(Connection.java:226)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:144)
at redis.clients.jedis.Connection.sendCommand(Connection.java:163)
at redis.clients.jedis.Connection.sendCommand(Connection.java:154)
at redis.clients.jedis.BinaryClient.auth(BinaryClient.java:819)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:149)
at redis.clients.jedis.Connection.sendCommand(Connection.java:163)
at redis.clients.jedis.Connection.sendCommand(Connection.java:154)
at redis.clients.jedis.BinaryClient.auth(BinaryClient.java:819)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:149)
at redis.clients.jedis.Connection.sendCommand(Connection.java:163)
at redis.clients.jedis.Connection.sendCommand(Connection.java:154)
at redis.clients.jedis.BinaryClient.auth(BinaryClient.java:819)
@nishantjain91 @qi-min @abubeback Would it be possible for any of you to test Jedis 4? Preferably 4.3.0-m2?
Closed due to inactivity.
Any Suggestion on this? just upgrade the jedis to 4.x can help?