Re: Missing error_context_stack = NULL in AutoVacWorkerMain()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Ashwin Agrawal <aagrawal(at)pivotal(dot)io>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Paul Guo <paulguo(at)gmail(dot)com>
Subject: Re: Missing error_context_stack = NULL in AutoVacWorkerMain()
Date: 2019-10-21 04:53:27
Message-ID: 6308.1571633607@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> The issue might be argued to be insignificant because the autovacuum
> worker is just going to do proc_exit anyway. But if it encountered
> another error during proc_exit, elog.c might try to invoke error
> callbacks using garbage callback data.

Oh --- looking closer, proc_exit itself will clear error_context_stack
before doing much. So a problem would only occur if we suffered an error
during EmitErrorReport, which seems somewhat unlikely. Still, it's bad
that this code isn't like all the others. There's certainly no downside
to clearing the pointer.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-10-21 04:56:52 Re: Missing error_context_stack = NULL in AutoVacWorkerMain()
Previous Message Tom Lane 2019-10-21 04:47:40 Re: Missing error_context_stack = NULL in AutoVacWorkerMain()