Repository navigation
Wait for the final Postgres server in the hosted spaces check - #75
Merged
Merged
Conversation
The postgres image's first-run init server answers pg_isready on the Unix socket and then shuts down, so migrations could hit 'the database system is shutting down' (TeamCity build 3759). Wait for and connect over TCP, which only the final server listens on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TeamCity CI build 3759 failed in "Hosted space membership policies" with
the database system is shutting down.On first start, the
postgresimage runs a temporary init server that listens only on the Unix socket and then shuts down.pg_isreadyover the socket can report ready while that temporary server is up, so the first migration could connect just as it stops.This change waits for the final server, and runs the migrations against it, over TCP (
-h 127.0.0.1), which the temporary server doesn't listen on. It also raises the wait from 30s to 60s.Verified:
bash scripts/ci/test-hosted-spaces.shpassed 3 of 3 runs locally with Docker. The original failure passed when re-run on TeamCity (build 3770), which is consistent with a race.🤖 Generated with Claude Code