Skip to content

engine: wait for the device node, not just the sysfs serial - #79

Merged
CMGS merged 2 commits into
mainfrom
fix/volume-device-node-wait
Aug 13, 2026
Merged

engine: wait for the device node, not just the sysfs serial#79
CMGS merged 2 commits into
mainfrom
fix/volume-device-node-wait

Conversation

@CMGS

@CMGS CMGS commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #78.

The volume bring-up resolved the guest device by matching
/sys/block/<dev>/serial and returned /dev/<dev> immediately — but the
kernel publishes the sysfs entry before devtmpfs creates the node, so under
load the guest mount ran against a path that did not exist yet
("not a valid block device", exit 32). Measured on bare metal in the
PR #77 round: 5/141 four-volume claims (3.5%), zero single-volume; present
on main, amplified by concurrent bring-up.

findVolumeDevice now stats the device node over the existing silkd
fs_stat verb after the serial matches; a NotFound keeps polling under the
same probe budget and interval, any other error fails immediately — no new
wire surface, no new timeouts, no mount-retry semantics. The
wire-NotFound check the serial read already used is extracted into a shared
helper.

Tests: delayed-then-present node succeeds; never-appearing node times out
with the existing error shape; a non-NotFound stat error fails immediately.

Gates: build, engine race suite, dual-GOOS golangci-lint 0 issues, gofmt,
asl dual-GOOS clean. Soak acceptance per the issue (≥100 four-volume claims
zero spurious failures) rides the next hardware round.

CMGS added 2 commits August 13, 2026 13:19
The kernel publishes /sys/block before devtmpfs creates the node, so a
serial match could hand mount a path that does not exist yet — measured
at 3.5% of four-volume claims on bare metal.
@CMGS
CMGS merged commit a3be33b into main Aug 13, 2026
1 check passed
@CMGS
CMGS deleted the fix/volume-device-node-wait branch August 13, 2026 10:12
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.

engine: volume mount races devtmpfs — sysfs serial appears before the /dev node

1 participant