postgres.git / summary / log / commit / refs

commit    399b8d13ca5cda44ed9c4aff10c85351d8e95cff
Author:   Michael Paquier <michael@paquier.xyz>
Date:     Wed Oct 23 01:25:46 2019 +0000
First released in: 13.0, 9.4.25, 9.5.20, 9.6.16, 10.11, 11.6, 12.1

    Clean up properly error_context_stack in autovacuum worker on exception
    
    Any callback set would have no meaning in the context of an exception.
    As an autovacuum worker exits quickly in this context, this could be
    only an issue within EmitErrorReport(), where the elog hook is for
    example called.  That's unlikely to going to be a problem, but let's be
    clean and consistent with other code paths handling exceptions.  This is
    present since 2909419, which introduced autovacuum.
    
    Author: Ashwin Agrawal
    Reviewed-by: Tom Lane, Michael Paquier
    Discussion: https://postgr.es/m/CALfoeisM+_+dgmAdAOHAu0k-ZpEHHqSSG=GRf3pKJGm8OqWX0w@mail.gmail.com
    Backpatch-through: 9.4


src/backend/postmaster/autovacuum.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index fd85b9c8f44..0b1e74f00bc 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -1558,6 +1558,9 @@ AutoVacWorkerMain(int argc, char *argv[]) */ if (sigsetjmp(local_sigjmp_buf, 1) != 0) { + /* since not using PG_TRY, must reset error stack by hand */ + error_context_stack = NULL; + /* Prevents interrupts while cleaning up */ HOLD_INTERRUPTS(); [parent: 4f2ad5226975]