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

Redis Engine has concurrency bug #54

Closed
banks opened this issue Dec 23, 2015 · 0 comments · Fixed by #58
Closed

Redis Engine has concurrency bug #54

banks opened this issue Dec 23, 2015 · 0 comments · Fixed by #58

Comments

@banks
Copy link
Member

banks commented Dec 23, 2015

At high volume I start to see redis connections drop. I've not worked out why but it's not very surprising in general.

When they do I see a lot of errors like redigo: connection closed.

The only way you can get that as far As I can see from redigo code is if you tried to issue some command to a closed pool connection (and logged the err so additional conn.Close() doesn't count).

I suspect this happens:

  1. initializePubSub is in subscribe loop
  2. redis error occurs and it return, closing e.psc (actually not it closes it twice - once explicitly and once in defer but that shouldn't matter as second is a no-op)
  3. before checkConnectionStatus manages to run and reconnect e.psc, new client subscribes and subscribe() call blindly calls e.psc.Subscribe on the closed conn.

Note that this doesn't even require multiple processors to be triggered (could happen with GOMAXPROCS=1 due to checkConnectionStatus sleeping for a second before it reconnects).

@banks banks mentioned this issue Dec 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant