Skip to content

fix(raft): update NetBackoff::backoff() return type to Option<Backoff>#40

Closed
polaz wants to merge 1 commit intomainfrom
fix/#39-netbackoff-option
Closed

fix(raft): update NetBackoff::backoff() return type to Option<Backoff>#40
polaz wants to merge 1 commit intomainfrom
fix/#39-netbackoff-option

Conversation

@polaz
Copy link
Copy Markdown
Member

@polaz polaz commented May 2, 2026

Summary

  • openraft 0.10.0-alpha.18 changed NetBackoff trait: backoff() now returns Option<Backoff> instead of Backoff
  • Both GrpcNetwork and StubNetwork impls updated to return Some(Backoff::new(...))
  • Without this fix, coordinode-python CI fails when cargo resolves to alpha.18+ (Cargo.lock is gitignored in coordinode-embedded)

Closes #39

openraft 0.10.0-alpha.18 changed the NetBackoff trait to return
Option<Backoff> instead of Backoff. Wrap both GrpcNetwork and
StubNetwork impls accordingly.

Closes #39
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 621759aa-15a6-4eb0-b526-3b7e4f1300c3

📥 Commits

Reviewing files that changed from the base of the PR and between 99a4e3a and 2983844.

📒 Files selected for processing (1)
  • crates/coordinode-raft/src/cluster/network.rs

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Enhanced network retry mechanism to improve reliability and control flow clarity.

Walkthrough

The NetBackoff::backoff() trait method signature is updated to return Option<Backoff> instead of Backoff in both GrpcNetwork and StubNetwork implementations. Return values are wrapped in Some(...) to match the openraft 0.10.0-alpha.18+ API change.

Changes

NetBackoff Return Type Update

Layer / File(s) Summary
Trait Implementation
crates/coordinode-raft/src/cluster/network.rs
GrpcNetwork and StubNetwork backoff() methods now return Some(Backoff::new(...)) instead of Backoff directly, aligning with the openraft trait signature change.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating NetBackoff::backoff() return type to Option, which is the primary focus of this pull request.
Description check ✅ Passed The description clearly explains the cause (openraft 0.10.0-alpha.18 trait change), the solution (wrapping return values in Some), and provides context on why this fix is necessary for CI.
Linked Issues check ✅ Passed The pull request fully addresses issue #39 by updating both GrpcNetwork and StubNetwork implementations to return Option as required.
Out of Scope Changes check ✅ Passed All changes are scoped to updating the NetBackoff trait implementations in crates/coordinode-raft/src/cluster/network.rs, directly addressing the requirements in issue #39.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/#39-netbackoff-option

Review rate limit: 3/5 reviews remaining, refill in 14 minutes and 53 seconds.

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

@polaz polaz closed this May 2, 2026
@polaz polaz deleted the fix/#39-netbackoff-option branch May 2, 2026 23:11
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