-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Session listeners are not called back in redis cluster #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the report! |
I experienced same situation at tomcat 8 with spring-web-application(spring-data-redis 1.7.1.RELEASE) and redis-cluster(3.0.7).
|
@leehanwool I haven't had a chance to look into this issue yet. Note that we also have a ticket for official Redis Cluster support that we need to get to. See #422 As for your StackTrace, could you please create a separate ticket for the unclosed thread? |
@rwinch @leehanwool created DATAREDIS-493 to check that. |
@rwinch @leehanwool @christophstrobl
Actual implementation of the method in BinaryJedisCluster class is as shown below:
Here If I override this method with custom implementation and subscribe each Jedis Connection in execute method with psubscribe method instead of subscribe method [i.e.,
In case of single Redis node implementation, Jedis Connection is subscribed to patterns using psubscribe method and not the subscribe method. So I applied the same logic for Redis Cluster use-case too and things are working fine. I don`t know whether it is a Jedis issue or current implementation is correct for some purpose. @rwinch @leehanwool @christophstrobl Please provide your feedback for this solution. |
@nirav-patel Thanks for the detailed writeup! I think @christophstrobl will be able to provide better feedback on your solution |
@nirav-patel , Thank you for advise! |
thanks @nirav-patel for detailed information. |
Thanks all for finding missed spot for Jedis. |
Thanks for the reports and helping sort this out! I'm closing this as it appears the issue has been fixed in Jedis |
@rwinch Sorry about commenting on closed issue. I ran into the issue that @sanketmeghani mentioned. I've done a sample project SpringSessionTest with spring-session 1.3.0.RELEASE and spring-data-redis 1.8.3.RELEASE. I've found redis message listener container only subscribed to one node. According to https://github.com/antirez/redis/issues/2541, the keyspace notifications are only sent locally. As a result, the session-expired event will not be processed by listener, unless the key was created on the subscribed node. Following is my test result with my test application, I send two http request to my test application with curl:
And after couple minutes, the log shows the first session expired event have been received and processed, but the second session was not.
Please help to re-investigate this issue, |
@horance we've got an open issue in Spring Data Redis to tackle this. Please see: DATAREDIS-534. |
@rwinch We are using spring-session 1.2.0.RC1 and spring-data-redis 1.7.0.RC1. Somehow we are not getting the listener call back if we use redis cluster. It works perfect if we use a stand-alone redis server. I have uploaded a sample springSessionContext.xml.
On one of the nodes in redis cluster, we see "SUBSCRIBE" "__keyevent@:expired" "spring:session:event:created:" "__keyevent@*:del" command. So it does subscribe on one node. Should it subscribe to all nodes in the cluster? Or this is expected behavior?
Sample application code is available here.
The text was updated successfully, but these errors were encountered: