Re: Race condition in WaitForBackgroundWorkerStartup - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Race condition in WaitForBackgroundWorkerStartup
Date
Msg-id CAA4eK1+QeMn8AgXQo7fko9DMQT0kOdBS+RMCNg24BwJ+XBrwXw@mail.gmail.com
Whole thread Raw
In response to Race condition in WaitForBackgroundWorkerStartup  (Jeremy Finzel <finzelj@gmail.com>)
Responses Re: Race condition in WaitForBackgroundWorkerStartup
List pgsql-hackers
On Mon, Nov 12, 2018 at 11:55 PM Jeremy Finzel <finzelj@gmail.com> wrote:
>
> I believe I found a race condition in WaitForBackgroundWorkerStartup in the case where it encounters an ERROR during
startup. I found that depending on the speed of the system, it will unreliably return either status BGWH_STOPPED or
BGWH_STARTED. But I can reliably reproduce getting BGWH_STOPPED by tweaking the worker_spi.c test module. 
>

Yeah, I think it is possible that you get different values in such
cases because we consider worker status as started after we have
launched the worker.  Now, if we get the error in the worker
initialization, then the user can get any of those values.  I think
this is what is happening in your case where you are saying "ERROR
during startup".
Am I missing something?

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: legrand legrand
Date:
Subject: Re: proposal: simple query profile and tracing API
Next
From: Jürgen Strobel
Date:
Subject: Re: BUG #15212: Default values in partition tables don't work asexpected and allow NOT NULL violation