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

From Alvaro Herrera
Subject Re: [bug fix] Produce a crash dump before main() on Windows
Date
Msg-id 20190723173153.GA12835@alvherre.pgsql
Whole thread Raw
In response to Re: [bug fix] Produce a crash dump before main() on Windows  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [bug fix] Produce a crash dump before main() on Windows  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
On 2019-Jul-23, Tom Lane wrote:

> Kyotaro Horiguchi <horikyota.ntt@gmail.com> writes:

> > My investigation convinced me that there is no way for a process
> > to detect wheter it is running as a service (except the process
> > directly called from system (aka entry function)).

Maybe we can try calling pgwin32_is_service()?

> But I will say that in my experience, behavioral differences between
> Postgres started manually and Postgres started as a daemon are bad.
> So I think going out of our way to make the cases behave differently
> on Windows is probably not a good plan.

We already have such a difference in Windows -- elog.c uses it
extensively to use the eventlog to print if a service, console print if
not.

Given this thread's OP, ISTM failing to do likewise for this case makes
debugging problems difficult for no good reason.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: stress test for parallel workers
Next
From: Justin Pryzby
Date:
Subject: Re: stress test for parallel workers