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

RobustConnection (re)connect tasks are impossible to stop #414

Open
tilsche opened this issue Sep 25, 2021 · 0 comments
Open

RobustConnection (re)connect tasks are impossible to stop #414

tilsche opened this issue Sep 25, 2021 · 0 comments

Comments

@tilsche
Copy link
Contributor

tilsche commented Sep 25, 2021

This is related to #279. To implement a reconnect timeout from the outside, we use a watchdog doing await RobustConnection.close() after a reconnect timeout. But that doesn't actually do anything to the ongoing loop in RobustConnection.connect() (spawned by reconnect()). There are several issues with this:

  • You can't get out of this loop except for ugly workarounds (forcing fail_fast=True).
  • There is no handle to this task running in the loop completely detached:
    • It is impossible to cancel this particular task
    • It is impossible to handle exceptions properly - so if we force it to stop somehow, there will always be a "Task exception was never retrieved"-error

I would suggest that RobustConnection keeps track of reconnect() tasks and cleanly cancel() them in close().

I'm happy to help with a PR if the general direction would be acceptable.

While this constitutes an independent improvement. Issue #279 / PR #247 would still be great to have.

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

1 participant