diff options
author | Fujii Masao <fujii@postgresql.org> | 2021-09-29 21:01:10 +0900 |
---|---|---|
committer | Fujii Masao <fujii@postgresql.org> | 2021-09-29 21:49:36 +0900 |
commit | 8cf4f7118596a2a3f5b51c04f73f1a06b4e363da (patch) | |
tree | f3423e34106265406631260c39d7670c2aeaa15c | |
parent | 3cc85d7d5353945bf5bdb26bb7771f40aeacaf0b (diff) | |
download | postgresql-8cf4f7118596a2a3f5b51c04f73f1a06b4e363da.tar.gz postgresql-8cf4f7118596a2a3f5b51c04f73f1a06b4e363da.zip |
pgbench: Fix handling of socket errors during benchmark.
Previously socket errors such as invalid socket or socket wait method failures
during benchmark caused pgbench to exit with status 0. Instead, errors during
the run should result in exit status 2.
Back-patch to v12 where pgbench started reporting exit status.
Original complaint and patch by Hayato Kuroda.
Author: Yugo Nagata, Fabien COELHO
Reviewed-by: Kyotaro Horiguchi, Fujii Masao
Discussion: https://postgr.es/m/TYCPR01MB5870057375ACA8A73099C649F5349@TYCPR01MB5870.jpnprd01.prod.outlook.com
-rw-r--r-- | src/bin/pgbench/pgbench.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 156348acfd7..bf5b8b7d3ef 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -6199,7 +6199,7 @@ main(int argc, char **argv) #endif /* ENABLE_THREAD_SAFETY */ for (int j = 0; j < thread->nstate; j++) - if (thread->state[j].state == CSTATE_ABORTED) + if (thread->state[j].state != CSTATE_FINISHED) exit_code = 2; /* aggregate thread level stats */ |