pgbench exit code

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: pgbench exit code
Date: 2018-08-09 12:52:14
Message-ID: 260c6cce-ff12-4c78-0c72-bd4a1a738cbd@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

In pgbench, when an error occurs during a benchmark run (SQL error,
connection error, etc.) it just prints an error message and then
proceeds to print the run summary normally and exits with status 0. So
this is quite inconvenient, especially from a script.

The attached patch changes this so that it exits with status 1 and also
prints a line below the summary advising that the results are incomplete.

The test suite had, curiously, encoded the previous behavior, checking
for exit status 0 vs 1 in various error situations. In this patch, I
have just updated the expected results (which are all "1" now), but
perhaps we should remove listing that individually and just check for
nonzero in all cases somewhere centrally.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-pgbench-Report-errors-during-run-better.patch text/plain 6.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2018-08-09 13:00:34 Re: commitfest 2018-07
Previous Message Andres Freund 2018-08-09 12:30:59 Re: remove ancient pre-dlopen dynloader code