-
Notifications
You must be signed in to change notification settings - Fork 964
Fix race condition in Docker startup #3559
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
base: main
Are you sure you want to change the base?
Fix race condition in Docker startup #3559
Conversation
dc95d67 to
91d0576
Compare
docker-compose.yml
Outdated
| networks: | ||
| - augur | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U ${AUGUR_DB_USER:-augur} -d augur"] |
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.
is there an environment variable that allows the value of the database augur uses to be configured? if so we should use that for the -d argument
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.
this is the one have added there also- AUGUR_DB_NAME:-augur
docker-compose.yml
Outdated
| - redis | ||
| - augur-keyman | ||
| - rabbitmq |
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.
I think one of the other PRs for this also had changes to these lines to specifiy that they could start as long as the DB was up (before it becomes healthy).
is that the default behavior?
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.
Yes, service_started is default behavior when no condition is specified. I have updated docker-compose.yml
to explicitly state condition: service_started for Redis, Keyman, and RabbitMQ to avoid any ambiguity, while keeping the strict service_healthy check for the database to prevent race condition.
Signed-off-by: guptapratykshh <[email protected]>
…ce_started Signed-off-by: guptapratykshh <[email protected]>
91d0576 to
06a58a2
Compare
|
Superseded by #3613 |
Description
this solves docker startup race conditions by adding a database health check and setting HOME=/tmp for handling permissions.
Notes for Reviewers
Signed commits