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

Implement reconnect when connection closed by Pusher #23

Open
mloughran opened this issue Oct 22, 2013 · 10 comments
Open

Implement reconnect when connection closed by Pusher #23

mloughran opened this issue Oct 22, 2013 · 10 comments

Comments

@mloughran
Copy link
Contributor

Currently if Pusher closes the socket, the client will infinite loop since it rescues IOError, which is an ancestor of EOFError.

I imagine you'll see this happening every few weeks on average - do you see this @rkh @pat?

@rkh
Copy link
Contributor

rkh commented Oct 22, 2013

We currently use the ruby client for our command line client only, so we don't have any advanced monitoring in place and no long running processes. I have seen it hang, usually after I lose my network connection (for instance, when putting computer to sleep but having the monitor run).

@mloughran
Copy link
Contributor Author

@rkh makes sense, explains why this isn't a biggie for you guys :)

@vedanova
Copy link

+1, there should be a way to monitor the connection and auto reconnect on connection errors.

@macool
Copy link

macool commented Mar 20, 2014

👍

@snitko
Copy link

snitko commented Mar 23, 2014

Has anyone found where exactly in the code of pusher-ruby-client this rescue clause is located? I found a couple, but they don't seem to be the ones causing this loop. What happens for me is the client suddenly stops receiving updates and I see no messages from logger whatsoever.

@zimbatm
Copy link
Contributor

zimbatm commented Mar 23, 2014

These is a design issue where https://github.com/pusher/pusher-ruby-client/blob/master/lib/pusher-client/websocket.rb#L89 will ignore IO errors and return an empty list of messages. https://github.com/pusher/pusher-ruby-client/blob/master/lib/pusher-client/socket.rb#L206 who consumes them will see that there is no message and go for the next iteration of the loop. Somewhere around there we should probably emit a "pusher:connection_disconnected" event and let the user deal with the reconnection strategy that he wants to use.

@tacticiankerala
Copy link

I am getting infinite loop of EOF logs from pusher. Not sure under which circumstance it occurs.

When will the socket connection throw EOF error?

@neurogenesis
Copy link

+1, seeing this issue 1-2 times a week. noticed that @zimbatm checked in two related changes ~26 days ago for websocket.rb and socket.rb (9b187b3). since these appear to be server-side, is there an idea of when this might make it into production?

@zimbatm
Copy link
Contributor

zimbatm commented Jun 18, 2014

I have started a rewrite last week but it's low priority, I don't know how long it will take to release it.

@owenthereal
Copy link

+1, any update on this?

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

No branches or pull requests

8 participants