Re: pgbench: allow to exit immediately when any client is aborted - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: pgbench: allow to exit immediately when any client is aborted
Date
Msg-id e9e8d86-6e5e-cc6a-f08f-829c4a2489e6@mines-paristech.fr
Whole thread Raw
In response to Re: pgbench: allow to exit immediately when any client is aborted  (Yugo NAGATA <nagata@sraoss.co.jp>)
Responses Re: pgbench: allow to exit immediately when any client is aborted
List 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.



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [PoC] pg_upgrade: allow to upgrade publisher node
Next
From: David Rowley
Date:
Subject: Re: Check volatile functions in ppi_clauses for memoize node