Skip to content

fix: reset iteration cursor in OneOnEach.initialize#5028

Open
Ma77Ball wants to merge 2 commits into
apache:mainfrom
Ma77Ball:fix/resetIterationCursor
Open

fix: reset iteration cursor in OneOnEach.initialize#5028
Ma77Ball wants to merge 2 commits into
apache:mainfrom
Ma77Ball:fix/resetIterationCursor

Conversation

@Ma77Ball
Copy link
Copy Markdown
Contributor

@Ma77Ball Ma77Ball commented May 12, 2026

What changes were proposed in this PR?

OneOnEach.initialize now resets index to 0 in addition to replacing the available array. Previously, re-initializing an existing instance left the cursor at its prior position, causing next() to skip elements or
throw IndexOutOfBoundsException when the new array was shorter than the old cursor value.

Any related issues, documentation, or discussions?

Closes: #4731

How was this PR tested?

  • Updated DeployStrategiesSpec so the previously-pinned "cursor survives re-initialization" test now asserts the corrected behavior (cursor reset, new array fully consumed, exhaustion still raises
    IndexOutOfBoundsException).
  • sbt "WorkflowExecutionService/testOnly ...DeployStrategiesSpec" — 13/13 pass.

Was this PR authored or co-authored using generative AI tooling?

Co-authored with Claude Opus 4.7 in compliance with ASF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OneOnEach deploy strategy does not reset iteration cursor on re-initialize

1 participant