Re: atexit_callback can be a net negative

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Florian Weimer <fweimer(at)redhat(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: atexit_callback can be a net negative
Date: 2014-03-07 14:31:11
Message-ID: 5319D82F.9040608@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/07/2014 04:23 PM, Florian Weimer wrote:
> On 03/07/2014 06:03 AM, Tom Lane wrote:
>
>> In the bug thread I proposed making atexit_callback check whether getpid()
>> still matches MyProcPid. If it doesn't, then presumably we inherited the
>> atexit callback list, along with the value of MyProcPid, from some parent
>> backend process whose elbow we should not joggle. Can anyone see a flaw
>> in that?
>
> There's the PID reuse problem. Forking twice (with a delay) could end
> up with the same PID as MyProcPid.

Not if the parent process is still running.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-03-07 14:36:26 Re: atexit_callback can be a net negative
Previous Message Bruce Momjian 2014-03-07 14:29:30 Re: pg_ctl status with nonexistent data directory