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
Subscriber receives all cached messages upon initial connection on Redis-backed channel regardless of buffer lengt #445
Comments
Also, I do realize that I could just set the I've essentially reduced the example to use a buffer length of |
I'm also running into this issue. I was able to alleviate the issue for a while with |
Restarting the Nchan servers also clears out the old messages. So it seems like they are cached to memory and getting 'stuck'. |
Any thoughts on this or anything we can do to help move it along? |
I already have a pretty good idea what's happening here, the fix is just a bit tricky. If you're interested, I wouldn't mind if you did some regression testing to see if an earlier version worked as expected. |
Definitely.. just let me know which version and I'll give it a shot. Thanks! |
I'm also willing to do some testing, do you have an idea which range of older versions may have worked as expected? |
*nudge* :) |
@danjbh , @concreted : This issue should be fixed with d3a6557. Please rebuild Nchan from lastest master and let me know if the problem persists, as I have trouble replicating it with any consistency. |
Err, nope, I just reproduced it. Not fixed yet... |
aand fixed in a778114 . Please rebuild from master and give it a try. |
I'm heading out of town for the next week but I'll give it a shot and see if I can reproduce once I return. Thanks again for looking into this @slact ! |
Alright, I'm back in action and was able to perform some limited testing this morning. So far I have been unable to reproduce and will do some extensive ("production style") testing later this afternoon/evening. Anyhow, everything looks promising so far -- thanks again and stay tuned! |
Just finished rolling these changes into production and everything is looking great so far. I'll monitor closely over the next few days and will report any issues, but typically I would have seen a problem by now. I'm able to successfully scale the app horizontally into multiple containers w/ a shared redis back-end. Good stuff! Thanks a bunch for getting this working -- this software has been extremely valuable and even more so now that we can scale it properly! |
Great, this code will be part of the upcoming release. Redis connection management got a big rewrite too, and you can now load-balance message delivery onto slaves, optimize for Redis CPU or Bandwidth, there's auto-failover for clusters and master-slave setups, and a bunch of other stuff. I'll be putting out an official release with all this stuff in a week or two. |
@danjbh It would be aweosme if you share the horizontal scaling schema that you use. From this thread and nginx.conf 2016 slides by Leo I have an impression that your config looks something like this:
Am I right? Also, I have a couple of questions:
Thanks in advance! |
I'm currently testing nchan w/ a Redis back-end and noticed that my websocket clients will receive all messages cached by the app instead of the number I have set in
nchan_message_buffer_length
(withnchan_subscriber_first_message
set tooldest
).Basically, I need clients who request a specific location to get just the 5 messages in a channel buffer. I'm not sure if it makes a difference, but I am running this inside of Docker (nchan version 1.1.14). If I use the
backup
storage mode, this problem goes away but then I can't scale this app horizontally.Also, I noticed that if I run a
flushall
on Redis after hitting the buffer length, it seems to un-stick the messages somehow (perhaps that's a clue).Let me know if there's anything I can do to help track this one down. This is a great piece of software and would be willing to send over a healthy donation if we could get this fixed and into production!
Here is my config and steps to reproduce...
Steps to reproduce
foo
channel using thepub
endpoint (viacurl
or preferred method)foo
channelThe text was updated successfully, but these errors were encountered: