-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unfortunately pg_ctl start changed behavior in postgresql 10: pg_ctl for postgres < 10 with -w will returns 0 also if the instance isn't ready to accept connections. Whle in postgres >= 10 it will return a non 0 exit code (1 like when the instance fails to start) making it impossible to distinguish between problems starting an instance (i.e. wrong parameters) or an instance started but not ready to accept connections. To work with all the versions and since we want to distinguish between a failed start and a started but not ready instance we are forced to not use pg_ctl and write part of its logic here (I hate to do this). Now PGManager.start method directly starts the instance using the "postgres" executable and waits 1 minute to see if the process starts (checking its pid file) or exits due to an error. It doesn't check if the instance is ready to accept connections. When needed this is done inside the keeper calling WaitReady.
- Loading branch information
Showing
3 changed files
with
100 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters