Hi Fujii-san,

On Sat, Jul 11, 2026 at 11:14 PM Fujii Masao <[email protected]> wrote:

> In datachecksum_state.c, launcher_cancel_handler() currently says:
>
>      * Internal routine for reacting to SIGINT and flagging the worker to
> abort.
>      * The worker won't be interrupted immediately but will check for
> abort flag
>      * between each block in a relation.
>      */
>
> This reads to me as if canceling the launcher is expected to cause
> the currently running worker to abort. However, the flag set by
> launcher_cancel_handler() is process-local to the launcher.
> Since the worker has its own process-local flag, it will never
> observe the launcher's flag.
>
> As a result, if the launcher receives SIGINT, the worker is not canceled.
> Moreover, the launcher waits for the worker to exit before it can
> terminate itself. If the worker runs for a long time, for example,
> while processing a large database or waiting for a long-running session
> holding temporary tables, the launcher's cancellation can be delayed
> for a long time as well.

+1


>
> Is this intentional?
>
I think so; it shouldn't be.


>
> If not, I'd like to propose the attached 0001 patch. It updates the
> launcher
> to cancel the current worker by calling TerminateBackgroundWorker()
> when it receives SIGINT. It also adds a data-checksums-specific helper
> for waiting for worker startup or shutdown, to handle the cases where
> SIGINT arrives while the launcher is waiting for a worker to start or exit.
>

I have looked into the 0001 patch; it's LGTM \o/

-- 
Thanks :)
Srinath Reddy Sadipiralla
EDB: https://www.enterprisedb.com/

Reply via email to