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

WebSocket reconnects #12

Open
SpComb opened this issue Sep 19, 2016 · 0 comments
Open

WebSocket reconnects #12

SpComb opened this issue Sep 19, 2016 · 0 comments

Comments

@SpComb
Copy link
Member

SpComb commented Sep 19, 2016

If the backend encounters an connection error, it will crash, and if running as a systemd service, restart. Currently, the frontend UI will detect the websocket close, and freeze the UI into an error state.

It should instead reconnect once the server comes back up.

This is particularly important for the e2-server, as it does not manage any E2 connection state and will error out if disconnected from the E2. See #6 (comment)

I spoke too soon... after exactly five minutes the server crashed

2016/09/12 22:04:42 xmlClient.read: update
2016/09/12 22:04:42 client:TCPClient 192.168.1.27: recv: []string{"\x04ATRN", "-e", "0"}
2016/09/12 22:09:43 xmlClient.read: read tcp4 192.168.1.25:40214->192.168.1.27:9876: i/o timeout
2016/09/12 22:09:43 server.Run: xmlClient.Read: read tcp4 192.168.1.25:40214->192.168.1.27:9876: i/o timeout

That's a timeout error on the XML connection. Did your network connection between the rpi server and your E2 break?

The tally binary handles E2 client disconnects by waiting for it to reappear. The server code is far more simple and only handles a single E2 client, and it exits if the client disconnects.

ATM this "crash fast" behaviour is more or less intentional, and you should use something like systemd to restart the service. The server itself is stateless, so it's more or less the same end result as handling reconnects within the code. Just far simpler than implementing the reconnect code.

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

1 participant