On 10/15/26 23:46, Eric Blake wrote:
On Fri, Sep 25, 2026 at 05:53:46PM +0200, Guillaume Vincke wrote:
Test the connect thread starting condition with reconnect-delay=0 when
the server disconnects after a successful handshake but before running
operations. Prior to the change to nbd_co_establish_connection(), this
test would demonstrate two I/O errors. The tests 264 and 277 covering
reconnection do not use reconnect-delay=0 so this case is not exercised.
Add a test that provokes multiple errors in order to put an NBD client
in the above-mentioned situation and shows that the first operation
starts the connect thread and leads to successful subsequent I/O.
Signed-off-by: Guillaume Vincke <[email protected]>
Guillaume, this is passing for me locally but failing under CI:
https://gitlab.com/qemu-project/qemu/-/jobs/17192659287
▶ 137/150 qcow2 nbd-stale-connection
FAIL
137/150 block-qcow2-optional+block-slow - qemu:io-qcow2-nbd-stale-connection
FAIL 2.39s exit status 1
ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1
PYTHON=/builds/qemu-project/qemu/build/pyvenv/bin/python3.12 MALLOC_PERTURB_=65
MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1
LD_LIBRARY_PATH=/builds/qemu-project/qemu/build/subprojects/libvfio-user/lib
RUST_BACKTRACE=1 MESON_TEST_ITERATION=1
UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1
/builds/qemu-project/qemu/build/pyvenv/bin/python3.12
/builds/qemu-project/qemu/build/../tests/qemu-iotests/check -tap -qcow2
nbd-stale-connection --source-dir /builds/qemu-project/qemu/tests/qemu-iotests
--build-dir /builds/qemu-project/qemu/build/tests/qemu-iotests
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
WARNING: iotests is being run from outside of the configure-time python virtual
environment
current python: /builds/qemu-project/qemu/build/pyvenv/bin/python3.12
pyvenv python: /builds/qemu-project/qemu/build/pyvenv/bin/python3
Individual python tests will be executed inside the pyvenv,
but the test runner will continue to run outside.
Please use the meson run script:
/builds/qemu-project/qemu/build/run
/builds/qemu-project/qemu/build/../tests/qemu-iotests/check -tap -qcow2
nbd-stale-connection --source-dir /builds/qemu-project/qemu/tests/qemu-iotests
--build-dir /builds/qemu-project/qemu/build/tests/qemu-iotests
--- /builds/qemu-project/qemu/tests/qemu-iotests/tests/nbd-stale-connection.out
+++
/builds/qemu-project/qemu/build/scratch/qcow2-file-nbd-stale-connection/nbd-stale-connection.out.bad
@@ -13,5 +13,5 @@
=== NBD server up. Restart the connect thread ===
{"error": {"class": "GenericError", "desc": "write failed: Input/output
error"}}
=== Wait for the connect thread to park the new channel. Subsequent
operations are successful ===
-{"return": {}}
+{"error": {"class": "GenericError", "desc": "write failed: Input/output
error"}}
Kill NBD server
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Can you take a look? I'm also playing with it, but I may revert your
series from my current pull request if it takes too long to get to
root cause.
The failure comes from the parking step. I reproduced the exact CI diff
locally by shortening the test's wait for the parked channel to a value
around 950ms. The test only leaves 500ms for the reconnection which
appears to be too small on CI.
Starting the connect thread after the NBD server is up removes the
dependency on the 1s retry, so the wait only has to cover the
connection itself. That allows raising it to 1s while keeping the same
test duration. The test still fails without patch 1.
I have sent a v2 with that change:
https://lore.kernel.org/qemu-devel/[email protected]