Re: Possible segfault when sending notification within a ProcessUtility hook

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Possible segfault when sending notification within a ProcessUtility hook
Date: 2023-12-05 20:03:58
Message-ID: 955685.1701806638@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com> writes:
> This happens when a transaction block fails and a ProcessUtility hook
> sends a notification during the rollback command.

Why should we regard that as anything other than a bug in the
ProcessUtility hook? A failed transaction should not send any
notifies.

> Moving notification clean up from AbortTransaction to CleanupTransaction fixes
> the issue as it will clear pendingActions in the same function that destroys the
> TopTransactionContext.

Maybe that would be okay, or maybe not, but I'm disinclined to
mess with it without a better argument for changing it. It seems
like there would still be room to break things with mistimed
calls to async.c functions.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-12-05 20:06:10 Re: backtrace_on_internal_error
Previous Message Robert Haas 2023-12-05 19:59:46 Re: backtrace_on_internal_error