-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
redigo always random errors when many connections coming #55
Comments
The application used a connection after closing the connection.
Concurrent writes to a connection can cause this error. See http://godoc.org/github.com/garyburd/redigo/redis#hdr-Concurrency for information on the concurrency allowed by Redigo.
I don't know what this error is. If you log the error type, I might be able to figure out what it is
The application is assuming that a string value returned by the server is a multi-bulk value. |
I get many many these errors, then my web application shut down. I need your help.Thank you very much.
But I restart my web application. It run good for sometime.After run for an hour or more than. Suddenly get these errors and it always got these errors writed to my log file. Can't get any response to my user. |
This error is caused by a bug in your application code. I cannot debug your application code from an error message. |
@garyburd Could you help me check my code. the main problem happen in the package models App.Rset() method. |
Your application writes concurrently to a Redis connection. Concurrent writes are not supported. |
I am a golang newbie. Could you tell me how to change my code to use redis conn rightly.Could you give me some code how to rewrite my app.Rset() method? |
As the documentation states, create the pool once. A request handler should get a connection from the pool and close the connection when the handler is done:
I don't have time to write code for your application. |
I used it as you say. A controller when New a model will get a redis conn belong to this model and close it when this controller finished.
|
I init redis pool in a model package, and one model(one Mysql table one model ) use RedisPool.Get() get a redis conn to DO redis command.
When many connections coming redigo always random get errors like these:
The text was updated successfully, but these errors were encountered: