Double invocation of InitPostmasterChild in bgworker with -DEXEC_BACKEND

Started by Thomas Munroover 9 years ago3 messageshackers
Jump to latest
#1Thomas Munro
thomas.munro@gmail.com

Hi

I discovered that if you build with -DEXEC_BACKEND on a Unix system
and then try to start a background worker, it dies in
InitializeLatchSupport:

TRAP: FailedAssertion("!(selfpipe_readfd == -1)", File: "latch.c", Line: 161)

That's because InitPostmasterChild is called twice. I can
successfully use regular parallel query workers and bgworkers created
by extensions if I apply the attached patch.

--
Thomas Munro
http://www.enterprisedb.com

Attachments:

fix.patchapplication/octet-stream; name=fix.patchDownload+0-2
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Thomas Munro (#1)
Re: Double invocation of InitPostmasterChild in bgworker with -DEXEC_BACKEND

Thomas Munro <thomas.munro@enterprisedb.com> writes:

I discovered that if you build with -DEXEC_BACKEND on a Unix system
and then try to start a background worker, it dies in
InitializeLatchSupport:

TRAP: FailedAssertion("!(selfpipe_readfd == -1)", File: "latch.c", Line: 161)

That's because InitPostmasterChild is called twice. I can
successfully use regular parallel query workers and bgworkers created
by extensions if I apply the attached patch.

Confirmed, fix pushed. I wonder if we should have a buildfarm member
running the Unix EXEC_BACKEND code ...

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#2)
Re: Double invocation of InitPostmasterChild in bgworker with -DEXEC_BACKEND

On Tue, Aug 2, 2016 at 6:40 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Thomas Munro <thomas.munro@enterprisedb.com> writes:

I discovered that if you build with -DEXEC_BACKEND on a Unix system
and then try to start a background worker, it dies in
InitializeLatchSupport:

TRAP: FailedAssertion("!(selfpipe_readfd == -1)", File: "latch.c", Line: 161)

That's because InitPostmasterChild is called twice. I can
successfully use regular parallel query workers and bgworkers created
by extensions if I apply the attached patch.

Confirmed, fix pushed. I wonder if we should have a buildfarm member
running the Unix EXEC_BACKEND code ...

That would get my vote.

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers