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

Add tenacious strategy and use it as default #64

Merged
merged 11 commits into from
Nov 24, 2022

Conversation

floitsch
Copy link
Member

The simple client is thus significantly more robust to connection issues.

floitsch and others added 8 commits November 11, 2022 15:16
The transport-reconnect could throw, but that wasn't handled correctly.
The simple client is thus significantly more robust to connection issues.
…hub.com:toitware/mqtt into floitsch/better_error_handling.permanent_client
@floitsch floitsch requested a review from kasperl November 23, 2022 15:21
Copy link
Contributor

@kasperl kasperl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@@ -248,7 248,8 @@ abstract class DefaultReconnectionStrategyBase implements ReconnectionStrategy:
]

receive_connect_timeout_ /Duration
attempt_delays_ /List
attempt_delays_ /List?
delay_lambda_/Lambda?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
delay_lambda_/Lambda?
delay_lambda_ /Lambda?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

if attempt_counter == 0:
// In the first iteration we try to connect without delay.
if not reuse_connection:
logger_.debug "Attempting to reconnect"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this already what you consider a reconnect (not just a connect)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it to "(re)connect".

hasn't received yet.
Theoretically, this is a protocol violation, but most brokers just drop the packet.

Note that this can also happen to clients that don't set the clien-session flag, but
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note that this can also happen to clients that don't set the clien-session flag, but
Note that this can also happen to clients that don't set the client-session flag, but

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.


Note that this can also happen to clients that don't set the clien-session flag, but
where the broker lost the session. This can happen because the session expired, the
broker crashed, or a client with the same ID connectend in the meantime with a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
broker crashed, or a client with the same ID connectend in the meantime with a
broker crashed, or a client with the same ID connected in the meantime with a

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@floitsch floitsch enabled auto-merge (squash) November 24, 2022 11:35
@floitsch floitsch merged commit f275a6b into main Nov 24, 2022
@floitsch floitsch deleted the floitsch/better_error_handling.permanent_client branch November 24, 2022 12:07
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