Re: parallel mode and parallel contexts - Mailing list pgsql-hackers

From Robert Haas
Subject Re: parallel mode and parallel contexts
Date
Msg-id CA+TgmoYZQWuDPF0a3_tw8t+af7ZwoyMSS3A4ybOS0rcV9fb0xw@mail.gmail.com
Whole thread Raw
In response to Re: parallel mode and parallel contexts  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: parallel mode and parallel contexts
List pgsql-hackers
On Tue, Jan 20, 2015 at 9:41 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> It seems [WaitForBackgroundWorkerShutdown] has possibility to wait forever.
> Assume one of the worker is not able to start (not able to attach
> to shared memory or some other reason), then status returned by
> GetBackgroundWorkerPid() will be BGWH_NOT_YET_STARTED
> and after that it can wait forever in WaitLatch.

I don't think that's right.  The status only remains
BGWH_NOT_YET_STARTED until the postmaster forks the child process.  At
that point it immediately changes to BGWH_STARTED.  If it starts up
and then dies early on, for example because it can't attach to shared
memory or somesuch, the status will change to BGWH_STOPPED.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Disable -faggressive-loop-optimizations in gcc 4.8+ for pre-9.2
Next
From: Robert Haas
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Disable -faggressive-loop-optimizations in gcc 4.8+ for pre-9.2