Bug 1925345
| Summary: | qemu-nbd needs larger backlog for Unix socket listen() | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Eric Blake <eblake> |
| Component: | qemu-kvm | Assignee: | Eric Blake <eblake> |
| qemu-kvm sub component: | NBD | QA Contact: | zixchen |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | high | ||
| Priority: | high | CC: | coli, eblake, jinzhao, juzhang, juzhou, minlei, mtessun, mxie, rjones, tyan, tzheng, virt-maint, xiaodwan, ymankad, zili |
| Version: | 8.4 | Keywords: | Triaged |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | 8.4 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | qemu-kvm-5.2.0-9.module+el8.4.0+10182+4161bd91 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1925045 | Environment: | |
| Last Closed: | 2021-05-25 06:47:28 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1901441 | ||
|
Description
Eric Blake
2021-02-04 22:27:14 UTC
Upstream patch proposed: https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg01843.html Checked with qemu-img-4.2.0-42.module+el8.4.0+9559+d618a2c8.x86_64 as well, can reproduce this issue, do we need a copy to slow train? Should this be RHEL AV, not RHEL? I'm not sure how much we care about this issue in RHEL since the layered products that might hit it are all using RHEL AV. Definitely RHEL AV; and probably worth consideration for 8.3 z-stream rather than just waiting for 8.4, as it is easy to demonstrate its impact on external clients. Whether we also want RHEL is a judgment call (the problem has been present for a long time, but it has only recently become apparent as we finally have more NBD clients willing to try parallel connections and running into the server issue). And it wouldn't be the first time that I've opened a bug with the wrong product selected, so moving it to whatever we decide is the right one is fine by me. (In reply to Eric Blake from comment #0) > $ touch /tmp/disk.img > $ truncate -s 10M /tmp/disk.img > $ rm /tmp/sock > $ qemu-nbd -t -k /tmp/sock -f raw /tmp/disk.img Note that by default, the NBD server created by the nbd-server-start QMP command in qemu allows unlimited clients, while the server created by qemu-nbd defaults to allowing only the first successful client unless you use -e (--shared) with 0 for unlimited or a value larger than 1. There is an interesting trade-off to be made: if the server is going to reject all subsequent clients anyways, specifying a larger SOMAXCONN only means that rogue unsuccessful clients that attempt to connect() first will not cause EAGAIN errors on the actual client that we expect to connect(); but if you have rogue clients competing for the connection, you already have other problems to worry about. On the other hand, if you run: qemu-nbd -t -e 100 -k /tmp/sock -f raw /tmp/disk.img then it you ABSOLUTELY want to be able to connect 100 simultaneous clients without EAGAIN stalls. But the other factor here is -t: when -t is not present, qemu-nbd will be going away after the first client. But when -t is used even without -e, later clients are permitted (only one at once, but the later ones will eventually get their chance), so in that scenario we also want SOMAXCONN rather than paying attention to -e. > > Patch posted: > https://www.redhat.com/archives/libguestfs/2021-February/msg00015.html So another version of this patch will be going upstream soon based on those observations. Test with qemu-kvm-5.2.0-8.el8.eblake202102221522.x86_64, no issue found.
Test steps:
1. Export with # qemu-nbd -t -k /tmp/sock -f raw /tmp/disk.img
Repeat 10 times with # nbdsh -c 'h.connect_unix("/tmp/sock")' &, no issue found.
2. Export with # qemu-nbd -e 3 -k /tmp/sock -f raw /tmp/disk.img
After executing "nbdsh -c 'h.connect_unix("/tmp/sock")' & " for 4 times, the 6th execution failed with
nbdsh: command line script failed: nbd_connect_unix: connect: server backlog overflowed, see https://bugzilla.redhat.com/1925045: Resource temporarily unavailable
Test with qemu-kvm-5.2.0-9.module+el8.4.0+10182+4161bd91.x86_64, no issue found, so change status to verified.
Version:
qemu-kvm-5.2.0-9.module+el8.4.0+10182+4161bd91.x86_64
kernel-4.18.0-291.el8.x86_64
Steps anf result:
1.# touch /tmp/disk.img
2.# truncate -s 10M /tmp/disk.img
3.# rm /tmp/sock
4.# qemu-nbd -e 3 -k /tmp/sock -f raw /tmp/disk.img
^Z
[4]+ Stopped qemu-nbd -e 3 -k /tmp/sock -f raw /tmp/disk.img
5. # nbdsh -c 'h.connect_unix("/tmp/sock")' &
[5] 88578
# nbdsh -c 'h.connect_unix("/tmp/sock")' &
[6] 88580
# nbdsh -c 'h.connect_unix("/tmp/sock")' &
[7] 88582
# nbdsh -c 'h.connect_unix("/tmp/sock")' &
[8] 88584
# nbdsh -c 'h.connect_unix("/tmp/sock")' &
[9] 88586
# nbdsh: command line script failed: nbd_connect_unix: connect: server backlog overflowed, see https://bugzilla.redhat.com/1925045: Resource temporarily unavailable
6. kill export image,
# qemu-nbd -t -k /tmp/sock -f raw /tmp/disk.img
^Z
[1]+ Stopped qemu-nbd -t -k /tmp/sock -f raw /tmp/disk.img
7. repeat 10 times connect to the image.
# nbdsh -c 'h.connect_unix("/tmp/sock")' &
[4] 88533
...
# nbdsh -c 'h.connect_unix("/tmp/sock")' &
[14] 88553
Expected result:
Same as actual result.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (virt:av bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:2098 |