Re: [bug fix] Produce a crash dump before main() on Windows - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [bug fix] Produce a crash dump before main() on Windows
Date
Msg-id 20190911025729.GD1953@paquier.xyz
Whole thread Raw
In response to RE: [bug fix] Produce a crash dump before main() on Windows  ("Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>)
Responses RE: [bug fix] Produce a crash dump before main() on Windows
List pgsql-hackers
On Tue, Sep 10, 2019 at 06:44:48AM +0000, Tsunakawa, Takayuki wrote:
> We don't have to call pgwin32_is_service() to determine whether we
> call SetErrorMode() in postmaster.c because:
>
> * The dialog box doesn't appear under Windows service, whether
> * PostgreSQL itself starts as a service or another (server)
> * application runs as a service and does "pg_ctl start."
>
> * It's OK for the dialog box to appear when the user runs "pg_ctl
> * start" on the command prompt.  That usage is interactive, and
> * should not be for production use (postgres processes vanish when
> * the user mistakenly presses Ctrl+C, or closes the command prompt).
> * Even now, the dialog box pops up if postmaster crashes before
> * main().

Reading the thread again from scratch, I am under the impression that
we do not have an actual consensus on this patch :)

Doesn't your first bullet point actually contradict the second one?
Your second point looks sensible from a usage point of view (aka show
a box when pg_ctl start fails from the command prompt because somebody
typed the command manually), however I am really worried about the
first point.  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?  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.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: "Tsunakawa, Takayuki"
Date:
Subject: RE: SIGQUIT on archiver child processes maybe not such a hot idea?
Next
From: Michael Paquier
Date:
Subject: Re: Change atoi to strtol in same place