Skip to content

fix: include callback context in worker RPC timeout errors - #1372

Merged
willkill07 merged 5 commits into
NVIDIA:mainfrom
willkill07:fix/relay-1007-worker-timeout-context
Oct 16, 2026
Merged

willkill07 merged 5 commits into
NVIDIA:mainfrom
willkill07:fix/relay-1007-worker-timeout-context

Conversation

@willkill07

@willkill07 willkill07 commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Overview

Worker RPC timeout errors now identify the callback and its registration surface, alongside the timeout duration. This helps callers locate the callback that timed out.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Add surface and callback names when converting worker invocation deadline errors into caller-visible errors. Keep the existing timeout duration and cancellation behavior.
  • Extend the RPC timeout test to check the surface, callback name, duration, and worker cancellation.
  • Document the error fields with short examples.
  • No breaking API changes.

Validation:

  • Staged pre-commit checks passed with uv run --no-sync pre-commit run, including Clippy, Cargo check, and dependency audits.
  • The focused worker RPC timeout test passed.
  • just test-rust: 5,943 passed, two unrelated CLI integration tests failed: cli_doctor_accepts_discovered_stderr_logging_opt_out (unexpected stderr) and invocation_diagnostic_does_not_preflight_live_launches (fixture executable not found). The CLI version-probe test passed on retry.
  • Formatting, whitespace, documentation, and broken-link checks passed. The published-redirect comparison was skipped because FDR returned HTTP 403.

Where should the reviewer start?

Start with WorkerPluginCallback::invoke_async_with_timeout in crates/core/src/plugin/dynamic/worker.rs, then review callback_timeout_sends_explicit_worker_cancellation in crates/core/tests/unit/dynamic_worker_tests.rs.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

Summary by CodeRabbit

  • Bug Fixes
    • Worker timeout errors now identify the callback and registration surface, and report the timeout duration.
  • Documentation
    • Updated the worker middleware and continuation guide with details and an example of the timeout error.

@willkill07
willkill07 requested review from a team as code owners October 16, 2026 04:24
@github-actions github-actions Bot added size:S PR is small Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code labels Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/NeMo-Relay/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: 906da385-5e61-441e-b802-d8da0a94e663
📥 Commits

Reviewing files that changed from the base of the PR and between ac68db5 and 2ef9a73.

📒 Files selected for processing: 2
  • crates/core/src/plugin/dynamic/worker.rs
  • docs/build-plugins/workers/middleware-and-continuations.mdx

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

📜 Recent review details
⏰ Context from checks skipped due to timeout: 18
  • GitHub Check: Python / Package (linux-musl-arm64)
  • GitHub Check: Python / Package (windows-amd64)
  • GitHub Check: Node.js / Test (windows-arm64)
  • GitHub Check: Python / Test (windows-arm64)
  • GitHub Check: Python / Package (linux-musl-amd64)
  • GitHub Check: Python / Test (windows-amd64)
  • GitHub Check: Python / Test (macos-arm64)
  • GitHub Check: Python / Package (windows-arm64)
  • GitHub Check: Node.js / Package (windows-arm64)
  • GitHub Check: Rust / Package (windows-amd64)
  • GitHub Check: Rust / Test (windows-amd64)
  • GitHub Check: Rust / Package (linux-musl-arm64)
  • GitHub Check: Rust / Package (linux-musl-amd64)
  • GitHub Check: Go / Test (windows-arm64)
  • GitHub Check: Rust / Test (linux-amd64)
  • GitHub Check: Rust / Test (macos-arm64)
  • GitHub Check: Rust / Test (windows-arm64)
  • GitHub Check: Preview docs
🧰 Additional context used
📚 Code guidelines: 5
.agents/skills/contribute-docs/SKILL.md — configured
.agents/skills/review-doc-style/SKILL.md — configured
CONTRIBUTING.md — configured
.agents/skills/prepare-code-freeze/SKILL.md — configured
.agents/skills/draft-release-notes/SKILL.md — configured
📓 Path-based instructions: 7
Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.

⚙️ CodeRabbit configuration file

Files:

  • docs/build-plugins/workers/middleware-and-continuations.mdx
Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.

⚙️ CodeRabbit configuration file

Files:

  • crates/core/src/plugin/dynamic/worker.rs
Source excerpt: In MDX files, top-of-file comments must use JSX comment delimiters: `{/*` to open and `*/}` to close.

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Files:

  • docs/build-plugins/workers/middleware-and-continuations.mdx
Source excerpt: Verify MDX files use JSX delimiters for top-of-file SPDX comments.

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

Files:

  • docs/build-plugins/workers/middleware-and-continuations.mdx
Applicability reference: AGENTS.md: # NeMo Relay Repository Guidance See `CONTRIBUTING.md` and `docs/contribute/testing-and-docs.mdx` for contributor details, and `.agents/skills/README.md` for the maintainer skill boundary.

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Files:

  • crates/core/src/plugin/dynamic/worker.rs
Source excerpt: Search documentation source for references to the old version and update current-version install commands, package examples, and configuration examples to `` where appropriate: Review matches before changing th...

📄 CodeRabbit inference engine (.agents/skills/prepare-code-freeze/SKILL.md)

Files:

  • docs/build-plugins/workers/middleware-and-continuations.mdx
Source excerpt: Preserve MDX front matter and the JSX SPDX comment.

📄 CodeRabbit inference engine (.agents/skills/draft-release-notes/SKILL.md)

Files:

  • docs/build-plugins/workers/middleware-and-continuations.mdx
🔇 Additional comments: 2
crates/core/src/plugin/dynamic/worker.rs: 1

2385-2386: LGTM!

Also applies to: 2393-2396, 2412-2420

docs/build-plugins/workers/middleware-and-continuations.mdx: 1

48-50: LGTM!

Walkthrough

Worker RPC deadline errors now include the callback name and registration surface. The timeout test checks these details and the timeout duration. The documentation provides a 30-second timeout example.

Changes

Worker timeout context

Layer / File(s) Summary
Add callback and surface to timeout errors
crates/core/src/plugin/dynamic/worker.rs, crates/core/tests/unit/dynamic_worker_tests.rs, docs/build-plugins/workers/middleware-and-continuations.mdx
Deadline-exceeded errors include the registration surface and callback name. The test checks these details and the timeout duration. The documentation shows a 30-second timeout example.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 2ef9a

The change adds callback and registration-surface context to timeout errors without changing cancellation behavior. No concrete merge-blocking risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title follows Conventional Commits format, uses the allowed lowercase type fix, clearly describes the change, stays under 72 characters, and has no trailing period.
Description check Passed The description includes the required Overview, Details, reviewer guidance, and Related Issues sections. It documents the change, validation results, known unrelated test failures, and uses the requir…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 …
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: Description check

Explanation

The description includes the required Overview, Details, reviewer guidance, and Related Issues sections. It documents the change, validation results, known unrelated test failures, and uses the required Closes action keyword.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • 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.

@willkill07 willkill07 self-assigned this Oct 16, 2026
@willkill07 willkill07 added this to the 0.11 milestone Oct 16, 2026
@github-actions

Copy link
Copy Markdown

@mnajafian-nv mnajafian-nv 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.

lgtm

@willkill07
willkill07 merged commit 34422b0 into NVIDIA:main Oct 16, 2026
96 checks passed
@willkill07
willkill07 deleted the fix/relay-1007-worker-timeout-context branch October 30, 2026 14:47

This branch was previously deployed

1 inactive deployment
fern — 2ef9a73f Deployed Oct 16, 2026 by willkill07 via Clean up docs preview #5898
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code size:S PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants