Skip site navigation (1) Skip section navigation (2)

Re: do we EXEC_BACKEND on Mac OS X?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>,Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: do we EXEC_BACKEND on Mac OS X?
Date: 2012-10-03 17:08:17
Message-ID: 20121003170817.GC3470@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackers
On Wed, Oct  3, 2012 at 12:41:37PM -0400, Tom Lane wrote:
> I wrote:
> > Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> >> Noticed while perusing
> >> http://lwn.net/Articles/518306/
> 
> > I'm afraid Brian was just looking for an excuse to dump on Apple.  We
> > have a lot of years of Postgres experience showing that fork() works
> > fine on OS X.
> 
> BTW, I think the commenter at the bottom of the thread puts his finger
> on the core of the real problem:
> 
> > I'd wager most libraries are not fork safe, including such libraries
> > as SQLite as mentioned in the SQLite FAQ. Libraries that talk to the
> > outside world contain much state that is not safe to share.
> 
> To bring that closer to home, suppose you have a program with an open
> database connection in libpq, and you fork(), and then parent and child
> both try to use the connection.  How well would that work?  Is it the
> fault of fork()?
> 
> I think Apple is just pointing out that their framework libraries have
> similar issues.

Yes, but those framework libraries are typically supposed to prevent
such problems from being seen by applications calling them.  This is
certainly sloppy practice on Apple's part, and it leave us wondering if
we are using anything that might be a problem.  The bottom line is that
we don't know.

Libraries are supposed to document these limitations, as we do with
libpq.  I wonder if they just documented fork() and now don't feel they
need to document these limitations per-library.

Anyway, I agree that we need to see a failure before adjusting anything.

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


In response to

Responses

pgsql-hackers by date

Next:From: Fabrízio de Royes MelloDate: 2012-10-03 17:29:38
Subject: Re: CREATE SCHEMA IF NOT EXISTS
Previous:From: Tom LaneDate: 2012-10-03 16:41:37
Subject: Re: do we EXEC_BACKEND on Mac OS X?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group