Skip to content

Engine queue ignores channel priority when sub-queues register out of order #9583

Description

@Ma77Ball

What happened?

The engine's internal multi-queue serves messages by priority (control before data), but priority is honored only when sub-queues happen to be registered in increasing-priority order. If a data sub-queue (lower priority) is registered before a control sub-queue (higher priority), control messages are served after data.

How to reproduce?

Register sub-queues on a LinkedBlockingMultiQueue in decreasing-priority order (for example data at priority 1 before control at priority 0), enqueue one item on each, and observe that the lower-priority item is returned first. In code, add_sub_queue computes the correct insertion index i but appends the new priority group to the end instead of inserting it at i, so priority_groups is not kept sorted; get_next and peek iterate it in list order.

Version/Branch

main

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