-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix search_path race by separating commands way #297
Fix search_path race by separating commands way #297
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The effects of the change are STILL a "reconnection", so why dropping the comment ? I'd keep the comment to make sure it doesn't break in the future.
Also, you did not specify WHY the \c
reconnection failed for you (did it fail for you?). Asking an already running process to reconnect would be faster than quitting the process and starting a new one...
@strk Thanks for the comments.
Okay, sure.
The reproducible step is a bit complex, but it is as follows.
Another solution is
volumes:
- postgis:/var/lib/postgresql/data
+ healthcheck:
+ test: "pg_isready && psql -c \"\\dx\" | grep postgis_tiger_geocoder"
+ interval: 10s
+ timeout: 2s
+ retries: 5
+ start_period: 10s
redmine:
:
depends_on:
- - postgis
+ postgis:
+ condition: service_healthy |
imho: there is a related upstream issue: docker-library/postgres#146 the current upstream best practice : the best way to test if the container is "ready" is to connect to it using its external IP address (it does not listen externally until the initialization process is fully complete). |
I'm not understanding how this "waiting for service" is at all related
to using `\c` in the SQL stream. The long explanation did not explain
why `\c` could not be used.
|
@ImreSamu
Okay, sure. |
@ImreSamu I close this PR with issue #296. |
Closes #296
@ImreSamu (CC: @strk)
I create this PR with the following steps, so could you check this ?
Note that my environment is macOS Monterey M1 (Apple Silicon) with zsh, so I couldn't execute
make test
due to No.3 error.make update
to apply above changes to all.make test
with setting environment variables, but encounter the following bash error./usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/10_postgis.sh CREATE DATABASE Loading PostGIS extensions into template_postgis CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION Loading PostGIS extensions into postgres CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION waiting for server to shut down....2022-06-06 09:33:26.107 UTC [48] LOG: received fast shutdown request