Skip to content

fix(health): stop liveness probes from restarting every replica during dependency outages - #2896

Closed
rohithb-hub wants to merge 1 commit into
mainfrom
fix/liveness-process-only
Closed

rohithb-hub wants to merge 1 commit into
mainfrom
fix/liveness-process-only

Conversation

@rohithb-hub

@rohithb-hub rohithb-hub commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR

Liveness probes checked dependencies shared by every replica (Cassandra, NATS,
nvcf-api). One outage restarted all replicas, and back-off delayed recovery.
Liveness now checks the process only; dependencies gate readiness.

Additional Details

  • Java services (nvcf-api, nvct-api, api-keys, ess-api, icms): liveness is
    livenessState plus new cassandraSession. Readiness is unchanged.
  • nv-boot-starter-cassandra: new cassandraSession contributor. It reports
    DOWN only when the app's Cassandra session fails for 3 min while a new
    session succeeds. This restarts a pod whose session stays broken after
    Cassandra recovers, and never restarts pods during an outage. Settings:
    app.cassandra.session-liveness.{enabled,grace-period,check-interval}.
  • grpc-proxy, invocation-service: /health (readiness) checks NATS only.
    Liveness uses a process-only endpoint (:10083/health, /info).
  • vanity-gateway: liveness uses the admin /health.

Measured on a k3d stack with live traffic:

Fault Before After
Cassandra down 5 min 63 restarts, recovery +216 s 0 restarts, recovery +60 s
nvcf-api down 3 min 3 services restart, recovery +211 s 0 restarts, recovery +34 s
Open gRPC stream cut no failures

For the Reviewer

  • CassandraSessionLivenessIndicator.java
  • grpc-proxy/proxy/health.go, http-invocation/.../routes/health.rs

For QA

  • New tests: HealthProbeGroupsTest (5 services), nv-boot indicator tests,
    grpc-proxy and invocation /health tests, chart probe tests.
  • Rust test_health and full Java suites run in CI only.
  • QA needed: HA cases for Cassandra loss, Cassandra quorum loss, and losing
    both nvcf-api replicas.

Issues

Relates to #1524

Checklist

  • I am familiar with the Contributing Guidelines.
  • I have signed off my commits for Developer Certificate of Origin (DCO) compliance.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Generated with Claude Code (https://claude.com/claude-code)

…g dependency outages

Signed-off-by: rohithb <rohithb@nvidia.com>
@rohithb-hub
rohithb-hub requested review from a team as code owners October 26, 2026 13:13
@rohithb-hub
rohithb-hub requested a review from harshm98 October 26, 2026 13:13
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: NVIDIA/nvcf
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 03f2fae
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 5bf254a9-1a81-43e0-a43a-30ecaf701a43
Commits

Reviewing files that changed from the base of the PR and between 03f2fae and ade349b.

Files ignored due to path filters: 1
  • MODULE.bazel.lock is excluded by !**/*.lock, !**/MODULE.bazel.lock
Files selected for processing: 38
  • deploy/helm/grpc-proxy/grpc-proxy/values.yaml
  • deploy/helm/grpc-proxy/tests/probes_test.sh
  • deploy/helm/http-invocation/nvcf-invocation-service/values.yaml
  • deploy/helm/http-invocation/tests/probes_test.sh
  • deploy/helm/vanity-gateway/helm-nvcf-vanity-gateway/templates/deployment.yaml
  • deploy/helm/vanity-gateway/tests/chart-render/verify-probes.sh
  • src/control-plane-services/api-keys/BUILD.bazel
  • src/control-plane-services/api-keys/src/main/resources/application.yaml
  • src/control-plane-services/api-keys/src/test/java/com/nvidia/apikeys/HealthProbeGroupsTest.java
  • src/control-plane-services/cloud-functions/nvcf-service/src/main/resources/application.yaml
  • src/control-plane-services/cloud-functions/nvcf-service/src/test/java/com/nvidia/nvcf/HealthProbeGroupsTest.java
  • src/control-plane-services/cloud-tasks/nvct-service/src/main/resources/application.yaml
  • src/control-plane-services/cloud-tasks/nvct-service/src/test/java/com/nvidia/nvct/HealthProbeGroupsTest.java
  • src/control-plane-services/encrypted-secret-store/ess-service/BUILD.bazel
  • src/control-plane-services/encrypted-secret-store/ess-service/src/main/resources/application-ncp-local.yaml
  • src/control-plane-services/encrypted-secret-store/ess-service/src/main/resources/application-ncp-prod.yaml
  • src/control-plane-services/encrypted-secret-store/ess-service/src/main/resources/application.yaml
  • src/control-plane-services/encrypted-secret-store/ess-service/src/test/java/com/nvidia/ess/HealthProbeGroupsTest.java
  • src/control-plane-services/instance-cluster-management/icms-service/BUILD.bazel
  • src/control-plane-services/instance-cluster-management/icms-service/src/main/resources/application-ncp.yaml
  • src/control-plane-services/instance-cluster-management/icms-service/src/test/java/com/nvidia/icms/HealthProbeGroupsTest.java
  • src/invocation-plane-services/grpc-proxy/proxy/director_test.go
  • src/invocation-plane-services/grpc-proxy/proxy/health.go
  • src/invocation-plane-services/grpc-proxy/proxy/health_test.go
  • src/invocation-plane-services/grpc-proxy/proxy/proxy.go
  • src/invocation-plane-services/http-invocation/crates/server/Cargo.toml
  • src/invocation-plane-services/http-invocation/crates/server/src/lib.rs
  • src/invocation-plane-services/http-invocation/crates/server/src/nvcf_api/mod.rs
  • src/invocation-plane-services/http-invocation/crates/server/src/routes/health.rs
  • src/invocation-plane-services/http-invocation/crates/server/tests/mocks/nvcf_api_mock.rs
  • src/invocation-plane-services/http-invocation/crates/server/tests/test_health.rs
  • src/invocation-plane-services/vanity-gateway/README.md
  • src/invocation-plane-services/vanity-gateway/gateway/health.go
  • src/libraries/java/nv-boot-parent/nv-boot-starter-cassandra/src/main/java/com/nvidia/boot/cassandra/CassandraAutoConfiguration.java
  • src/libraries/java/nv-boot-parent/nv-boot-starter-cassandra/src/main/java/com/nvidia/boot/cassandra/configuration/CassandraSessionLivenessConfiguration.java
  • src/libraries/java/nv-boot-parent/nv-boot-starter-cassandra/src/main/java/com/nvidia/boot/cassandra/configuration/CassandraSessionLivenessIndicator.java
  • src/libraries/java/nv-boot-parent/nv-boot-starter-cassandra/src/test/java/com/nvidia/boot/cassandra/configuration/CassandraSessionLivenessConfigurationTest.java
  • src/libraries/java/nv-boot-parent/nv-boot-starter-cassandra/src/test/java/com/nvidia/boot/cassandra/configuration/CassandraSessionLivenessIndicatorTest.java
Files with no reviewable changes: 3
  • src/control-plane-services/encrypted-secret-store/ess-service/src/main/resources/application-ncp-local.yaml
  • src/control-plane-services/encrypted-secret-store/ess-service/src/main/resources/application-ncp-prod.yaml
  • src/invocation-plane-services/http-invocation/crates/server/src/nvcf_api/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

Walkthrough

Liveness checks now focus on the process or Cassandra session, while readiness checks retain dependency checks. The changes add a Cassandra session liveness indicator, update invocation health checks, and adjust Helm probe configurations with tests.

Changes: Health probe behavior

Layer / File(s) Summary
Cassandra session liveness
src/libraries/java/nv-boot-parent/nv-boot-starter-cassandra/...
The Cassandra starter adds a configurable liveness indicator. It reports DOWN when the application session remains broken after a fresh session succeeds for the configured grace period. Tests cover registration, disabled configuration, and session health transitions.
Control-plane health groups
src/control-plane-services/api-keys/..., src/control-plane-services/cloud-functions/nvcf-service/..., src/control-plane-services/cloud-tasks/nvct-service/..., src/control-plane-services/encrypted-secret-store/ess-service/..., src/control-plane-services/instance-cluster-management/icms-service/...
Liveness groups use cassandraSession instead of Cassandra checks. NVCF service liveness also excludes NATS. Tests cover liveness and readiness results across the affected service configurations and profiles.
HTTP invocation readiness
src/invocation-plane-services/http-invocation/crates/server/...
The health route checks NATS without checking NVCF API health. The NVCF health client and cache configuration are removed. Tests cover NVCF API failure and NATS disconnection.
gRPC proxy readiness
src/invocation-plane-services/grpc-proxy/proxy/...
The health manager checks NATS and no longer checks NVCF API health. Its call sites and tests use the updated interface.
Chart probe configuration
deploy/helm/grpc-proxy/..., deploy/helm/http-invocation/..., deploy/helm/vanity-gateway/..., src/invocation-plane-services/vanity-gateway/README.md, src/invocation-plane-services/vanity-gateway/gateway/health.go
The charts use process-focused liveness probes and retain dependency checks for readiness. Render tests verify probe settings. Vanity gateway documentation and comments describe its readiness and liveness behavior.

Priority: Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Suggested reviewers: balajinvda, borao

Merge Risk: Minimal · up to ade34

No identified issue prevents merging after the planned checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 4.17% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 72 functions across 25 files. (10 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the required Conventional Commits format, includes the required scope for a customer-impacting fix, and accurately describes the primary change to liveness probe behavior.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 4.17% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 72 functions across 25 files. (10 skipped: 10 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ CodeQL Analysis

✅ No security issues found!

🔗 View full details in Security tab

🕐 Last updated: 2026-10-26 13:32:42 UTC | Commit: ade349b

@rohithb-hub

Copy link
Copy Markdown
Contributor Author

Split into two independent PRs for separate review and revert: #2901 (control plane: Cassandra liveness and the cassandraSession check) and #2902 (data plane: grpc-proxy, invocation-service, vanity-gateway probes). Same changes, no new code.

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.

1 participant