Skip to content

backend: exit non-zero when a job process is killed by a signal - #2129

Open
Vladyyy wants to merge 1 commit into
axboe:masterfrom
Vladyyy:reap-signaled-worker-exit-code
Open

backend: exit non-zero when a job process is killed by a signal#2129
Vladyyy wants to merge 1 commit into
axboe:masterfrom
Vladyyy:reap-signaled-worker-exit-code

Conversation

@Vladyyy

@Vladyyy Vladyyy commented Aug 6, 2026

Copy link
Copy Markdown

When a forked job process dies from a fatal signal (SIGABRT from a
failed assert(), SIGSEGV, OOM kill), reap_threads() logs
"fio: pid=..., got signal=..." and records td->sig, but never sets
td->error. The reaped: label only counts td->error into exit_value, so
the main fio process exits 0 and the job summary prints err= 0 for the
crashed job. The WIFEXITED branch right below does propagate a
non-zero exit status, so a worker that exits(1) fails the run while a
worker that crashes reports success, defeating any automation that
checks fio's exit code.

Mark an unexpectedly signaled worker as failed by setting td->error
(EINTR) next to the existing log_err. SIGTERM and SIGUSR2 stay
excluded, matching the log message: fio uses them for orderly
termination. Setting td->error rather than bumping exit_value directly
keeps the accounting in one place and makes the job summary show a
non-zero err for the crashed job.

Tested by sending SIGABRT to one worker of a two-job process-based
run: the crashed job now reports err= 4 and fio exits 1 (both were 0
before); a crash-free run still reports err= 0 for all jobs and
exits 0.

Fixes: #2127

Signed-off-by: Vlad Tudose tudosevt@amazon.com

When a forked job process dies from a fatal signal (SIGABRT from a
failed assert(), SIGSEGV, OOM kill), reap_threads() logs
"fio: pid=..., got signal=..." and records td->sig, but never sets
td->error. The reaped: label only counts td->error into exit_value, so
the main fio process exits 0 and the job summary prints err= 0 for the
crashed job. The WIFEXITED branch right below does propagate a
non-zero exit status, so a worker that exits(1) fails the run while a
worker that crashes reports success, defeating any automation that
checks fio's exit code.

Mark an unexpectedly signaled worker as failed by setting td->error
(EINTR) next to the existing log_err. SIGTERM and SIGUSR2 stay
excluded, matching the log message: fio uses them for orderly
termination. Setting td->error rather than bumping exit_value directly
keeps the accounting in one place and makes the job summary show a
non-zero err for the crashed job.

Tested by sending SIGABRT to one worker of a two-job process-based
run: the crashed job now reports err= 4 and fio exits 1 (both were 0
before); a crash-free run still reports err= 0 for all jobs and
exits 0.

Fixes: axboe#2127

Signed-off-by: Vlad Tudose <tudosevt@amazon.com>
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.

fio exits 0 when a job process is killed by a fatal signal

1 participant