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-07 10:17:38
Message-ID: e9e8d86-6e5e-cc6a-f08f-829c4a2489e6@mines-paristech.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Yugo-san,

> I attached v2 patch including the documentation and some comments
> in the code.

I've looked at this patch.

I'm unclear whether it does what it says: "exit immediately on abort", I
would expect a cold call to "exit" (with a clear message obviously) when
the abort occurs.

Currently it skips to "done" which starts by closing this particular
thread client connections, then it will call "exit" later, so it is not
"immediate".

I do not think that this cleanup is necessary, because anyway all other
threads will be brutally killed by the exit called by the aborted thread,
so why bothering to disconnect only some connections?

/* If any client is aborted, exit immediately. */
if (state[i].state != CSTATE_FINISHED)

For this comment, I would prefer "if ( ... == CSTATE_ABORTED)" rather that
implying that not finished means aborted, and if you follow my previous
remark then this code can be removed.

Typo: "going to exist" -> "going to exit". Note that it is not "the whole
thread" but "the program" which is exiting.

There is no test.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2023-08-07 10:19:08 Re: Check volatile functions in ppi_clauses for memoize node
Previous Message Amit Kapila 2023-08-07 10:16:13 Re: [PoC] pg_upgrade: allow to upgrade publisher node