Skip to content

OBSDATA-13995 Backport connect timeout (#450) and service discovery fix (apache #19139) to druid 30 - #469

Merged
Sadananda Aithal (saithal-confluent) merged 2 commits into
30.0.1-confluentfrom
saithal/obsdata-13995-30
Jul 8, 2026
Merged

Sadananda Aithal (saithal-confluent) merged 2 commits into
30.0.1-confluentfrom
saithal/obsdata-13995-30

Conversation

@saithal-confluent

Copy link
Copy Markdown
Member

Description

Backports two changes to the Druid 30 (30.0.1-confluent) branch, both already on the 34 branch:

  1. OBSDATA-13995 — Wire TCP connect timeout into Netty HTTP client (from [OBSDATA-13995] Backport service discovery fix (#19139) and add broker TCP connect timeout #450, commit dd70e94d7d)

    • The Netty ClientBootstrap had no connectTimeoutMillis, so a TCP SYN to an unreachable host would hang for the OS default (~2 min on Linux). The existing druid.broker.http.clientConnectTimeout (default 500ms) was only applied to the Jetty client (Router), not the Netty client (Broker).
    • Threads connectTimeout through HttpClientConfig into the Netty bootstrap. Queries to unreachable Historicals now fail in 500ms instead of hanging.
    • 30-specific: DruidHttpClientConfig on 30 lacked the clientConnectTimeout field + getClientConnectTimeout() getter (it pre-existed on 34). Added here (default 500ms) so the wiring compiles.
  2. Fix service discovery bug in kubernetes-extensions (Fix service discovery bug in kubernetes-extensions apache/druid#19139, cherry-pick of 6ccac59acd)

    • Readiness-based service discovery: DefaultK8sApiClient remaps not-ready pods to a NOT_READY watch event; BaseNodeRoleWatcher.childRemoved gains a skipIfUnknown flag so k8s discovery removals don't log spurious errors for pods never added.

Conflict resolution notes

Testing

  • mvn test-compile -pl server,extensions-core/kubernetes-extensions → BUILD SUCCESS (main + test sources).
  • Unit tests for the affected classes (BaseNodeRoleWatcherTest, DefaultK8sApiClientTest, K8sDruidNodeDiscoveryProviderTest) already pass on the 34 branch with identical code. Local test execution here was blocked by unrelated stale Maven processes holding the build lock; CI will run the full suite.

🤖 Generated with Claude Code

The Netty ClientBootstrap had no connectTimeoutMillis set, so TCP
SYN to an unreachable host would hang for the OS default (~2 min
on Linux). The existing druid.broker.http.clientConnectTimeout
config (default 500ms) was only applied to the Jetty client used
by the Router, not the Netty client used by the Broker.

Thread connectTimeout through HttpClientConfig into the Netty
bootstrap via bootstrap.setOption("connectTimeoutMillis", ...).
Queries to unreachable Historicals now fail in 500ms instead of
hanging for minutes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@saithal-confluent
Sadananda Aithal (saithal-confluent) merged commit 455f3e5 into 30.0.1-confluent Jul 8, 2026
2 checks passed
@saithal-confluent
Sadananda Aithal (saithal-confluent) deleted the saithal/obsdata-13995-30 branch July 8, 2026 11:26
Sadananda Aithal (saithal-confluent) added a commit that referenced this pull request Jul 20, 2026
…oker connect timeout (#474)

Scoped revert of the kubernetes-extensions / service-discovery half of
455f3e5 (OBSDATA-13995 Backport connect timeout (#450) and service
discovery fix (apache apache#19139) to druid 30 (#469)). The broker TCP
connect-timeout fix (HttpClientConfig.java, HttpClientInit.java,
HttpClientModule.java, DruidHttpClientConfig.java) is untouched and
remains in place - it is unrelated and unaffected by this incident.

The isPodReady() filter added to DefaultK8sApiClient.listPods()/
watchPods() requires k8s to already report a pod's container ready
before that pod can be treated as self-discovered. But a pod's
readiness/startup probe (still pointed at /status/selfDiscovered on
every environment using this image) only passes once self-discovery
succeeds - a circular dependency. This crash-restart-looped every
overlord pod on druid-devel-44409 (running druid-34, which carries
the identical filter) after it picked up an image containing this
filter; druid-30 is exposed to the same risk on its next fresh pod
rollout.

The real fix (a new /status/ready endpoint backed by a purely local
ServiceAnnouncementState flag, breaking the circularity) is up as
PR #472 on this branch's line, but the filter and the fix must ship
in the same image tag - landing them in different tags is what
caused the incident, and leaving the filter in now blocks other
in-flight work on this branch. Reverting here to unblock; the filter
will be re-added together with PR #472 once both are ready to ship
as a single image.

This reverts the isPodReady() filter and its tests to their pre-455f3e5715
state; docs/development/extensions-core/kubernetes.md and
website/.spelling are reverted alongside since both are attributable
solely to the service-discovery change.
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.

3 participants