Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows
Дата
Msg-id 20230922.161551.320043332510268554.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы RE: pg_ctl start may return 0 even if the postmaster has been already started on Windows  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
Список pgsql-hackers
At Wed, 20 Sep 2023 14:18:41 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in 
> I was able to see the trouble in the CI environment, but not
> locally. I'll delve deeper into this. Thanks you for bringing it to my
> attention.

I found two instances with multiple child processes.

# child-pid / parent-pid / given-pid : exec name
process  parent PID  child PID  target PID   exec file
shell       1228       6472        1228      cmd.exe
child       5184       1228        1228      cmd.exe
child       6956       1228        1228      postgres.exe
> launcher shell executed multiple processes

process  parent PID  child PID  target PID   exec file
shell       4296       5880        4296      cmd.exe
child       5156       4296        4296      agent.exe
child       5640       4296        4296      postgres.exe
> launcher shell executed multiple processes

It looks like the environment has autorun setups for cmd.exe. There's
another known issue related to auto-launching chcp at
startup. Ideally, we would avoid such behavior in the
postmaster-launcher shell.  I think we should add "/D" flag to cmd.exe
command line, perhaps in a separate patch.

Even after making that change, I still see something being launched from the launcher cmd.exe...

process  parent PID  child PID  target PID   exec file
shell       2784       6668        2784      cmd.exe
child       6140       2784        2784      MicrosoftEdgeUpdate.exe
child       6260       2784        2784      postgres.exe
> launcher shell executed multiple processes

I'm not sure what triggers this; perhaps some other kind of hooks?  If
we cannot avoid this behavior, we'll have to verify the executable
file name. It should be fine, given that the file name is constant,
but I'm not fully convinced that this is the ideal solution.

Another issue is.. that I haven't been able to cause the false
positive of pg_ctl start..  Do you have a concise reproducer of the
issue?

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: [PoC] pg_upgrade: allow to upgrade publisher node
Следующее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Infinite Interval