Skip to content

fix(harness): honor node and engine retry policies in Pregel - #18388

Merged
yingfeng merged 1 commit into
infiniflow:mainfrom
Lem0nTea2002:fix/preserve-node-retry-policy
Aug 17, 2026
Merged

yingfeng merged 1 commit into
infiniflow:mainfrom
Lem0nTea2002:fix/preserve-node-retry-policy

Conversation

@Lem0nTea2002

Copy link
Copy Markdown
Contributor

Summary

Pregel nodes created with AddNodeWithOptions retain a node-level RetryPolicy, but task construction dropped that policy. When a task had no policy, execution also bypassed the engine-level policy configured with WithRetryPolicy and instantiated the default policy directly.

This change:

  • copies each node's retry policy into execution and inspection tasks;
  • resolves policy precedence consistently as node, engine, then default;
  • applies the same resolution in streamed and direct task execution;
  • adds deterministic regression coverage for task construction, node-policy precedence, and engine-policy fallback.

Validation

  • go test -mod=readonly -count=100 -run '^(TestEngine_TaskConstructionPreservesNodeRetryPolicy|TestRetry_NodePolicyOverridesEnginePolicy|TestRetry_EnginePolicyFallback)$' ./internal/harness/graph/pregel
  • go test -race -mod=readonly -count=10 -run '^(TestEngine_TaskConstructionPreservesNodeRetryPolicy|TestRetry_NodePolicyOverridesEnginePolicy|TestRetry_EnginePolicyFallback)$' ./internal/harness/graph/pregel
  • go vet ./internal/harness/graph/pregel
  • git diff --check origin/main..HEAD

All targeted checks passed on Windows amd64 with Go 1.26.4. The repository-standard build script stopped during native dependency setup because the local office_oxide, pdfium, and pdf_oxide static-library cache is unavailable.

@coderabbitai

coderabbitai Bot commented Aug 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 06a5b27c-c674-4ef5-aed3-c22b3dc741b5

📥 Commits

Reviewing files that changed from the base of the PR and between 9c81d9b and 2e06203.

📒 Files selected for processing (3)
  • internal/harness/graph/pregel/engine.go
  • internal/harness/graph/pregel/engine_test.go
  • internal/harness/graph/pregel/pregel_retry_comprehensive_test.go

Included review availability: Your plan includes up to 10 reviews per rolling hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Task creation now preserves node retry policies. Synchronous and asynchronous execution share precedence resolution: node policy, engine policy, then default policy. Tests cover task construction, node overrides, and engine fallback.

Changes

Retry Policy Resolution

Layer / File(s) Summary
Task policy propagation
internal/harness/graph/pregel/engine.go, internal/harness/graph/pregel/engine_test.go
Generated execution and inspection tasks retain each node’s retry policy. Tests verify both task representations.
Execution policy resolution
internal/harness/graph/pregel/engine.go
Synchronous and asynchronous execution use the shared resolver with node, engine, and default policy precedence.
Retry policy validation
internal/harness/graph/pregel/pregel_retry_comprehensive_test.go
Tests verify that node policy overrides engine policy and that engine policy applies when no node policy exists.

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

Merge Risk: ⚪ Minimal · up to 2e062

This change preserves node-level retry settings and correctly falls back to the configured engine policy, with focused validation covering the affected behavior. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: yingfeng

Poem

I’m a rabbit with retries tucked tight,
Node rules hop first, then engine light.
Tasks keep their policies safe,
Attempts count in a steady pace,
And defaults wait for their turn tonight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% 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 clearly and concisely describes the retry-policy changes for Pregel nodes and the engine.
Description check ✅ Passed The description includes the required Summary section, explains the problem and solution, and documents validation results and limitations.
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.

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.

@Lem0nTea2002
Lem0nTea2002 marked this pull request as ready for review August 17, 2026 13:01
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. labels Aug 17, 2026
@yingfeng yingfeng added the ci Continue Integration label Aug 17, 2026
@yingfeng
yingfeng merged commit 110ed63 into infiniflow:main Aug 17, 2026
11 of 12 checks passed
jay77721 pushed a commit to jay77721/ragflow that referenced this pull request Aug 18, 2026
…low#18388)

### Summary

Pregel nodes created with `AddNodeWithOptions` retain a node-level
`RetryPolicy`, but task construction dropped that policy. When a task
had no policy, execution also bypassed the engine-level policy
configured with `WithRetryPolicy` and instantiated the default policy
directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants