Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application-level retries #668

Draft
wants to merge 6 commits into
base: dev
Choose a base branch
from
Draft

Conversation

puddly
Copy link
Contributor

@puddly puddly commented Feb 3, 2025

This removes the EmberZNet APS_OPTION_RETRY flag and moves retries into zigpy. A simple patch to zigpy is required: zigpy/zigpy@dev...puddly:zigpy:puddly/application-level-retries

This will allow us to provide slightly more useful error codes (e.g. MAC_INDIRECT_TIMEOUT) and unblock the implicit transmit queue for each device, which can get blocked for 30+ seconds per request.

One issue with this type of introspection is that there genuinely aren't more status codes to return to the user: other than channel access failures or a missed APS ACK (which EmberZNet doesn't allow you to enable!), failures during delivery more or less are just that. Unless a routing device decides to broadcast a routing failure status (e.g. just MAC_INDIRECT_TIMEOUT), we really have no way to determine why an individual request failed like this. I'm working around this issue by just blindly assuming that status codes are received in the order the request was sent out. Realistically, I don't think it matters because two requests sent at the same time likely will both fail or both succeed.

I'm testing this change locally without any issues, even with intentionally disconnected devices (both mains-powered and battery-powered), so I think this approach may have promise.

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 90.38462% with 5 lines in your changes missing coverage. Please review.

Project coverage is 99.08%. Comparing base (bdb7374) to head (a0ab8c2).

Files with missing lines Patch % Lines
bellows/zigbee/application.py 90.38% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #668      +/-   ##
==========================================
- Coverage   99.21%   99.08%   -0.14%     
==========================================
  Files          51       51              
  Lines        3695     3716      +21     
==========================================
+ Hits         3666     3682      +16     
- Misses         29       34       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant