Skip to content

Conversation

@CBenoit
Copy link
Member

@CBenoit CBenoit commented Dec 12, 2025

Reduces log noise by treating common socket disconnections (BrokenPipe, ConnectionReset, UnexpectedEof) as benign events during HTTP/HTTPS serving and TLS handshake. These disconnects typically occur from health checks, port scanners, aborted browser requests, or early connection termination, and do not indicate server faults.

ERROR logs now only appear for genuine server issues, making it easier to identify actionable problems in production deployments.

Issue: DGW-319

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request reduces log noise by downgrading benign client disconnect errors from ERROR to DEBUG level in the Devolutions Gateway. The changes specifically target common socket disconnections (BrokenPipe, ConnectionReset, UnexpectedEof) that typically occur from health checks, port scanners, aborted browser requests, or early connection termination - none of which indicate actual server faults.

Key Changes:

  • Added is_benign_disconnect() helper function to detect benign I/O errors in error chains
  • Enhanced handle_https_peer() to detect and log benign TLS handshake disconnects at DEBUG level
  • Enhanced handle_http_peer() to detect and log benign HTTP connection disconnects at DEBUG level

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
testsuite/tests/cli/dgw/mod.rs Adds the new benign_disconnect test module to the test suite
testsuite/tests/cli/dgw/benign_disconnect.rs Implements integration tests verifying that benign HTTP disconnects (connect-and-close, partial requests) are logged at DEBUG instead of ERROR
devolutions-gateway/src/listener.rs Implements benign disconnect detection via is_benign_disconnect() helper and applies it in both TLS handshake and HTTP serving error paths to downgrade benign errors from ERROR to DEBUG

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Reduces log noise by treating common socket disconnections (BrokenPipe,
ConnectionReset, UnexpectedEof) as benign events during HTTP/HTTPS
serving and TLS handshake. These disconnects typically occur from health
checks, port scanners, aborted browser requests, or early connection
termination, and do not indicate server faults.

ERROR logs now only appear for genuine server issues, making it easier
to identify actionable problems in production deployments.

Issue: DGW-319
@CBenoit CBenoit enabled auto-merge (squash) December 19, 2025 14:26
@CBenoit CBenoit merged commit 592da4d into master Dec 19, 2025
40 checks passed
@CBenoit CBenoit deleted the DGW-319 branch December 19, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants