Repository navigation
fix: log websocket session termination at Warn level during reconnection cycles in Client.Run - #187
Open
nudgebee-dev[bot] wants to merge 1 commit into
Open
nudgebee-dev[bot] wants to merge 1 commit into
nudgebee-dev[bot] wants to merge 1 commit into
Conversation
Downgrade the log level from Error to Warn when a WebSocket session ends in Client.Run. Since Client.Run handles automatic reconnections via exponential backoff, transient network drops and routine session resets are recoverable events. Logging them at Error triggers false-positive alerts on error log metrics.
nudgebee-dev
Bot
force-pushed
the
fix/log-websocket-session-termination-warn-1793985320
branch
from
November 6, 2026 18:12
3901125 to
4102d1e
Compare
Author
Nudgebee Automated FollowupResolved CI vuln check failure by updating github.com/andybalholm/brotli to v1.2.7 and github.com/klauspost/compress to v1.20.2 in go.mod and go.sum. Verified govulncheck and tests pass cleanly, then amended and pushed the commit to origin/fix/log-websocket-session-termination-warn-1793985320. Commit: |
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.
Description
In
pkg/ws/client.gowithinClient.Run, transient WebSocket session disconnects and connection terminations are logged atErrorlevel usingc.logger.Error("websocket session ended", "err", err). BecauseClient.Runautomatically manages reconnections via exponential backoff, transient network drops and routine session resets are recoverable events rather than fatal errors. Logging them asErrortriggers false-positive alerts by incrementingcontainer_log_messages_total{level="error"}. Changing this log statement toc.logger.Warn("websocket session ended", "err", err)appropriately categorizes transient disconnects while maintaining observability during reconnection loops.Type of change
Original Error/Logs
Click to expand the original error that triggered this fix
err := c.connectAndServe(ctx)
if err != nil {
c.logger.Error("websocket session ended", "err", err)
}
_, msg, err := conn.ReadMessage()
if err != nil {
if websocket.IsCloseError(err, websocket.CloseNormalClosure, websocket.CloseGoingAway) {
return nil
}
return fmt.Errorf("read error: %w", err)
}
How Has This Been Tested?
Checklist
make validatepasses (fmt + lint + test)🤖 This PR was automatically generated by NudgeBee AI coding agent
Powered by AI-driven code analysis and automated fix generation
🔍 View Original Investigation
Click the link above to see the full investigation and analysis that led to this fix
View Detailed Nubi Conversation
✅ Verification
Build verification passed for the affected modules.
Commands run