Skip to content

Commit f27ac66

Browse files
Shikhar-395RayBB
andauthored
fix: Add solr health check to prevent race condition on startup (#11013)
Co-authored-by: RayBB <RayBB@users.noreply.github.com>
1 parent fc3ce18 commit f27ac66

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

compose.override.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ services:
5353
-Dsolr.max.booleanClauses=30000
5454
-Dsolr.environment=dev
5555
- LOCAL_DEV=true
56+
healthcheck:
57+
test: ["CMD", "curl", "-f", "http://localhost:8983/solr/openlibrary/admin/ping"]
58+
interval: 30s
59+
start_interval: 2s
60+
start_period: 20s
61+
timeout: 1s
62+
retries: 24
5663
volumes:
5764
- ./docker/ol-local-solr-start.sh:/docker/ol-solr-start.sh:ro
5865
ports:
@@ -66,6 +73,9 @@ services:
6673
dockerfile: docker/Dockerfile.oldev
6774
environment:
6875
- OL_SOLR_NEXT=true
76+
depends_on:
77+
solr:
78+
condition: service_healthy
6979
volumes:
7080
# Persistent volume mount for installed git submodules
7181
- ol-vendor:/openlibrary/vendor

0 commit comments

Comments
 (0)