Repository navigation
flood: snapshot the USB bus in the ENODEV hint - #18
Merged
Merged
Conversation
ble-flood's ENODEV message already told whoever reads it to check `ls /sys/class/bluetooth` on the host, but that host console isn't reachable from where a HIL pipeline's log is captured, and ENODEV covers two different faults: the dongle fell off the USB bus entirely (power/cable/hub - rack work) or it is still enumerated and only btusb's binding is gone (a driver problem). Nothing in the CI log told those two apart. Add _usb_snapshot(), a one-line-per-device read of /sys/bus/usb/devices, and fold it into the ENODEV hint so the next "No such device" failure carries that evidence in the captured step log instead of needing bench SSH to tell which fault it is. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
Context
ESPA-486 tracks a regression on top of the ESPA-217 fix (#1/#2/#3/#9/#13):
ble-floodnow fails instantly on bind withENODEV("No such device") instead of the oldEBUSY("Device or resource busy"). Seen on ESPresense/ESPresense#2631's HIL pipeline 1867, on both the original run and a rerun-step retry a few minutes later — not a transient race, hci0 is just gone at the moment the container starts.open_adapter()already fails ENODEV immediately (it's not in the EBUSY retry set — correct, no amount of waiting grants a missing device), and_bind_hint()already names the two config-level causes (no adapter / wrong netns). That part isn't broken. What's missing is evidence for the host-level cause: is the USB dongle gone from the bus entirely (power/cable/hub — rack work), or still enumerated with only the kernel'sbtusbbinding gone (a driver problem)? Nobody has bench SSH on this task (same limit as ESPA-217), and the CI log is the only artifact anyone can see.Change
Add
_usb_snapshot()— a one-line-per-device read of/sys/bus/usb/devices(vendor:product + label, pure stdlib, no new deps, matching this repo's existing_rfkill_statepattern) — and fold it into theENODEVbranch of_bind_hint(). The next time this fires, the capturedble-floodstep log carries the USB topology at failure time instead of requiring someone with bench access to go look.Selftest covers: empty bus, a populated bus (device vs. interface entries), an unreadable root, and that the snapshot text actually rides along in the
ENODEVhint.Not fixed here
The actual host-level cause (why hci0 vanished) still needs whoever has physical/SSH access to the HIL bench — this PR only makes the next occurrence self-diagnosing from the CI log. Tracked on ESPA-486.