Skip to content

Peeking a queue changes its next message #8225

Description

@carloea2

Feature Summary

PriorityGroup.peek() advances the shared round-robin cursor while skipping empty subqueues. A read-only peek can therefore change which message a later get() returns.

Before: peek skips an empty queue -> shared cursor advances -> later get returns a different queue

After: peek scans with a local cursor -> shared cursor stays unchanged -> later get preserves round-robin order

Expected behavior:

Peeking should report the next available message without changing queue selection state or the order of a later get.

Reproduction evidence:

Create two same-priority subqueues, enqueue only in the second, and call peek(). Then enqueue in the first and call get().

Observed on 70c21145887920528d7d5540e3fb790b43e8b759:

cursor_before_peek=0
peek=second
cursor_after_peek=1
next_after_peek=second
next_without_peek=first

Version and commit evidence:

1.3.0-incubating-SNAPSHOT (main)

Commit Hash (Optional)

70c21145887920528d7d5540e3fb790b43e8b759

Proposed Solution or Design

After: peek scans with a local cursor -> shared cursor stays unchanged -> later get preserves round-robin order

Expected behavior:

Affected Area

Workflow Engine (Amber)

Activity

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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions