Skip to content

Commit d11fb14

Browse files
authored
fix(snuba-api): wait for clickhouse to be healthy (#1053)
To avoid a race condition in install.sh process at step https://github.com/getsentry/onpremise/blob/7e7401a668987c44863c403548ba3dbf91c701da/install/bootstrap-snuba.sh#L4 Closes #1033
1 parent 5d69561 commit d11fb14

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

docker-compose.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ x-sentry-defaults: &sentry_defaults
5454
x-snuba-defaults: &snuba_defaults
5555
<<: *restart_policy
5656
depends_on:
57-
- redis
58-
- clickhouse
59-
- kafka
57+
clickhouse:
58+
condition: service_healthy
59+
kafka:
60+
condition: service_healthy
61+
redis:
62+
condition: service_healthy
6063
image: "$SNUBA_IMAGE"
6164
environment:
6265
SNUBA_SETTINGS: docker
@@ -180,6 +183,11 @@ services:
180183
# If you have high volume and your search return incomplete results
181184
# You might want to change this to a higher value (and ensure your host has enough memory)
182185
MAX_MEMORY_USAGE_RATIO: 0.3
186+
healthcheck:
187+
test: ["CMD-SHELL", "wget -nv -t1 --spider 'http://localhost:9000/' || exit 1"]
188+
interval: 3s
189+
timeout: 600s
190+
retries: 200
183191
geoipupdate:
184192
image: "maxmindinc/geoipupdate:v4.7.1"
185193
# Override the entrypoint in order to avoid using envvars for config.

0 commit comments

Comments
 (0)