Re: pgbnech: allow to cancel queries during benchmark

From: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
To: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgbnech: allow to cancel queries during benchmark
Date: 2023-09-19 08:30:11
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, 6 Sep 2023 20:13:34 +0900
Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp> wrote:

> I attached the updated patch v3. The changes since the previous
> patch includes the following;
> I removed the unnecessary condition (&& false) that you
> pointed out in [1].
> The test was rewritten by using IPC::Run signal() and integrated
> to "". This test is skipped on Windows
> because SIGINT causes to terminate the test itself as discussed
> in [2] about query cancellation test in psql.
> I added some comments to describe how query cancellation is
> handled as I explained in [1].
> Also, I found the previous patch didn't work on Windows so fixed it.
> On non-Windows system, a thread waiting a response of long query can
> be interrupted by SIGINT, but on Windows, threads do not return from
> waiting until queries they are running are cancelled. This is because,
> when the signal is received, the system just creates a new thread to
> execute the callback function specified by setup_cancel_handler, and
> other thread continue to run[3]. Therefore, the queries have to be
> cancelled in the callback function.
> [1]
> [2]
> [3]

I found that --disable-thread-safety option was removed in 68a4b58eca0329.
So, I removed codes involving ENABLE_THREAD_SAFETY from the patch.

Also, I wrote a commit log draft.

Attached is the updated version, v4.

Yugo Nagata

Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
v4-0001-Allow-pgbnech-to-cancel-queries-during-benchmark.patch text/x-diff 7.2 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2023-09-19 08:33:48 Re: [PATCH] Add native windows on arm64 support
Previous Message Pierre Ducroquet 2023-09-19 08:25:09 Re: Improvements in pg_dump/pg_restore toc format and performances