RANGER-5744: Harden plugins-docker-build against Ozone KDC startup race - #1155
Merged
Conversation
Reduce flaky CI failures where ozone-datanode exits on Kerberos login before the Ranger KDC is fully ready in Docker Compose smoke tests. Co-authored-by: Cursor <cursoragent@cursor.com>
ramackri
requested review from
dineshkumar-yadav,
kumaab,
mneethiraj and
pradeepagrawal8184
and removed request for
mneethiraj
August 14, 2026 03:37
pradeepagrawal8184
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes intermittent
plugins-docker-buildCI failures whereozone-datanodeexits during Kerberos login before the Ranger KDC is fully ready in the Docker Compose smoke stack.Example failure: https://github.com/apache/ranger/actions/runs/31185432016/job/93444713551
Root cause: Ozone datanode/scm started on
ranger-kdc: service_startedwhile Java Kerberos clients probe KDC over UDP first; the existing KDC healthcheck only validated TCP port 88. Re-running the job usually passes once the KDC is warm.Changes
Dockerfile.ranger-kdc): replace TCPncprobe withkinitusing the datanode keytab so healthy means Kerberos actually worksdocker-compose.ranger-ozone.yml): Ozone datanode/scm/om wait forranger-kdc: service_healthy(same pattern asranger-zk)udp_preference_limit = 0to avoid UDPPortUnreachableExceptionin Docker CI when TCP is ready first (see below)ozone-service-start.sh): wait for keytab file and KDC reachability before starting Ozone SCM/datanoderestart: on-failure:3on ozone-datanode and ozone-scm for one-shot race recovery.github/workflows/ci.yml): explicit wait forranger-kdchealthy before the container status checkudp_preference_limit = 0inkrb5.confDefined once in
dev-support/ranger-docker/scripts/kdc/krb5.confand shared across the Docker CI stack (mounted into Ranger Admin, ZK, Hadoop, Hive, HBase, Kafka, Knox, Ozone, OpenSearch, Solr, KMS, PDP, UserSync, TagSync; also baked into the KDC image). It does not affect production Ranger installs outsidedev-support/ranger-docker.What it does
udp_preference_limitcontrols how Kerberos clients reach the KDC. By default, clients (Javakinit, Hadoop, Ozone, etc.) try the KDC over UDP port 88 first, then fall back to TCP if UDP fails.Setting:
udp_preference_limit = 0means the client never uses UDP for KDC ticket requests (AS-REQ / TGS-REQ). All KDC communication uses TCP port 88 only.
Per MIT Kerberos: “If this flag is set to 0, UDP will not be used to send messages to the KDC.”
flowchart LR A[Client needs ticket] --> B{udp_preference_limit} B -->|default| C[Try UDP :88] C -->|fail| D[Try TCP :88] C -->|ok| E[Got ticket] D --> E B -->|0| F[Use TCP :88 only] F --> EWhy it helps in this CI flake
The Ozone failure showed:
The Java client sent a UDP request to the KDC before UDP was reliably reachable, while the old KDC healthcheck only validated TCP with
nc. So healthcheck could pass (TCP ✅) while Ozone login failed (UDP ❌).Forcing TCP aligns client behavior with the healthcheck and avoids UDP startup races in Docker Compose.
Trade-offs
dev-support/ranger-dockeronly; production clusters use their ownkrb5.confTest plan
plugins-docker-buildpasses on this PR (watch for multiple consecutive green runs)cd dev-support/ranger-docker && docker compose ... -f docker-compose.ranger-ozone.yml up -d— verifyozone-datanode,ozone-scm,ozone-omstay runningdocker inspect ranger-kdcreportshealthyonly after keytabs are provisionedhttps://issues.apache.org/jira/browse/RANGER-5744