Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Chris Travers <chris(at)metatrontech(dot)com>, Cristian Bittel <cbittel(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session
Date: 2010-08-23 18:32:47
Message-ID: AANLkTinnCZYS5Cz_Pn2ht6_ovMFVr-69G_fJWw2WP7VP@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Mon, Aug 23, 2010 at 11:37 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> On Mon, Aug 23, 2010 at 17:09, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> I would be inclined to write this off as Windows randomness that's
>>> unfixable on our end.  We could recommend that people take a closer
>>> look at what AV software they have installed and maybe try some other
>>> one.
>
>> It may well be, but we can at least attempt to mitigate it, no?
>
> I'm not excited about a "mitigation" approach that introduces new
> data-loss hazards of its very own.  That doesn't meet the Less Evil
> standard in my eyes.
>
> [ thinks for a bit... ]  Although maybe it'd be all right to piggyback
> on the dead-man-switch code that already exists in pmsignal.c.  If the
> child process hasn't got as far as doing MarkPostmasterChildActive,
> then in principle it should be okay to assume it hasn't touched shared
> memory.  This really is independent of what exit code it returned.

I'm confused. That seems like it would be LESS safe than the proposed
approach of taking a mutex just before mapping shared memory. There
is some finite amount of code that executes after shared memory is
mapped and before MarkPostmasterChildActive executes; the advantage of
the mutex is that it can be taken BEFORE shared memory is mapped. On
the other hand, if you think it's safe enough, it would certainly be
nice to use an existing mechanism rather than inventing something
totally new.

I agree that the exit code is irrelevant.

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Itagaki Takahiro 2010-08-24 00:28:14 BUG #5628: 9.0beta4 failed automatic crash recovery
Previous Message Cristian Bittel 2010-08-23 18:07:27 Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2010-08-23 18:55:55 Re: Return of the Solaris vacuum polling problem -- anyone remember this?
Previous Message Thom Brown 2010-08-23 18:29:33 Re: WIP: extensible enums