fix: don't log warn/errors on connection close after a legit close #123
No reviewers
Labels
No labels
breaking-change
bug
dependencies
duplicate
enhancement
go
good first issue
help wanted
invalid
investigation
proposal
proposal-accepted
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nemith/netconf!123
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "brb/push-owvyzmtwlyxz"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I have been putting this off but this will silence errors when the user closes the connection and will only log on unexpected transport closes.
This also moved closing to a atomic.Bool to be a bit cleaner and have less lock contention. Probably doesn't matter.
Pull request overview
This PR improves error logging during connection closure by suppressing warnings and errors when a session is closed gracefully. The implementation changes the
closingfield from a mutex-protected boolean to anatomic.Boolfor cleaner concurrency control and reduced lock contention.Key Changes:
closing boolwithatomic.Boolto eliminate mutex overhead for the closing flagrecvLoop()to suppress error logging when the connection is closed intentionally or receives an EOFClose()method to use atomic store operation instead of mutex-protected writeReviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The coverage.out file appears to be a generated test coverage artifact that should not be committed to the repository. Consider adding it to .gitignore (note that .gitignore already contains cover.out, but not coverage.out). Generated files like test coverage reports should typically be excluded from version control.