Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e3db3f8

Browse files
committed
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
1 parent ad4b7ae commit e3db3f8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/postmaster/autovacuum.c

+3
Original file line numberDiff line numberDiff line change
@@ -1558,6 +1558,9 @@ AutoVacWorkerMain(int argc, char *argv[])
15581558
*/
15591559
if (sigsetjmp(local_sigjmp_buf, 1) != 0)
15601560
{
1561+
/* since not using PG_TRY, must reset error stack by hand */
1562+
error_context_stack = NULL;
1563+
15611564
/* Prevents interrupts while cleaning up */
15621565
HOLD_INTERRUPTS();
15631566

0 commit comments

Comments
 (0)