Repository navigation
grpctunnel: log routine reconnects quietly, real failures at Warn/Error - #191
Draft
shawnburke wants to merge 1 commit into
Draft
shawnburke wants to merge 1 commit into
shawnburke wants to merge 1 commit into
Conversation
Audit of log levels across the tunnel agent and server. Lowered (routine events that arrive in batches or repeat): - agent "Tunnel slot stream ended": Info when the stream had been established, Warn only when it could not be opened - server "Tunnel stream closed" on transport error: Warn -> Info - BROKER_SERVER per-attempt retry: Warn -> Info (callers warn on exhaustion) - "Initial registration aborted" (shutdown only): Warn -> Info - "Registered with Cortex API": Info at startup, Debug on periodic refresh - "Call execution failed" on agent shutdown: Info - "Response body aborted mid-stream" with side=caller: Info - registry "Registered new client" / "Removed client entry": Debug (duplicated by "Agent instance connected/disconnected") Raised: - "Response body read failed mid-stream": same rule as execution failures (Error for an upstream error) - "Request completed" for a response that never reached CallEnd: Warn with aborted=true - BROKER_SERVER client-connected retry: Error once backoff is at its cap Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This is an audit of every log call in the gRPC tunnel agent (
agent/server/grpctunnel) and server (server/tunnel,server/dispatch,server/adapters,server/broker,server/cmd).Dispatch failures are already logged at Warn on main (
failureLevel, #186). The main problem the audit found is the opposite: routine events are too loud. A server restart, a load balancer reset or the 24h connection limit ends every stream on a connection at once. Today that produces one Warn per stream on the agent and on the server, which hides the warnings that matter.Lowered
Tunnel slot stream ended; will retryestablishedfield.Tunnel stream closed(transport error)BROKER_SERVER request failed; will retry(per attempt)Initial registration aborted(only happens on shutdown)Registered with Cortex APICall execution failedwith causeAGENT_SHUTDOWNResponse body aborted mid-streamwithside=callerside=tunnelstays Warn)Registered new client/Removed client entryAgent instance connected/disconnected, which carry more fields.Raised
Response body read failed mid-streamCall execution failed(sharedcallFailureLevel): Error for an upstream error, Warn for a server cancel or timeout, Info on shutdownRequest completedfor a response that never reached CallEndaborted=true. The message is unchanged so existing queries still match.BROKER_SERVER client-connected exhausted retriestokenHash.Not changed (deliberately)
Heartbeat timeouts, the stream-cap rejection, protocol violations (duplicate hello, call_id or CallStart; End before Start), invalid
:status, TLS/credential errors, and thefailureLevellevels for dispatch failures.Testing
go test ./server/grpctunnel/(agent) andgo test ./...(server) pass.TestManageStream_BackoffResetsAfterEstablishedStreamnow also checks the levels: three Warns for the failed opens, then Info for the dropped established stream.TestCallFailureLevel.🤖 Generated with Claude Code