Skip to content

fix: Wrap for_each iteration execution in retry loop with exponential backoff#182

Closed
ducks wants to merge 1 commit intomainfrom
fix/issue-153-1770445821
Closed

fix: Wrap for_each iteration execution in retry loop with exponential backoff#182
ducks wants to merge 1 commit intomainfrom
fix/issue-153-1770445821

Conversation

@ducks
Copy link
Owner

@ducks ducks commented Feb 7, 2026

Issue

Closes #153: Bug: for_each iterations don't retry on timeout

Why this issue?

Clear bug with defined scope - for_each loops don't retry on timeout while regular steps do. The fix location is identified (src/workflow.rs:527-591), the expected behavior is clear (match retry behavior of regular steps at lines 683-698, 795-808), and it's a focused code change to add retry logic to the for_each timeout handling path.

Fix

Wrap for_each iteration execution in retry loop with exponential backoff

This fix was developed through Claude + Codex + Gemini consensus.


Automated fix by lok pick-and-fix workflow.

@ducks
Copy link
Owner Author

ducks commented Feb 8, 2026

lok Review (Claude + Codex + Gemini consensus)

Verdict: REQUEST_CHANGES

Core retry logic approach is sound and matches existing patterns, but PR cannot merge as-is due to compilation failure against current main (ARF removal) and inclusion of artifact files.

Critical: - PR is out of date with main - references removed ARF module that will fail to compile (arf.lock(), arf.retry_attempt() no longer exist after 2026-02-08 ARF removal)

  • 38 spurious .arf/records/ files committed that are workflow execution artifacts, not part of the fix

Important: - Potential overflow on retry backoff calculation if max_retries is large; 2_u64.pow(attempt - 1) can overflow (src/workflow.rs:760)

  • Retry loop reuses single backend instance across attempts; if backend enters bad state after failure, subsequent retries may not recover (src/workflow.rs:739, src/workflow.rs:779)
  • Missing config reference - PR uses config.defaults but may need self.config depending on scope (src/workflow.rs:747)
  • last_error not cleared on success which could mislead future logging/reporting

Minor: - Retry log reports attempt/max_retries but attempts are 0..=max_retries, making 'Retry 1/3' actually attempt 1 of 4 total (src/workflow.rs:767)

  • Inconsistent error message format compared to regular steps
  • Missing retry status logging for iterations that regular shell steps have

Automated review by lok review-pr workflow

@ducks
Copy link
Owner Author

ducks commented Feb 8, 2026

Closing - stale after ARF removal. Will regenerate via pick-and-fix if issue #153 is still prioritized.

@ducks ducks closed this Feb 8, 2026
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: for_each iterations don't retry on timeout

1 participant