Skip to content
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

JRedisService support for reconnects #16

Open
dnaumenko opened this issue Apr 19, 2010 · 0 comments
Open

JRedisService support for reconnects #16

dnaumenko opened this issue Apr 19, 2010 · 0 comments
Labels

Comments

@dnaumenko
Copy link

I am expecting connection issues while working with redis thought JRedisService. It just says that the used connection is not connected:

Apr 18 23:12:54 tomcat12 tomcat-jqc-app: : Not connected!
Apr 18 23:12:54 tomcat12 tomcat-jqc-app: : org.jredis.ri.alphazero.connection.SynchConnection.serviceRequest(SynchConnection.java:122)
Apr 18 23:12:54 tomcat12 tomcat-jqc-app: : org.jredis.ri.alphazero.JRedisService.serviceRequest(JRedisService.java:179)
Apr 18 23:12:54 tomcat12 tomcat-jqc-app: : org.jredis.ri.alphazero.JRedisSupport.set(JRedisSupport.java:379)
Apr 18 23:12:54 tomcat12 tomcat-jqc-app: : org.jredis.ri.alphazero.JRedisSupport.set(JRedisSupport.java:383)

Previously it was working normal and happens after some time. I've checked the source codes and think this can be caused by 2 ways:

  1. The connection wasn't open previously. I've checked and everything is fine here.
  2. The connection was closed by some thread and JRedisService serves it as a new for future clients. E.g. in SynchConnection I can see that we close the connection in case of exception during serviceRequest() such as: ProviderException, RuntimeException. Looks reasonable that if we want to use this connection for other requests (as it happens in JRedisService) in future, we shouldn't close it in that way. Or make sure to return open connection in JRedisService (maybe in kind of option, e.g. reconnectAutomaticly).

My proposal is to check that JRedisService returns the open connection. And if it's closed, do the automatic reconnect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant