[PR #3067] [CLOSED] Handle H2 Unexpected EoF at debug level #3534

Closed
opened 2026-03-16 11:48:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/3067
Author: @jmwample
Created: 6/18/2025
Status: Closed

Base: mainHead: main


📝 Commits (1)

  • d2ecc07 handle Unexpected EoF at debug level as it is safe in h2

📊 Changes

1 file changed (+12 additions, -1 deletions)

View changed files

📝 crates/proto/src/h2/h2_client_stream.rs (+12 -1)

📄 Description

This PR reduces the h2 connection EoF logging from warning to debug -- other errors there still log at warning level.

Unexpected EoF is a (not-uncommon) way for DoH servers to close long-lived client connections. This connection close is not an error as the remote server sends a go-away message first. As described in the rustls manual it is safe to ignore EoF errors as long as message truncation is handled, which is the case in H2.

Closes #3064

Example logs from DoH resolver client using QUAD9

Before:

2025-06-17T21:03:08.934250Z DEBUG Connection{peer=Client}: h2::codec::framed_read: received frame=GoAway { error_code: NO_ERROR, last_stream_id: StreamId(3), debug_data: b"idle timeout" }
2025-06-17T21:03:08.934321Z DEBUG Connection{peer=Client}: h2::codec::framed_read: received frame=GoAway { error_code: NO_ERROR, last_stream_id: StreamId(3), debug_data: b"idle timeout" }
2025-06-17T21:03:08.934354Z DEBUG Connection{peer=Client}: h2::proto::connection: Connection::poll; IO error error=UnexpectedEof                        
2025-06-17T21:03:08.934461Z  WARN hickory_proto::h2::h2_client_stream: h2 connection failed: unexpected end of file

After:

2025-06-18T17:10:00.385240Z DEBUG Connection{peer=Client}: h2::codec::framed_read: received frame=GoAway { error_code: NO_ERROR, last_stream_id: StreamId(3), debug_data: b"idle timeout" }   
2025-06-18T17:10:00.385354Z DEBUG Connection{peer=Client}: h2::codec::framed_read: received frame=GoAway { error_code: NO_ERROR, last_stream_id: StreamId(3), debug_data: b"idle timeout" }   
2025-06-18T17:10:00.385408Z DEBUG Connection{peer=Client}: h2::proto::connection: Connection::poll; IO error error=UnexpectedEof                                                              
2025-06-18T17:10:00.385597Z DEBUG hickory_proto::h2::h2_client_stream: h2 connection closed by remote

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/3067 **Author:** [@jmwample](https://github.com/jmwample) **Created:** 6/18/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`d2ecc07`](https://github.com/hickory-dns/hickory-dns/commit/d2ecc070c013b8e811587e1c2b56459c79bea3d5) handle Unexpected EoF at debug level as it is safe in h2 ### 📊 Changes **1 file changed** (+12 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/proto/src/h2/h2_client_stream.rs` (+12 -1) </details> ### 📄 Description This PR reduces the h2 connection EoF logging from warning to debug -- other errors there still log at warning level. Unexpected EoF is a (not-uncommon) way for DoH servers to close long-lived client connections. This connection close is not an error as the remote server sends a `go-away` message first. As described in the [rustls manual](https://docs.rs/rustls/latest/rustls/manual/_03_howto/index.html#unexpected-eof) it is safe to ignore EoF errors as long as message truncation is handled, which is the case in H2. Closes #3064 Example logs from DoH resolver client using QUAD9 Before: ```log 2025-06-17T21:03:08.934250Z DEBUG Connection{peer=Client}: h2::codec::framed_read: received frame=GoAway { error_code: NO_ERROR, last_stream_id: StreamId(3), debug_data: b"idle timeout" } 2025-06-17T21:03:08.934321Z DEBUG Connection{peer=Client}: h2::codec::framed_read: received frame=GoAway { error_code: NO_ERROR, last_stream_id: StreamId(3), debug_data: b"idle timeout" } 2025-06-17T21:03:08.934354Z DEBUG Connection{peer=Client}: h2::proto::connection: Connection::poll; IO error error=UnexpectedEof 2025-06-17T21:03:08.934461Z WARN hickory_proto::h2::h2_client_stream: h2 connection failed: unexpected end of file ``` After: ``` 2025-06-18T17:10:00.385240Z DEBUG Connection{peer=Client}: h2::codec::framed_read: received frame=GoAway { error_code: NO_ERROR, last_stream_id: StreamId(3), debug_data: b"idle timeout" } 2025-06-18T17:10:00.385354Z DEBUG Connection{peer=Client}: h2::codec::framed_read: received frame=GoAway { error_code: NO_ERROR, last_stream_id: StreamId(3), debug_data: b"idle timeout" } 2025-06-18T17:10:00.385408Z DEBUG Connection{peer=Client}: h2::proto::connection: Connection::poll; IO error error=UnexpectedEof 2025-06-18T17:10:00.385597Z DEBUG hickory_proto::h2::h2_client_stream: h2 connection closed by remote ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:48:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#3534
No description provided.