Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: michael@paquier.xyz, kuroda.hayato@fujitsu.com, shlok.kyal.oss@gmail.com, pgsql-hackers@lists.postgresql.org
Date: 2024-01-15T18:34:46Z
Lists: pgsql-hackers
On Thu, Jan 11, 2024 at 3:33 AM Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote: > Is it correct to understand that you are requesting changes as follows? > > --- a/src/bin/pg_ctl/pg_ctl.c > +++ b/src/bin/pg_ctl/pg_ctl.c > @@ -1995,11 +1995,14 @@ pgwin32_find_postmaster_pid(pid_t shell_pid) > * > * Check for duplicate processes to ensure reliability. > * > - * The launcher shell might start other cmd.exe instances or programs > - * besides postgres.exe. Verifying the program file name is essential. > - * > - * The launcher shell process isn't checked in this function. It will be > - * checked by the caller. > + * The ppe entry to be examined is identified by th32ParentProcessID, which > + * should correspond to the cmd.exe process that executes the postgres.exe > + * binary. Additionally, th32ProcessID in the same entry should be the PID > + * of the launched postgres.exe. However, even though we have launched the > + * parent cmd.exe with the /D option specified, it is sometimes observed > + * that another cmd.exe is launched for unknown reasons. Therefore, it is > + * crucial to verify the program file name to avoid returning the wrong > + * PID. > */ This kind of change looks massively helpful to me. I don't know if it is exactly right or not, but it would have been a big help to me when writing my previous review, so +1 for some change of this general type. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Re-enable autoruns for cmd.exe on Windows
- 74b8e6a69802 18.0 landed
-
Re-enable autoruns for for cmd.exe on Windows
- fa1a63dffcd7 17.0 landed
-
pg_regress: Disable autoruns for cmd.exe on Windows
- e50a52b2b448 12.18 landed
- 2a0eb80ae4ad 13.14 landed
- 4a7475e9a332 14.11 landed
- 7e7d827f57b9 15.6 landed
- 506c77f9b2e5 16.2 landed
- b83747a8a65b 17.0 landed
-
pg_ctl: Disable autoruns for cmd.exe on Windows
- 9e70e6564fc8 12.18 landed
- c8aab699edd6 13.14 landed
- 4c6944223ef4 14.11 landed
- 33d1be06aee0 15.6 landed
- 714bfb7813ed 16.2 landed
- 9886744a361b 17.0 landed