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

Merged
merged 15 commits into from
Mar 26, 2025
Merged

Application-level retries #668

merged 15 commits into from
Mar 26, 2025

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

All modified and coverable lines are covered by tests ✅

Project coverage is 99.21%. Comparing base (bdb7374) to head (32d7c7c).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #668      +/-   ##
==========================================
- Coverage   99.21%   99.21%   -0.01%     
==========================================
  Files          51       51              
  Lines        3695     3691       -4     
==========================================
- Hits         3666     3662       -4     
  Misses         29       29              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@puddly puddly marked this pull request as ready for review March 26, 2025 01:55
@puddly puddly merged commit 1f61e0b into zigpy:dev Mar 26, 2025
14 checks passed
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