Skip to content

[https://nvbugs/6566735][fix] recover disaggregated worker heartbeat registration - #17461

Open
reasonsolo wants to merge 3 commits into
NVIDIA:mainfrom
reasonsolo:fix/disagg-heartbeat-reregister
Open

[https://nvbugs/6566735][fix] recover disaggregated worker heartbeat registration#17461
reasonsolo wants to merge 3 commits into
NVIDIA:mainfrom
reasonsolo:fix/disagg-heartbeat-reregister

Conversation

@reasonsolo

@reasonsolo reasonsolo commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Dev Engineer Review

  • Adds overwrite_if_exists to register_worker.
  • Preserves the option across retries.
  • Enables heartbeat recovery to replace stale registrations.
  • Keeps the API backward-compatible with a default value of False.

QA Engineer Review

  • Added test_registration_failure_without_retry_returns_false.
  • Added test_heartbeat_recovery_overwrites_stale_registration.
  • Neither test is listed in tests/integration/test_lists/.
  • Verdict: needs follow-up.

Description

Test Coverage

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

Signed-off-by: Lizhi Zhou <1432185+reasonsolo@users.noreply.github.com>
Signed-off-by: Lizhi Zhou <1432185+reasonsolo@users.noreply.github.com>
@reasonsolo
reasonsolo requested review from a team as code owners August 10, 2026 03:57
@reasonsolo
reasonsolo enabled auto-merge (squash) August 10, 2026 03:58
@reasonsolo

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64947 [ run ] triggered by Bot. Commit: 61f3dad Link to invocation

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The worker registration API now supports overwriting existing storage entries. Registration retries preserve this option. Heartbeat recovery enables overwriting, and regression tests verify failure state, overwrite behavior, and TTL.

Changes

Worker registration recovery

Layer / File(s) Summary
Registration overwrite contract and retries
tensorrt_llm/serve/disagg_auto_scaling.py, tests/unittest/disaggregated/test_disagg_cluster_manager_worker.py
register_worker accepts overwrite_if_exists, forwards it to cluster storage, and preserves it during retries. Tests verify failed registration state.
Heartbeat stale-registration recovery
tensorrt_llm/serve/disagg_auto_scaling.py, tests/unittest/disaggregated/test_disagg_cluster_manager_worker.py
Heartbeat recovery re-registers with overwrite enabled. Tests verify the overwrite flag and inactivity TTL.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: bowenfu

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description retains the template but leaves the Description and Test Coverage sections empty. Add a short explanation of the issue and solution, and list the regression tests that cover the changed registration and heartbeat recovery paths.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required NVBugs and fix format and clearly describes heartbeat registration recovery.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
tensorrt_llm/serve/disagg_auto_scaling.py (2)

318-321: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Type and document the new public option.

Add overwrite_if_exists: bool = False and document that it replaces an existing storage entry. Include the option in a Google-style docstring. Type validator and retry_interval when updating this public signature.

Proposed signature change
-                              overwrite_if_exists=False) -> bool:
+                              overwrite_if_exists: bool = False) -> bool:

As per coding guidelines, Python functions must be annotated and externally usable interfaces must use Google-style docstrings.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tensorrt_llm/serve/disagg_auto_scaling.py` around lines 318 - 321, Update the
public async register_worker signature to annotate validator and retry_interval,
and declare overwrite_if_exists as a bool defaulting to False. Add or extend its
Google-style docstring with an Args entry explaining that overwrite_if_exists
replaces an existing storage entry, while documenting the other newly typed
parameters as needed.

Source: Coding guidelines


318-321: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Annotate and document register_worker. Add precise types for all parameters and document overwrite_if_exists semantics. No incompatible overrides or wrappers exist.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tensorrt_llm/serve/disagg_auto_scaling.py` around lines 318 - 321, Update
register_worker with precise type annotations for validator, retry_interval, and
overwrite_if_exists, and retain the bool return annotation. Add a concise
docstring documenting each parameter, explicitly stating when
overwrite_if_exists replaces an existing worker registration.
tests/unittest/disaggregated/test_disagg_cluster_manager_worker.py (1)

30-56: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for registration retry.

  • Test coverage summary: one test added; no tests modified or removed.
  • CI coverage includes l0_cpu.yml and the hardware-specific test lists. The QA list contains a different disaggregated unit test, not this test.
  • Add a test where storage.set() returns False once, then succeeds, and assert the retry in register_worker() at tensorrt_llm/serve/disagg_auto_scaling.py:338-347.
  • Coverage verdict: insufficient. Run pytest tests/unittest/.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unittest/disaggregated/test_disagg_cluster_manager_worker.py` around
lines 30 - 56, Add a test for the registration retry path in register_worker:
configure storage.set to return False on the first call and True on the second,
invoke registration, and assert it is awaited twice with the expected
registration arguments. Keep the existing heartbeat recovery test unchanged and
verify the full unit-test suite with pytest tests/unittest/.

Sources: Coding guidelines, Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tensorrt_llm/serve/disagg_auto_scaling.py`:
- Around line 338-347: Update the failure path in register_worker after the
retry branch: when registration fails and retry_interval is non-positive, return
False immediately before updating _last_heartbeat or starting heartbeat
handling. Preserve the existing recursive retry behavior for positive retry
intervals.

---

Nitpick comments:
In `@tensorrt_llm/serve/disagg_auto_scaling.py`:
- Around line 318-321: Update the public async register_worker signature to
annotate validator and retry_interval, and declare overwrite_if_exists as a bool
defaulting to False. Add or extend its Google-style docstring with an Args entry
explaining that overwrite_if_exists replaces an existing storage entry, while
documenting the other newly typed parameters as needed.
- Around line 318-321: Update register_worker with precise type annotations for
validator, retry_interval, and overwrite_if_exists, and retain the bool return
annotation. Add a concise docstring documenting each parameter, explicitly
stating when overwrite_if_exists replaces an existing worker registration.

In `@tests/unittest/disaggregated/test_disagg_cluster_manager_worker.py`:
- Around line 30-56: Add a test for the registration retry path in
register_worker: configure storage.set to return False on the first call and
True on the second, invoke registration, and assert it is awaited twice with the
expected registration arguments. Keep the existing heartbeat recovery test
unchanged and verify the full unit-test suite with pytest tests/unittest/.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f5d2b234-1497-4708-9440-c82267a190fe

📥 Commits

Reviewing files that changed from the base of the PR and between 0fa708b and 61f3dad.

📒 Files selected for processing (2)
  • tensorrt_llm/serve/disagg_auto_scaling.py
  • tests/unittest/disaggregated/test_disagg_cluster_manager_worker.py

Comment thread tensorrt_llm/serve/disagg_auto_scaling.py
Signed-off-by: Lizhi Zhou <1432185+reasonsolo@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/unittest/disaggregated/test_disagg_cluster_manager_worker.py (1)

30-48: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add retry-path coverage for register_worker.

test_registration_failure_without_retry_returns_false covers only retry_interval=0. Add a test for storage.set returning False and then True. Mock the retry sleep. Assert that both calls receive overwrite_if_exists=True.

Test coverage summary:

  • Added: test_registration_failure_without_retry_returns_false, test_heartbeat_recovery_overwrites_stale_registration.
  • Modified or removed: none.
  • CI coverage: tests/integration/test_lists/test-db/l0_cpu.yml includes unittest/disaggregated.
  • QA coverage: no matching entry exists in tests/integration/test_lists/qa/llm_function_core.txt.
  • Coverage verdict: insufficient until the positive retry path is covered.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unittest/disaggregated/test_disagg_cluster_manager_worker.py` around
lines 30 - 48, Add a retry-path test alongside
test_registration_failure_without_retry_returns_false where storage.set returns
False first and True second, mock the retry sleep to avoid delays, and invoke
register_worker with a positive retry interval. Assert registration succeeds and
both storage.set calls include overwrite_if_exists=True.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/unittest/disaggregated/test_disagg_cluster_manager_worker.py`:
- Around line 30-48: Add a retry-path test alongside
test_registration_failure_without_retry_returns_false where storage.set returns
False first and True second, mock the retry sleep to avoid delays, and invoke
register_worker with a positive retry interval. Assert registration succeeds and
both storage.set calls include overwrite_if_exists=True.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 49c67b18-164d-4c6a-9a7f-23ee17f9a1da

📥 Commits

Reviewing files that changed from the base of the PR and between 61f3dad and 2d7d2ff.

📒 Files selected for processing (2)
  • tensorrt_llm/serve/disagg_auto_scaling.py
  • tests/unittest/disaggregated/test_disagg_cluster_manager_worker.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tensorrt_llm/serve/disagg_auto_scaling.py

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64947 [ run ] completed with state FAILURE. Commit: 61f3dad
/LLM/main/L0_MergeRequest_PR pipeline #52781 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@reasonsolo

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64997 [ run ] triggered by Bot. Commit: 2d7d2ff Link to invocation

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