diff options
author | Robert Haas <rhaas@postgresql.org> | 2017-09-29 13:51:14 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2017-09-29 13:55:38 -0400 |
commit | e55d9643ecb87f41185941b54d632641b3852aaa (patch) | |
tree | 8233d294186dc48e38eb7e7ce557a29bdf88a72a /src | |
parent | 2a14b9609df1de4f2eb5a97aff674aaad033a7e6 (diff) | |
download | postgresql-e55d9643ecb87f41185941b54d632641b3852aaa.tar.gz postgresql-e55d9643ecb87f41185941b54d632641b3852aaa.zip |
pgbench: If we fail to send a command to the server, fail.
This beats the old behavior of busy-waiting hands down.
Oversight in commit 12788ae49e1933f463bc59a6efe46c4a01701b76.
Report by Pavan Deolasee. Patch by Fabien Coelho. Reviewed by
Pavan Deolasee.
Discussion: http://postgr.es/m/CABOikdPhfXTypckMC1Ux6Ko+hKBWwUBA=EXsvamXYSg8M9J94w@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pgbench/pgbench.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index e37496c9714..f0394136902 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -2194,12 +2194,8 @@ doCustom(TState *thread, CState *st, StatsData *agg) { if (!sendCommand(st, command)) { - /* - * Failed. Stay in CSTATE_START_COMMAND state, to - * retry. ??? What the point or retrying? Should - * rather abort? - */ - return; + commandFailed(st, "SQL command send failed"); + st->state = CSTATE_ABORTED; } else st->state = CSTATE_WAIT_RESULT; |