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(transport): return Poll::ready until error is consumed #536

Merged
merged 5 commits into from
Jan 15, 2021

Conversation

LucioFranco
Copy link
Member

Fixup of #495

tl-helge-hoff and others added 5 commits November 19, 2020 17:00
When a lazy connection fails to connect it first
returns Poll::ready from the reconnect service,
yet the subsequent call returns Poll::pending
making tower_balance loop forever.
Instead, on error we return Ready
until the error is consumed in the
call method.
if let Some(error) = self.error.take() {
return ResponseFuture::error(error);
tracing::error!("error: {:?}", error);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why log messages at error when we're returning the error? As this is a library, it seems preferable to keep these at something like debug so that the application has more control over whether these are handled/logged, etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, if I understand correctly, this would log the errors twice -- once above in poll_ready and then again at call-time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, no one has complained about it yet, but I think thats not a bad idea. Let me do a pass of those in a follow up PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

no one has complained about it yet

If I'm correct, this logging was introduced by this PR and not there before...

Copy link
Member Author

Choose a reason for hiding this comment

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

We had two other places where we logged at error!, so I moved them all to debug!, thats what I meant.

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.

3 participants