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(iroh-net): do not log as error if client disconnects from relay #2259

Merged
merged 1 commit into from
May 2, 2024

Conversation

Frando
Copy link
Member

@Frando Frando commented May 2, 2024

Description

In the relay server, we currently log all connection failures with error severity. This means that whenever a node disconnects while still in the TLS handshaking phase, we get an error log.:

2024-05-02T09:00:38.443215Z ERROR relay server{me=svfacrfjgmv7fjeu}:relay-http-serve:conn{peer=127.0.0.1:33596}: iroh_net::relay::http::server: [HTTPS] relay: failed to handl
e connection: TLS[manual] accept

This however is a perfectly fine thing, a node may decide to abort the connection to a relay whenever it pleases. Especially in tests we often shutdown while still in the process of connecting to a relay. This is annoying, because the error severity indicates things being wrong (especially with the stack traces we print on error logs in the CI).

This PR checks if the error is a EOF and if so only prints it as a debug log.

Breaking Changes

Notes & open questions

Change checklist

  • Self-review.

@Frando Frando force-pushed the fix/iroh-net-relay-logging-eof branch from 0927e85 to 580cf33 Compare May 2, 2024 09:39
@Frando Frando added this pull request to the merge queue May 2, 2024
Merged via the queue into main with commit cdedc43 May 2, 2024
21 checks passed
Frando added a commit that referenced this pull request May 2, 2024
…2259)

## Description

In the relay server, we currently log all connection failures with
`error` severity. This means that whenever a node disconnects while
still in the TLS handshaking phase, we get an error log.:

```
2024-05-02T09:00:38.443215Z ERROR relay server{me=svfacrfjgmv7fjeu}:relay-http-serve:conn{peer=127.0.0.1:33596}: iroh_net::relay::http::server: [HTTPS] relay: failed to handl
e connection: TLS[manual] accept
```

This however is a perfectly fine thing, a node may decide to abort the
connection to a relay whenever it pleases. Especially in tests we often
shutdown while still in the process of connecting to a relay. This is
annoying, because the `error` severity indicates things being wrong
(especially with the stack traces we print on error logs in the CI).

This PR checks if the error is a EOF and if so only prints it as a debug
log.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants