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

swallowed errors, or escalating too quickly #3269

Closed
rkuhn opened this issue Dec 20, 2022 · 2 comments · Fixed by #3577
Closed

swallowed errors, or escalating too quickly #3269

rkuhn opened this issue Dec 20, 2022 · 2 comments · Fixed by #3577
Labels
bug difficulty:easy help wanted priority:important The changes needed are critical for libp2p, or are blocking another project

Comments

@rkuhn
Copy link
Contributor

rkuhn commented Dec 20, 2022

ConnectionEvent::DialUpgradeError(DialUpgradeError { error, .. }) => {
if self.pending_error.is_none() {
self.pending_error = Some(error);
}
}
ConnectionEvent::AddressChange(_) | ConnectionEvent::ListenUpgradeError(_) => {}

@mxinden This is where incoming stream upgrade errors are lost, as mentioned in today’s meeting. #3128 somewhat intentionally did not fix this since the error is returned from Apply. Since there is no obvious need for more reaction, I’d propose to log inbound upgrade errors on debug level in the above spot.

In the above code snippet, outbound upgrade errors lead to closing the connection. I’m not sure whether that is the best possible response given that many protocols may be composed and thus the escalation’s scope seems too large.

@thomaseizinger
Copy link
Contributor

Agree with all your points!

Related: #2894

@mxinden
Copy link
Member

mxinden commented Dec 30, 2022

I’d propose to log inbound upgrade errors on debug level in the above spot.

Sounds good to me.

In the above code snippet, outbound upgrade errors lead to closing the connection. I’m not sure whether that is the best possible response given that many protocols may be composed and thus the escalation’s scope seems too large.

Agreed. Setting its keep_alive to False should be enough.

In my eyes #2894 would reduce some of the error handling complexity in most ConnectionHandler implementations.

@mxinden mxinden added bug priority:important The changes needed are critical for libp2p, or are blocking another project difficulty:easy help wanted labels Dec 30, 2022
@mergify mergify bot closed this as completed in #3577 Mar 13, 2023
mergify bot pushed a commit that referenced this issue Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug difficulty:easy help wanted priority:important The changes needed are critical for libp2p, or are blocking another project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants