Re: pgbench: allow to exit immediately when any client is aborted

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
Cc: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgbench: allow to exit immediately when any client is aborted
Date: 2023-08-09 00:15:01
Message-ID: 8e8f9199-28c0-b981-5e68-ecfc9dd47b19@mines-paristech.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Yugo-san,

> There are cases where "goto done" is used where some error like
> "invalid socket: ..." happens. I would like to make pgbench exit in
> such cases, too, so I chose to handle errors below the "done:" label.
> However, we can change it to call "exit" instead of "goo done" at each
> place. Do you think this is better?

Good point.

Now I understand the "!= FINISHED", because indeed in these cases the done
is reached with unfinished but not necessarily ABORTED clients, and the
comment was somehow misleading.

On reflection, there should be only one exit() call, thus I'd say to keep
the "goto done" as you did, but to move the checking loop *before* the
disconnect_all, and the overall section comment could be something like
"possibly abort if any client is not finished, meaning some error
occured", which is consistent with the "!= FINISHED" condition.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-08-09 00:37:10 Re: Support to define custom wait events for extensions
Previous Message Michael Paquier 2023-08-08 23:03:29 Re: Support to define custom wait events for extensions