aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2021-09-29 21:01:10 +0900
committerFujii Masao <fujii@postgresql.org>2021-09-29 21:49:40 +0900
commitc5f7e702d78f5b49a80b6e8b69e2b4019c1fca4b (patch)
treee9432cd23bab7139cd7a7b52a3ce3cdfe7f7c5f1 /src
parent2d8a8b18fe5a88146cb8baff591137fa724d86da (diff)
downloadpostgresql-c5f7e702d78f5b49a80b6e8b69e2b4019c1fca4b.tar.gz
postgresql-c5f7e702d78f5b49a80b6e8b69e2b4019c1fca4b.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
Diffstat (limited to 'src')
-rw-r--r--src/bin/pgbench/pgbench.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index a9a929d12a2..c5e028bd88d 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -5863,7 +5863,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 */