-
Notifications
You must be signed in to change notification settings - Fork 136
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
Occasional exception: org.jredis.connector.ConnectionReset: Connection re-established but last request not processed: in.read returned -1 #57
Comments
That's due to a connection timeout. Java does not raise an error on a dropped connection on send and it's only on the read end that you get a -1 returned (with semantics as defined in the javadocs e.g. "connection reset"). What is the timeout value in redis conf? |
It is set at 300 seconds in redis.conf. This could also be due to the way I implemented Connection management---using ThreadLocal. So I will verify if there are any connections open in my side for more than 300 seconds. Thanks for the pointer. |
NP; happy to help. I assumed you were pooling connections; can you confirm? |
I was believing that I have to manually pool connections..., so I implemented my logic based on a Servlet Filter which creates a new Redis connection, and throughout this particular request flow, this connection is used. Is there a better approach for pooling connections? |
hmm. If you have a connection per request, then why would it even be idle for > 300s ?? |
I have to run some test if my implementation of ThreadLocal is holding connections open. So do you know of any OpenSource connection pool library for JRedis? |
I added few logs to my application and see that it is indeed timeout problem. Now I have pointer to work on this issue independently. I am closing this issue because this is not a JRedis bug. Thanks a lot for the pointer. |
Reopening as documentation issue. |
Closing this. The javadoc for the exception states explicitly this is "typically due to timeout on Redis side". |
Can this also be added as part of Exception message? |
This is the trace:
This is happening on random basis. I am using the latest jredis from trunk ( 2c58286 ) and using Redis 2.2.12.
The text was updated successfully, but these errors were encountered: