Skip to content

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

Closed

Description

@Yicong-Huang

What happened?

amber/src/main/scala/org/apache/texera/amber/engine/architecture/deploysemantics/deploystrategy/OneOnEach.scala::OneOnEach.initialize replaces available but leaves index at its prior value. A reused instance re-initialized with a new array continues counting from the prior position and may report the new array as exhausted before any element is returned.

How to reproduce?

val s = OneOnEach()
s.initialize(Array(nodeA, nodeB)); s.next(); s.next()  // index = 2
s.initialize(Array(nodeC))                              // index NOT reset
s.next()  // throws IndexOutOfBoundsException — new array has 1 element but index already 2

Version

1.1.0-incubating (Pre-release/Master)

Activity

  1. added theissue type on May 3, 2026
  2. Ma77Ball commented on May 11, 2026

    @Ma77Ball
    Contributor

    /take

  3. added a commit that references this issue on May 13, 2026
    bb6b52b
  4. added a commit that references this issue on Jun 22, 2026
    09bc6dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions