Skip to content

fix(cluster): continue IP confirmation after a per-item error#408

Open
neyy91 wants to merge 1 commit into
akash-network:mainfrom
neyy91:fix/ip-confirm-continue
Open

fix(cluster): continue IP confirmation after a per-item error#408
neyy91 wants to merge 1 commit into
akash-network:mainfrom
neyy91:fix/ip-confirm-continue

Conversation

@neyy91

@neyy91 neyy91 commented Jun 21, 2026

Copy link
Copy Markdown

What

The IP confirmation loop in inventoryService.runCheck (cluster/inventory.go) called break on the first failed GetIPAddressStatus, aborting the whole pass - even though the comment right above it states the error is non-fatal and "The other results retrieved in this code are still valid". This changes it to continue so only the failed item is skipped.

Why

A single transient IP-operator error left every reservation after the failing one unconfirmed. Their endpoints stay counted as pending indefinitely, so the provider's IP quota leaks and is never reclaimed for those leases — the code did the opposite of what its own comment intends.

Testing

Added Test_runCheck_IPConfirmContinuesAfterError: three allocated, unconfirmed reservations where the first GetIPAddressStatus errors and the other two succeed; it asserts both later reservations are still confirmed. Fails on break, passes on continue

The IP confirmation loop bailed out with break on the first failed
GetIPAddressStatus call, even though the surrounding comment states the
error is non-fatal and the remaining results are still valid. A single
transient error therefore left every subsequent reservation unconfirmed,
leaving its endpoints pending indefinitely and leaking the IP quota.

Skip only the failed item so the rest of the reservations are still
confirmed.
@neyy91 neyy91 requested a review from a team as a code owner June 21, 2026 18:59
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

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: Pro

Run ID: 0ec64869-b3d9-472f-80fb-6db74bea3b04

📥 Commits

Reviewing files that changed from the base of the PR and between 0e0fd8a and d3a443b.

📒 Files selected for processing (2)
  • cluster/inventory.go
  • cluster/inventory_runcheck_test.go

Walkthrough

In cluster/inventory.go, the runCheck function's IP confirmation loop changes break to continue when GetIPAddressStatus returns an error, making per-item failures non-fatal. A new test in cluster/inventory_runcheck_test.go verifies that runCheck completes successfully and confirms non-failing reservations even when one reservation's IP status lookup errors.

Changes

IP Confirmation Error Handling

Layer / File(s) Summary
Non-fatal GetIPAddressStatus error handling and test
cluster/inventory.go, cluster/inventory_runcheck_test.go
runCheck replaces break with continue on GetIPAddressStatus errors, logging and skipping the failing item. The new test mocks three reservations — one failing IP lookup and two succeeding — then asserts the result has no top-level error and both non-failing reservations appear in confirmedResult.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Suggested reviewers

  • troian

Poem

🐇 A break became a continue one day,
The loop kept hopping, errors tucked away.
One lease went wrong, but two hops through!
The rabbit confirmed what it always knew:
Skip the bad patch, keep the meadow in view. 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main fix: changing the IP confirmation loop to continue after per-item errors instead of breaking.
Description check ✅ Passed The description directly addresses the changeset by explaining what was changed, why it matters, and how it was tested.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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