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

Do not attempt to reconnect on every packet received #406

Merged
merged 2 commits into from
Apr 12, 2023

Conversation

michaeldjeffrey
Copy link
Contributor

If a gateway is connected, attempt to send all waiting packets. Otherwise we store and move on, the reconnection logic will trigger sending the packets when it is successful.

I changed the reconnect logging verbiage to only be about the connection. It's a bit confusing to read the logs and immediately see that you're "reconnecting" when the gateway is connecting for the first time.

We only attempt to reconnect on Err(err).
Ok(None) means the stream was closed explicitly by the server.

If a gateway is connected, attempt to send all waiting packets.
Otherwise we store and move on, the reconnection logic will trigger
sending the packets when it is successful.

I changed the reconnect logging verbage to only be about the connection.
It's a bit confusing to read the logs and immediately see that you're
"reconnecting" when the gateway is connecting for the first time.
@madninja madninja force-pushed the mj/router-reconnect branch 2 times, most recently from c792aa9 to 52e2fa3 Compare April 7, 2023 21:16
This change will recalculate the reconnect timer based on the fact that there was an error during the router.

If an error happens during a fresh connection the reconnect timer will be set to a short time using `next_connect` which will not try to connect immediately. The subseequent timer firing will end up reconnecting the router and sending the messages
@madninja madninja merged commit 89dc585 into main Apr 12, 2023
@madninja madninja deleted the mj/router-reconnect branch April 12, 2023 21:34
This pull request was closed.
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

Successfully merging this pull request may close these issues.

2 participants