From d11fb14ceecb92078cf59449a93e1fb02e8b101f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Fu=C3=9F?= <5619511+pharindoko@users.noreply.github.com> Date: Thu, 5 Aug 2021 12:13:05 +0200 Subject: [PATCH] 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 --- docker-compose.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 86f3ed44be..78c7547e13 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -54,9 +54,12 @@ x-sentry-defaults: &sentry_defaults x-snuba-defaults: &snuba_defaults <<: *restart_policy depends_on: - - redis - - clickhouse - - kafka + clickhouse: + condition: service_healthy + kafka: + condition: service_healthy + redis: + condition: service_healthy image: "$SNUBA_IMAGE" environment: SNUBA_SETTINGS: docker @@ -180,6 +183,11 @@ services: # If you have high volume and your search return incomplete results # You might want to change this to a higher value (and ensure your host has enough memory) MAX_MEMORY_USAGE_RATIO: 0.3 + healthcheck: + test: ["CMD-SHELL", "wget -nv -t1 --spider 'http://localhost:9000/' || exit 1"] + interval: 3s + timeout: 600s + retries: 200 geoipupdate: image: "maxmindinc/geoipupdate:v4.7.1" # Override the entrypoint in order to avoid using envvars for config.