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

Successful connection doesn't reset the exponential backoff state #1597

Open
afk11 opened this issue Sep 29, 2022 · 2 comments
Open

Successful connection doesn't reset the exponential backoff state #1597

afk11 opened this issue Sep 29, 2022 · 2 comments

Comments

@afk11
Copy link

afk11 commented Sep 29, 2022

When I kill crossbar, I can see python-autobahn doing exponential backoff which is fine, however, if the connection re-establishes, the existing state isn't cleared. So if there is a subsequent disconnect, instead of the retry_delay being 0, it continues to grow the previous retry delay

In these circumstances, small outages cause the retry_delay to accumulate, building up to a 5+ minute wait before it even attempts a connection

I'm looking into how I can reach this from the Component, or if changes need to be made to the library, but I wanted to open this in case anyone has feedback or a workaround

Thanks in advance

@afk11
Copy link
Author

afk11 commented Sep 29, 2022

It looks like I want to call _Transport.reset() which would reset self.retry_delay = self.initial_retry_delay

https://github.com/crossbario/autobahn-python/blob/master/autobahn/wamp/component.py#L302

@meejah
Copy link
Contributor

meejah commented Sep 29, 2022

I agree that the autobahn infrastructure itself should reset the delay after a successful connect.

One workaround meanwhile could be to set max_retry_delay to something lower than the default (which is 300 seconds).

If you wanted to try to prepare a fix, I believe the right place to call transport.reset() would be somewhere in this "else" clause when the session is set up: https://github.com/crossbario/autobahn-python/blob/master/autobahn/wamp/component.py#L763 (although it's been a while since I've looked at this code).

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

2 participants