Skip to content

fix(channels): preserve busy drivers on clear or remove timeout - #5493

Merged
zackees merged 1 commit into
masterfrom
fix/channel-manager-busy-clear-remove
Dec 3, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/channel-manager-busy-clear-remove

Conversation

@zackees

@zackees zackees commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #5356 / #5492 (item #3).

  • ChannelManager::clearAllDrivers() previously called waitForReady() and ignored its return value, clearing and potentially destroying drivers whose DMA transfers timed out. It now returns early on timeout so active drivers remain registered until the caller retries.
  • ChannelManager::removeDriver() previously removed drivers without waiting for active transfers to finish. It now waits for driver->waitForReady(), re-scans mDrivers after task pumping, and returns false on timeout while keeping the busy driver registered.

Verification

  • bash lint src/fl/channels/manager.cpp.hpp src/fl/channels/manager.h tests/unit/fl/channels/manager.cpp — passed
  • bash test manager --debug (ASAN/LSAN/UBSAN) — passed (including new clear-timeout and remove-timeout regression tests)
  • bash test channel --debug — passed

Summary by CodeRabbit

  • Bug Fixes
    • Driver removal and clearing now wait for drivers to become ready. If a driver does not become ready within one second, it remains registered, and the operation can be retried once the driver is ready.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review.

Walkthrough

Driver removal and clearing now retain registered drivers when readiness waits time out. The documentation describes the timeout behavior, and tests verify that both operations succeed after the driver becomes READY.

Changes: Driver readiness checks

Layer / File(s) Summary
Readiness checks and registry retention
src/fl/channels/manager.cpp.hpp, src/fl/channels/manager.h, tests/unit/fl/channels/manager.cpp
removeDriver() checks that the driver is registered, waits for readiness, and re-scans before removal. clearAllDrivers() stops if waitForReady() fails. Documentation and tests cover timeout retention and retry after the driver becomes READY.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to cd70a

Removing or clearing a busy driver now leaves it registered and returns early, so it can be retried once the driver is ready. Tests cover both operations. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: busy drivers are kept registered when clearAllDrivers or removeDriver hits a readiness timeout. The raw summary and objectives describe exactly this behavior change in…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: busy drivers are kept registered when clearAllDrivers or removeDriver hits a readiness timeout. The raw summary and objectives describe exactly this behavior change in ChannelManager, with matching doc and test updates. The title uses the conventional fix(scope) form and is specific enough for a teammate scanning history.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between bc3caab and cd70a29.

Files selected for processing: 3

  • src/fl/channels/manager.cpp.hpp
  • src/fl/channels/manager.h
  • tests/unit/fl/channels/manager.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Memory usage (this PR vs. its merge base)

Change in examples/Blink per target. The left number is this PR's image flash / attributed RAM in bytes; the colored delta is the change from the merge base (red ↑ is larger, green ↓ is smaller, Same is unchanged).

Target FLASH [bytes] RAM [bytes]
attiny85 2,460 (Same) 136 (Same)

@zackees
zackees added this pull request to the merge queue Dec 3, 2026
Merged via the queue into master with commit 87f2c50 Dec 3, 2026
133 checks passed
@zackees
zackees deleted the fix/channel-manager-busy-clear-remove branch December 3, 2026 03:01
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