Re: pg_terminate_backend() issues - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_terminate_backend() issues
Date
Msg-id 7947.1208357482@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_terminate_backend() issues  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: pg_terminate_backend() issues  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> "Tom Lane" <tgl@sss.pgh.pa.us> writes:
>> ISTM that there will be more cases like this in future, so we need a
>> general solution anyway.  I propose the following sort of code structure
>> for these situations:

> [We would also have to block SIGTERM around the second cancel_shmem_exit and
> cleanup_routine, no? Or if it's idempotent (actually, wouldn't it have to be?)
> run them in the reverse order.]

No, we wouldn't, because a SIGTERM can only actually fire at a
CHECK_FOR_INTERRUPTS() call.  You'd just need to be sure there wasn't
one in the cleanup code.

> Are all the known cases LWLocks?

*None* of the known cases are LWLocks, nor any other resource that we
have generic cleanup code for.  The problem cases are one-off resources
that it seemed we could avoid having a real cleanup mechanism for.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: count(*) performance improvement ideas
Next
From: Tom Lane
Date:
Subject: Re: pgwin32_safestat weirdness