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 subscriptions not released when Timeout is raised #94

Open
lauri865 opened this issue Nov 10, 2016 · 6 comments
Open

Redis subscriptions not released when Timeout is raised #94

lauri865 opened this issue Nov 10, 2016 · 6 comments

Comments

@lauri865
Copy link

It seems as if connection_pool fails to release redis subscriptions. Once Timeout is raised, it every subsequent try will result in Timeout as well.

Steps to reproduce:

  1. Set redis pool size to something low (like 2 to 5)
  2. Open a dashboard and spam refresh
  3. Refresh and you won't see any widgets populated
@lauri865
Copy link
Author

The problem was that disconnection was not detected.

The solution:

  • Adding a heartbeat job
  • The trick is: the heartbeat needs its dedicated Redis connection

@gottfrois
Copy link
Owner

Hey there!

Can you elaborate a bit more about what is a heartbeat job in your case?

@lauri865
Copy link
Author

Sure, here it is: http://pastebin.com/hgE1bECD

5s is for development purposes, otherwise it can be longer as well.

@lauri865
Copy link
Author

All rufus jobs should be set to non-overlapping as well, because the 3s timeout limit allows requests to accumulate, thus using even more redis connections from the pool.

@gottfrois
Copy link
Owner

Interesting, so is there something we can do in that repo?

@lauri865
Copy link
Author

We can. I've since opening the issue changed the logic on my end completely.

Instead of having a subscription for each /events stream, there is now a single subscription pushing to all SSE streams. Seems like a more reasonable approach to me. Or do you any counter arguments?

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

No branches or pull requests

2 participants