fix(connection): log routine event connection loss at DEBUG - #45
Open
GreenGrassBlueOcean wants to merge 1 commit into
Open
GreenGrassBlueOcean wants to merge 1 commit into
GreenGrassBlueOcean wants to merge 1 commit into
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
fedem95
reviewed
Sep 20, 2026
fedem95
left a comment
Contributor
There was a problem hiding this comment.
Confirmed on my physical MH201 (b13 + OWNd b8, running for 30 h): 30 event session drops, all recovered, zero "Reconnection failed" and zero availability warnings downstream. The demotion is justified.
On my hardware the reconnect occurs every ~57 min 40s.
Two suggestions for this PR:
- a flapping session is now completely silent as long as each reconnect succeeds. Until we know the per-model cadence, a burst rule would be model-agnostic: warn when drops cluster, say three within ten minutes, then at most once an hour.
asyncio.LimitOverrunErrorshares this except block. An over-long or garbage frame is not a routine session recycle; hiding it at DEBUG loses a real protocol signal. I would keep that one at WARNING.
Failure paths still log properly (Event session not connected + Reconnection failed), tests pass locally and CI is green.
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.
Summary
Follows up on real-world testing feedback from @marcob79 in OpenWebNet-HA/MyHOME#304.
In
OWNEventSession.get_next(), when a socket EOF (asyncio.IncompleteReadError) or connection drop (ConnectionResetError,OSError) occurs:WARNINGlevel:WARNINGlevel, downstream consumers like Home Assistant surfaced an alarming warning banner in Settings → System → Logs every hour on the hour, leading users to believe the connection was unhealthy or unstable.This PR demotes the routine disconnect log to
DEBUG.Failure Behavior
Actual failure conditions remain fully reported:
_reconnect()fails, line 1106 already logs atWARNING:Changes
OWNd/connection.py: Log routine event session connection loss atDEBUGinstead ofWARNING.tests/test_connection.py: Addedtest_event_connection_loss_is_logged_at_debugassertinglogger.debugis invoked andlogger.warningis not called on connection loss.