Fail the fio job instead of exiting the process on a client error #202

Open
koolkhel wants to merge 2 commits from koolkhel/vitastor:fio-no-exit-on-error into master
Contributor

Description

The fio engine left client_exit_on_error at its default, so a fatal client error at start (for example an invalid osd_network mask in the global etcd config) called exit() inside the fio job, and fio then crashed (SIGSEGV or a fio_sem_down assertion, depending on the fio version). Disable the exit like the QEMU driver does and fail the job's setup with the client's error.

An aborted client still accepted new ops and never completed them: continue_rw() returns at once when the client is aborted, so a job without -image (-pool/-inode) hung on its first I/O once the exit was disabled. Fail ops on an aborted client with ECANCELED, including the ones still waiting for PGs when the error comes, because an error that stops the PG load would leave them waiting forever. Clients that keep client_exit_on_error at its default exit before aborted is set, so they don't reach the new code.

A fatal error after the job has started no longer exits fio either. Ops already in progress then never complete (continue_rw() returns at once), so the second commit makes getevents return EIO once the client has failed and nothing it waits for has completed, and fio ends the job with an error instead of waiting forever.

Found: seen in a run on a test cluster: fio -ioengine=libfio_vitastor.so -image=... -rw=read -bs=4k -size=4M with "osd_network": "10.0.0.0/33" in /vitastor/config/global crashed 5 times out of 5 after printing Error: Invalid IP address mask: 10.0.0.0/33, exiting.

Tested: test_cluster_client gets test_abort_before_ready (a write queued before PGs are loaded must fail with ECANCELED on a fatal error), which fails on master. On a 3-OSD cluster with the invalid mask in the global config, fio with -image now exits with code 1 (io engine init failed ... Invalid IP address mask: 10.0.0.0/33), and fio with -pool -inode exits with code 1 on an ECANCELED I/O error. Without the client change, the -pool -inode job hangs. On master both jobs are killed by a signal. The getevents check is not covered by a test: a fatal error in the middle of a job (etcd cancelling the watch) is hard to provoke.

Contributor Name

Yury Luneff (MIND Software LLC, https://mindsw.io)

CLA

### Description The fio engine left `client_exit_on_error` at its default, so a fatal client error at start (for example an invalid `osd_network` mask in the global etcd config) called `exit()` inside the fio job, and fio then crashed (SIGSEGV or a `fio_sem_down` assertion, depending on the fio version). Disable the exit like the QEMU driver does and fail the job's setup with the client's error. An aborted client still accepted new ops and never completed them: `continue_rw()` returns at once when the client is aborted, so a job without `-image` (`-pool`/`-inode`) hung on its first I/O once the exit was disabled. Fail ops on an aborted client with ECANCELED, including the ones still waiting for PGs when the error comes, because an error that stops the PG load would leave them waiting forever. Clients that keep `client_exit_on_error` at its default exit before `aborted` is set, so they don't reach the new code. A fatal error after the job has started no longer exits fio either. Ops already in progress then never complete (`continue_rw()` returns at once), so the second commit makes `getevents` return EIO once the client has failed and nothing it waits for has completed, and fio ends the job with an error instead of waiting forever. Found: seen in a run on a test cluster: `fio -ioengine=libfio_vitastor.so -image=... -rw=read -bs=4k -size=4M` with `"osd_network": "10.0.0.0/33"` in `/vitastor/config/global` crashed 5 times out of 5 after printing `Error: Invalid IP address mask: 10.0.0.0/33, exiting`. Tested: `test_cluster_client` gets `test_abort_before_ready` (a write queued before PGs are loaded must fail with ECANCELED on a fatal error), which fails on master. On a 3-OSD cluster with the invalid mask in the global config, fio with `-image` now exits with code 1 (`io engine init failed ... Invalid IP address mask: 10.0.0.0/33`), and fio with `-pool -inode` exits with code 1 on an ECANCELED I/O error. Without the client change, the `-pool -inode` job hangs. On master both jobs are killed by a signal. The `getevents` check is not covered by a test: a fatal error in the middle of a job (etcd cancelling the watch) is hard to provoke. ### Contributor Name Yury Luneff (MIND Software LLC, https://mindsw.io) ### CLA - [x] I accept Vitastor CLA agreement: https://git.yourcmc.ru/vitalif/vitastor/src/branch/master/CLA-en.md
koolkhel added 1 commit 2026-11-29 12:40:03 +03:00
The fio engine left client_exit_on_error at its default, so a fatal client
error at start (for example an invalid osd_network mask in etcd) called
exit() inside the fio job, and fio then crashed. Disable the exit like the
QEMU driver does and fail the job's setup with the client's error.

An aborted client still accepted new ops and never completed them:
continue_rw() returns at once when the client is aborted, so a job without
-image hung on its first I/O. Fail ops on an aborted client with ECANCELED,
including the ones still waiting for PGs when the error comes, because an
error that stops the PG load would leave them waiting forever.
koolkhel added 1 commit 2026-11-29 14:59:40 +03:00
Operations already sent to OSDs never complete on a failed client, so a
fatal error during the job (for example etcd cancelling the client's
watch) left fio waiting in getevents forever now that the client no
longer exits. Return EIO from getevents when the client has failed and
nothing it waits for has completed.
This pull request has changes conflicting with the target branch.
  • src/test/test_cluster_client.cpp
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u fio-no-exit-on-error:koolkhel-fio-no-exit-on-error
git checkout koolkhel-fio-no-exit-on-error
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vitalif/vitastor#202
No description provided.