Hi Andriy,
This one line patch seems to fix the problem and has been applied to
the version 2.4 code.
diff --git a/src/srun/srun.c b/src/srun/srun.c
index cadbca1..ae31f92 100644
--- a/src/srun/srun.c
+++ b/src/srun/srun.c
@@ -1142,7 +1142,6 @@ _terminate_job_step(slurm_step_ctx_t *step_ctx)
Hello!
Our customers complaining about strange behavior when job started via
srun was ended with non-zero exit code:
==
$ srun sh -c "exit 2"
srun: error: node4-131-23: task 0: Exited with exit code 2
srun: Terminating jo