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

Fix reconnect race condition #24

Merged
merged 2 commits into from
Nov 15, 2023
Merged

Fix reconnect race condition #24

merged 2 commits into from
Nov 15, 2023

Conversation

zehnm
Copy link
Contributor

@zehnm zehnm commented Nov 15, 2023

The disconnect request had a race condition to trigger multiple connection tasks, if the device was currently trying to connect.

This is a dirty fix only: disconnect request will be ignored if a reconnection task is currently running.
Proper disconnect handling requires a state-machine, or at least a rewrite with a single and cancellable connection task.

The reconnect delay is now only reset at a disconnect request, but the task continues running.

The disconnect request had a race condition to trigger multiple
connection tasks, if the device was currently trying to connect.

This is a dirty fix only: disconnect request will be ignored if a
reconnection task is currently running.
Proper disconnect handling requires a state-machine, or at least a
rewrite with a single and cancellable connection task.
@zehnm zehnm merged commit a1c1d4f into main Nov 15, 2023
2 checks passed
@zehnm zehnm deleted the fix/reconnect branch November 15, 2023 12:05
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.

1 participant