Re: [bug fix] Produce a crash dump before main() on Windows

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
Cc: 'Tom Lane' <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera from 2ndQuadrant <alvherre(at)alvh(dot)no-ip(dot)org>, 'Amit Kapila' <amit(dot)kapila16(at)gmail(dot)com>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] Produce a crash dump before main() on Windows
Date: 2019-09-11 04:55:45
Message-ID: 20190911045544.GG1953@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 11, 2019 at 04:15:24AM +0000, Tsunakawa, Takayuki wrote:
> From: Michael Paquier [mailto:michael(at)paquier(dot)xyz]
>> Imagine an application which relies on Postgres, still does *not* start
>> it as a service but uses "pg_ctl start"
>> automatically. This could be triggered as part of another service startup
>> which calls say system(), or as another script. Wouldn't that cause
>> potentially a freeze?
>
> Do you mean by "another service startup":
>
> another service (Windows service)
> -> an application (not a Windows service)
> -> pg_ctl start
>
> Then pg_ctl runs under the Windows service environment, and the
> popup won't appear.

Yes, I meant a pg_ctl start command invoked as par of another service
startup in the way you describe it here.

>> I am also not sure that I quite understand why a
>> popup would never show up if a different service startup triggers pg_ctl
>> start by itself that fails.
>
> I experimented it with a sample program that I showed in this
> thread. A program invoked by a Windows services also runs in the
> service.

Okay, so this means that the service state of the parent is inherited
and that we can rely on that. I was not sure about that. Got it
now. Now, there are cases where it is possible to start an app
without using a service though, no? For example using the task
manager it is possible to trigger an app when the OS starts. What
happens in the case where we have an app which starts Postgres using
"pg_ctl start" as part of its startup process but it fails and pops an
error window, freezing the whole? Can this happen? Sorry to sound
noisy, but I am rather scared of the potential consequences of this
change without a GUC to control it as Craig mentioned at the beginning
of the thread. Perhaps that's a niche case, but it could be annoying
for some users.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-09-11 04:58:54 Re: [patch]socket_timeout in interfaces/libpq
Previous Message Michael Paquier 2019-09-11 04:45:23 Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?