-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Sporadic disconnects (close events) at start up #96
Comments
This is consistent with the behavior observed with faye-websocket. We try to open a lot of connections, and the client can't process them fast enough, causing these You definitely want to handle the close event and try to reconnect, like https://github.com/dblock/slack-ruby-bot-server/blob/8ba27e827cfcc75bf6d015e5117c12c72fa33096/lib/slack-ruby-bot-server/server.rb#L15. I had switched to using celluloid-io for all of my projects, which doesn't do the |
The start up issue was resolved after switching to
|
Hmmm... check out celluloid/celluloid-io#176 and https://github.com/dblock/slack-ruby-client/issues/90, does this explain any of this? |
Actually if Slack integration is deleted, 'close' event happens correctly. When I was trying to simulate connection problems by turning off Wi-Fi and had periodic pings, I got exception above. Probably, |
Yes, that sounds just right! Maybe it should be a whole other range of exceptions, would appreciate some research too in other network conditions. Would love a PR! |
I think another one is
|
For easy repro cases, https://gist.github.com/dblock/1250a5497ff3c7af81c05964c459ff86. |
Closed the wrong issue, reopening ;) |
I have an issue with starting up multiple bot clients after application start up. Sometimes, "CLOSE" event is being fired for many clients and regular reconnection logic doesn't help (while it works fine in event of temporary network disconnect). "CLOSE" events have "code" value 1006.
It doesn't happen every time, and it have something to do with time spent in callbacks, I suppose.
A snippet used to reproduce the issue - https://gist.github.com/tikh/50d5cf34481330759a736aa351e3ee2e. Simply adding a "sleep" to "hello" callback makes the issue happen. But even without sleep this happens sometimes.
In the example,
faye-websocket
gem was used and 300 connections to different Slack teams.The text was updated successfully, but these errors were encountered: