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

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: pgbench: allow to exit immediately when any client is aborted
Дата
Msg-id e9e8d86-6e5e-cc6a-f08f-829c4a2489e6@mines-paristech.fr
обсуждение исходный текст
Ответ на Re: pgbench: allow to exit immediately when any client is aborted  (Yugo NAGATA <nagata@sraoss.co.jp>)
Ответы Re: pgbench: allow to exit immediately when any client is aborted  (Yugo NAGATA <nagata@sraoss.co.jp>)
Список 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 по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: [PoC] pg_upgrade: allow to upgrade publisher node
Следующее
От: David Rowley
Дата:
Сообщение: Re: Check volatile functions in ppi_clauses for memoize node