Skip to content

Omit misleading free IP count from fast path error#3703

Merged
behroozrafii merged 1 commit into
NVIDIA:mainfrom
behroozrafii:behrooz/3384-misleading-free-ip-count
Jul 21, 2026
Merged

Omit misleading free IP count from fast path error#3703
behroozrafii merged 1 commit into
NVIDIA:mainfrom
behroozrafii:behrooz/3384-misleading-free-ip-count

Conversation

@behroozrafii

@behroozrafii behroozrafii commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Fast-path machine-interface creation errors currently report
NetworkPrefix.num_free_ips: 0 even when the number of available IPs was not
computed. Because the DHCP discovery path does not request that computation,
the reported zero is only the field's default value and can mislead operators
into diagnosing address-pool exhaustion.

This change replaces the raw Debug output with a concise list of segment
names and IDs constructed directly in create_fast_path. Each segment is
reported as <name> (<id>), retaining useful identification without exposing
uncomputed fields such as num_free_ips.

Related issues

Fixes #3384

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Commands run:

  • cargo fmt --all -- --check
  • cargo check -p carbide-api-db --lib
  • cargo test -p carbide-api-db --lib --no-run

The full cargo test -p carbide-api-db --lib suite was also attempted. It
could not complete because database-backed tests require DATABASE_URL, which
is not configured on this host. Before the suite reported the database setup
failures, 81 tests passed.

Additional Notes

This is a diagnostic-only change. IP allocation behavior and free-IP
calculation are unchanged.

@copy-pr-bot

copy-pr-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4b4e9032-5ef0-435e-a195-6465932ddfa0

📥 Commits

Reviewing files that changed from the base of the PR and between 29b890e and cce66ee.

📒 Files selected for processing (1)
  • crates/api-db/src/machine_interface.rs

Summary by CodeRabbit

  • Bug Fixes
    • Improved error messages when fast-path creation fails by clearly listing candidate network segments and their identifiers.
    • Retry behavior remains unchanged.

Walkthrough

The create_fast_path failure message now reports candidate network segments as comma-separated name/ID entries instead of rendering the full segment structures. Retry behavior and control flow are unchanged.

Changes

Fast-path error formatting

Layer / File(s) Summary
Format candidate segments in failure errors
crates/api-db/src/machine_interface.rs
The error path formats each segment as name and ID entries, avoiding debug output such as uncomputed num_free_ips values while preserving retry handling.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main fix: removing misleading free IP counts from fast-path errors.
Description check ✅ Passed The description accurately describes the error-message change and the unchanged allocation behavior.
Linked Issues check ✅ Passed The change addresses #3384 by avoiding the uncomputed num_free_ips value in fast-path failures.
Out of Scope Changes check ✅ Passed The diff stays focused on diagnostic error formatting and adds no unrelated behavior changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@behroozrafii
behroozrafii force-pushed the behrooz/3384-misleading-free-ip-count branch from 68bb7f5 to 30eaae3 Compare July 20, 2026 21:18
@copy-pr-bot

copy-pr-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

Comment thread crates/api-db/src/machine_interface.rs Outdated
@behroozrafii
behroozrafii force-pushed the behrooz/3384-misleading-free-ip-count branch from 30eaae3 to 1288205 Compare July 20, 2026 22:20
Signed-off-by: Behrooz Rafii <brafii@nvidia.com>
@behroozrafii
behroozrafii force-pushed the behrooz/3384-misleading-free-ip-count branch from 1288205 to cce66ee Compare July 20, 2026 23:02
@bcavnvidia
bcavnvidia marked this pull request as ready for review July 21, 2026 00:58
@bcavnvidia
bcavnvidia requested a review from a team as a code owner July 21, 2026 00:58
@behroozrafii
behroozrafii merged commit 10cc1c8 into NVIDIA:main Jul 21, 2026
62 checks passed
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.

bug: misleading error message for number of free IPs available

2 participants