• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xapi-project / xen-api / 11323714919

14 Oct 2024 08:23AM UTC coverage: 78.273% (-0.006%) from 78.279%
11323714919

push

github

web-flow
CA-392674: nbd_client_manager retry connect on nbd device busy (#6021)

to connect to nbd devices, nbd_client_manager will
1. protect the operation with /var/run/nonpersistent/nbd_client_manager
file lock
2. check whether nbd is being used by `nbd-client -check`
3. load nbd kernel module by `modprobe nbd`
4. call `nbd-client` to connect to nbd device

However, step 3 will trigger systemd-udevd run asyncly, which would open
and lock the same nbd devices, run udev rules, etc. This introduce races
with step 4, e.g. both process want to open and lock the nbd device.

Note: the file lock in step 1 does NOT resovle the issue here, as it
only coordinate multiple nbd_client_manager processes.

To fix the issue,
- we patch nbd-client to report the device busy from kernel to
nbd_client_manager
- nbd_client_manager should check nbd-client exit code, and retry on
device busy

14 of 16 new or added lines in 2 files covered. (87.5%)

3462 of 4423 relevant lines covered (78.27%)

0.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.05
/python3/libexec/nbd_client_manager.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc