Skip to content

Add /status/ready endpoint for service health. - #19148

Merged
gianm merged 1 commit into
apache:masterfrom
gianm:ready-api
Mar 13, 2026
Merged

gianm merged 1 commit into
apache:masterfrom
gianm:ready-api

Conversation

@gianm

@gianm gianm commented Mar 13, 2026 •

Copy link
Copy Markdown
Contributor

Currently the most natural endpoint to use for service health (e.g. if adding Druid services to a load balancer) is /status/health. However, this does not play nicely with graceful shutdown mechanisms.

When druid.server.http.unannouncePropagationDelay is used, there is a delay between unannounce and server shutdown, which allows Druid's internal service discovery to stop sending traffic to a service before it shuts down its server. However, /status/health continues to return OK until the server is shut down, so external load balancers cannot take advantage of this.

This patch adds /status/ready, an endpoint that is tied to announcement. It allows external load balancers to take advantage of this graceful shutdown mechanism.

Currently the most natural endpoint to use for service health (e.g. if
adding Druid services to a load balancer) is /status/health. However,
this does not play nicely with graceful shutdown mechanisms.

When druid.server.http.unannouncePropagationDelay is used, there is a
delay between unannounce and server shutdown, which allows Druid's
internal service discovery to stop sending traffic to a service before
it shuts down its server. However, /status/health continues to return OK
until the server is shut down, so external load balancers cannot take
advantage of this.

This patch adds /status/ready, an endpoint that is tied to announcement.
It allows external load balancers to take advantage of this graceful
shutdown mechanism.
@gianm
gianm merged commit ee614dc into apache:master Mar 13, 2026
37 checks passed
@gianm
gianm deleted the ready-api branch March 13, 2026 08:05
@github-actions github-actions Bot added this to the 37.0.0 milestone Mar 13, 2026
vivek807 pushed a commit to deep-bi/druid that referenced this pull request Sep 1, 2026
Currently the most natural endpoint to use for service health (e.g. if
adding Druid services to a load balancer) is /status/health. However,
this does not play nicely with graceful shutdown mechanisms.

When druid.server.http.unannouncePropagationDelay is used, there is a
delay between unannounce and server shutdown, which allows Druid's
internal service discovery to stop sending traffic to a service before
it shuts down its server. However, /status/health continues to return OK
until the server is shut down, so external load balancers cannot take
advantage of this.

This patch adds /status/ready, an endpoint that is tied to announcement.
It allows external load balancers to take advantage of this graceful
shutdown mechanism.
airlock-confluentinc Bot pushed a commit to confluentinc/druid that referenced this pull request Sep 18, 2026
Backport of upstream commit ee614dc
(apache#19148), which predates and is required by the
service-discovery isPodReady() filter backported in b0f841b
([OBSDATA-13995] Backport service discovery fix (apache#19139)...).

Without this endpoint, a pod's readiness/startup probe pointed at
/status/selfDiscovered deadlocks: k8s only marks a container ready
after its probe passes, but the k8s-discovery isPodReady() filter
requires k8s to already report the container ready before
self-discovery (and therefore /status/selfDiscovered) can succeed.
This surfaced as a crash-restart loop on druid-devel-44409 overlord
pods immediately after rolling to an image containing the isPodReady()
filter.

This commit adds ServiceAnnouncementState, a purely local flag flipped
by the node's own announce()/unannounce() lifecycle handlers, and
exposes it via a new /status/ready endpoint that upstream now
recommends as the probe target instead of /status/selfDiscovered
(see the docs update in apache#19139). Wiring probes to /status/ready
is a separate, follow-up change to the helm chart / operator defaults.

(cherry picked from commit ee614dc)
saithal-confluent added a commit to confluentinc/druid that referenced this pull request Sep 18, 2026
…#495)

* [OBSDATA-13995] Backport /status/ready endpoint (apache apache#19148)

Backport of upstream commit ee614dc
(apache#19148), which predates and is required by the
service-discovery isPodReady() filter backported in b0f841b
([OBSDATA-13995] Backport service discovery fix (apache#19139)...).

Without this endpoint, a pod's readiness/startup probe pointed at
/status/selfDiscovered deadlocks: k8s only marks a container ready
after its probe passes, but the k8s-discovery isPodReady() filter
requires k8s to already report the container ready before
self-discovery (and therefore /status/selfDiscovered) can succeed.
This surfaced as a crash-restart loop on druid-devel-44409 overlord
pods immediately after rolling to an image containing the isPodReady()
filter.

This commit adds ServiceAnnouncementState, a purely local flag flipped
by the node's own announce()/unannounce() lifecycle handlers, and
exposes it via a new /status/ready endpoint that upstream now
recommends as the probe target instead of /status/selfDiscovered
(see the docs update in apache#19139). Wiring probes to /status/ready
is a separate, follow-up change to the helm chart / operator defaults.

(cherry picked from commit ee614dc)

* Fix embedded-tests MinIO image pull failure by switching to quay.io

minio/minio was removed from Docker Hub (INC-13385), breaking
MinIOStorageResource-based embedded tests. Point at the equivalent
quay.io/minio/minio tag, matching the fix already adopted elsewhere
(e.g. confluentinc/flink-control-plane#13593).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Revert "Fix embedded-tests MinIO image pull failure by switching to quay.io"

This reverts commit f797bdd.

* ci: switch MinIO test image from Docker Hub to Quay

* Drop ServerSideEncryptingAmazonS3MultipartUploadTest cherry-pick

This upstream test (from apache#20331) targets the SDK v2-style
ServerSideEncryptingAmazonS3/S3Utils API that isn't present on this
34.0.0-confluent fork yet (still on AWS SDK v1), so it doesn't compile.
Keeping just the MinIO image fix for MinIOStorageResource.java and
S3StorageConnectorTest.java, which is what's needed to unblock PR #495.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Gian Merlino <gianmerlino@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Frank Chen <frank.chen021@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants