chan_simpleusb, chan_usbradio: nonblocking pttkick pipe.#1051
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughBoth USB channel driver implementations update their HID thread initialization to create the PTT kick pipe using ChangesPTT Pipe Non-blocking I/O
🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@channels/chan_simpleusb.c`:
- Line 1112: The pttkick pipe is opened non-blocking (pipe2(o->pttkick,
O_NONBLOCK)) but both kickptt() (writer) and the pttkick read handler treat res
<= 0 as fatal; change both to ignore expected non-blocking conditions by
checking errno: in kickptt() when write returns -1, if errno is EAGAIN or
EWOULDBLOCK simply return/skip without logging an error, and in the pttkick read
handler (around the current read at ~line 1161) when read returns -1, if errno
is EAGAIN or EWOULDBLOCK do not treat it as an error (just return/continue);
keep other error/EOF handling unchanged.
In `@channels/chan_usbradio.c`:
- Line 1084: The non-blocking pipe created with pipe2(o->pttkick, O_NONBLOCK)
requires kickptt() to treat EAGAIN/EWOULDBLOCK as benign backpressure rather
than a hard error; update the write() error handling inside kickptt() to check
errno and only log/handle true failures, while silently ignoring or returning
success on errno == EAGAIN || errno == EWOULDBLOCK (and keep existing handling
for other errno values), and ensure the code references o->pttkick and the
kickptt() function when making this change so the non-blocking behavior is
correctly honored.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8580ecba-15ce-4e68-8639-2d8e3cbe5a0e
📒 Files selected for processing (2)
channels/chan_simpleusb.cchannels/chan_usbradio.c
|
We "could" block on the write side if something slows down the read side. Since we are polling, we really should never fail to read in the |
Summary by CodeRabbit