Hi, 

+           case POSTMASTER_STILL_STARTING:
+               write_eventlog(EVENTLOG_ERROR_TYPE, _("Timed out waiting for 
server startup\n"));
+               pgwin32_SetServiceStatus(SERVICE_START_PENDING);
+               return;

Could this patch solve first post's problem [1] ?
I think no one could change the service status to SERVICE_RUNNING even if the 
server has been started properly after timeout is occurred. 

In 9.6 or earlier, the main use case where the problem is occurred is when 
timeout is occured because of long time recovery. Even if recovery takes a lot 
of time and timeout is ocurred, recovery continues in background. In this case, 
I want to set the status to SERVICE_RUNNING after recovery is completed. 

In 10 or later, I understand wait_for_postmaster does not wait until recovery 
is completed, so I think this problem rarely occurs in PG 10 or later.

[1] 
https://www.postgresql.org/message-id/99C4246E73ED1B478BBB9671718426203E37F485@G01JPEXMBKW03

Regards, 
Daisuke, Higuchi

Reply via email to