Missing error_context_stack = NULL in AutoVacWorkerMain() - Mailing list pgsql-hackers

From Ashwin Agrawal
Subject Missing error_context_stack = NULL in AutoVacWorkerMain()
Date
Msg-id CALfoeisM+_+dgmAdAOHAu0k-ZpEHHqSSG=GRf3pKJGm8OqWX0w@mail.gmail.com
Whole thread Raw
Responses Re: Missing error_context_stack = NULL in AutoVacWorkerMain()
List pgsql-hackers
I am not sure if this causes any potential problems or not, but for consistency of code seems we are missing below. All other places in code where sigsetjmp() exists for top level handling has error_context_stack set to NULL.

diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 073f313337..b06d0ad058 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();

This was spotted by Paul during code inspection.

pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: v12.0: reindex CONCURRENTLY: lock ShareUpdateExclusiveLock onobject 14185/39327/0 is already held
Next
From: Michael Paquier
Date:
Subject: Re: v12.0: segfault in reindex CONCURRENTLY