Skip to content

https_client: log recoverable connection errors at INFO instead of WARNING - #211

Closed
MrObvious wants to merge 3 commits into
aarond10:masterfrom
MrObvious:patch-2-log-levels
Closed

https_client: log recoverable connection errors at INFO instead of WARNING#211
MrObvious wants to merge 3 commits into
aarond10:masterfrom
MrObvious:patch-2-log-levels

Conversation

@MrObvious

Copy link
Copy Markdown
Contributor

Follow-up to #210 (reset-timer fix), submitted as a separate PR since this is a logging-policy question rather than a behavior fix and should not block the reset-timer fix if there is disagreement here. This branch is stacked on #210 (2 commits shown), so this diff will reduce to just the second commit once #210 merges.

CURLE_OPERATION_TIMEDOUT, CURLE_HTTP2, CURLE_HTTP2_STREAM, CURLE_GOT_NOTHING, and CURLE_SEND_ERROR are all connection-reuse hiccups that the reset-timer path (#210) already recovers from automatically without any user-visible impact. On resolvers whose edge cycles persistent connections periodically (observed with Quad9, not seen with Cloudflare), this is a routine, expected, self-healing condition - not a warning-worthy event - yet it was logged at WARNING twice per occurrence. On flash- and memory-constrained routers running at default verbosity, this produces a steady stream of log noise for a condition the proxy is already handling correctly on its own.

This logs the same information at INFO instead of WARNING specifically for the recoverable error codes above, matching the existing INFO-level "Client reset timer started" message already used for this recovery path. Genuinely unexpected failures are unchanged and still log at WARNING.

Tested on the same production router as #210 - confirmed curl-16 spam disappears from default-verbosity logs while the reset-timer recovery (and its own INFO-level messages, visible at raised verbosity) continues to function.

MrObvious and others added 3 commits July 29, 2026 16:19
…errors, not just timeouts

We saw recurring "curl request failed with 16: Error" (CURLE_HTTP2) and "curl request failed with 55: Error / Send failure: Broken pipe" (CURLE_SEND_ERROR) on a production OpenWrt router running two https-dns-proxy instances, even after tuning max_idle_time down to 30s. These are classic symptoms of curl reusing a stale/half-closed HTTP/2 connection - the same class of problem the existing reset_timer/https_client_reset mechanism was built to recover from, but that mechanism is currently only armed on CURLE_OPERATION_TIMEDOUT. HTTP/2 stream errors and send/recv errors on a reused connection never reach it, so the proxy keeps trying to reuse a bad connection indefinitely instead of forcing a fresh one.

This extends the existing case in https_fetch_ctx_process_response() to also arm the reset timer for CURLE_HTTP2, CURLE_HTTP2_STREAM, CURLE_GOT_NOTHING, and CURLE_SEND_ERROR - all indicators of a broken/stale connection rather than a one-off content error. No new mechanism is introduced; this only widens the set of error codes that trigger the recovery path that already exists.

Tested on a production OpenWrt router (two instances, Cloudflare + Quad9 backends) - confirmed the reset timer now arms and fires (full client reset) in response to these errors, where previously they were silently ignored.
…RNING

Follow-up to aarond10#210 (reset-timer fix). Submitted as a separate change since this is a logging-policy question rather than a behavior fix, and should not hold up the reset-timer fix if there is disagreement on log levels.

CURLE_OPERATION_TIMEDOUT, CURLE_HTTP2, CURLE_HTTP2_STREAM, CURLE_GOT_NOTHING, and CURLE_SEND_ERROR are all connection-reuse hiccups that the reset-timer path (see aarond10#210) already recovers from automatically without any user-visible impact. On resolvers whose edge cycles persistent connections periodically (observed with Quad9, not seen with Cloudflare), this is a routine, expected, self-healing condition - not a warning-worthy event - yet it was logged at WARNING twice per occurrence. On flash- and memory-constrained routers running at default verbosity, this produces a steady stream of log noise for a condition the proxy is already handling correctly on its own.

This logs the same information at INFO instead of WARNING specifically for the recoverable error codes above, matching the existing INFO-level "Client reset timer started" message already used for this recovery path. Genuinely unexpected failures are unchanged and still log at WARNING.

Tested on the same production router as aarond10#210 - confirmed curl-16 spam disappears from default-verbosity logs while the reset-timer recovery (and its own INFO-level messages, visible at raised verbosity) continues to function.
@aarond10 aarond10 closed this Jul 30, 2026
@aarond10

Copy link
Copy Markdown
Owner

Sorry. I pushed both these manually as I managed to bump something and added an unwanted merge to the PR.

@MrObvious

Copy link
Copy Markdown
Contributor Author

Ok thanks Aaron. So both changes did get merged? That’s all I care about. Appreciate the quick turnaround.

@aarond10

aarond10 commented Jul 31, 2026 via email

Copy link
Copy Markdown
Owner

@MrObvious

Copy link
Copy Markdown
Contributor Author

Thank you! To quote the kids these days, that’s bussin!

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.

2 participants