Repository navigation
Don't retry or warn on failed Poll Control check-in responses - #1905
Draft
zigpy-review-bot wants to merge 1 commit into
Draft
zigpy-review-bot wants to merge 1 commit into
zigpy-review-bot wants to merge 1 commit into
Conversation
A Poll Control server may go back to long polling 7.68s after checking in, so a check-in response that fails to send is not retried and the failure is logged at debug level instead of surfacing as a callback warning with a traceback.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1905 +/- ##
=======================================
Coverage 99.51% 99.51%
=======================================
Files 61 61
Lines 12773 12775 +2
=======================================
+ Hits 12711 12713 +2
Misses 62 62 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation preserves fast-poll behavior and is covered by appropriate regression tests.
0 open findings
What changed in this PR
Prevents redundant Poll Control check-in response retries and suppresses expected delivery failures.
Changes:
- Sends check-in responses once with
retries=0. - Logs delivery failures and timeouts at debug level.
- Adds unit and packet-level regression coverage.
| File | Description |
|---|---|
zigpy/device.py |
Consolidates response handling and suppresses expected failures. |
tests/test_device.py |
Verifies retry count, logging, and callback behavior. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Oct 12, 2026
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.
Proposed change
When the Check-in Response to a Poll Control check-in fails to send, it is no longer retried, and the failure is logged at debug level instead of escaping the callback.
Before this change, a failed response was sent 3 times (the 2 default retries forced route discovery), all at
CRITICALpriority, which bypasses the device and application request queues. Each check-in from a device that has stopped listening (e.g. one with a nearly dead battery) then ended with a WARNING and a full traceback from the callback wrapper inControllerApplication.The retries don't help here. Per ZCL 3.16.4.4, a Poll Control server that gets no Check-in Response within 7.68 s may return to long polling. A sleepy end device's parent holds an indirect frame for about that long before the send fails, so a retry arrives after the device has gone back to sleep. A dropped response is expected for such a device; it simply checks in again at its next interval. The OTA command handlers already log a failed reply at debug level.
The two
checkin_responsebranches are folded into one call; the fast-poll decision and its arguments are unchanged.Additional information
Closes #1804
Not addressed here:
CRITICALskips the queues. With the retries gone, each check-in now makes one send attempt from zigpy instead of three; radio libraries' own recovery (e.g. zigpy-znp retrying once after route discovery onNWK_NO_ROUTE) still applies.Tests
retries=0.DeliveryErrororTimeoutErrorfromcheckin_responseis logged at debug level and not raised.packet_received, whose response fails withAPS_NO_ACK, results in exactly one send and no "callback failed" warning. Without the fix this test sees 3 sends and the warning.Related: #1913