Copilot commented on code in PR #6903:
URL: https://github.com/apache/texera/pull/6903#discussion_r3651786462
##########
amber/src/main/python/core/util/customized_queue/linked_blocking_multi_queue.py:
##########
@@ -418,15 +421,15 @@ def add_sub_queue(self, key: K, priority: int) ->
Optional[SubQueue]:
added = True
break
elif pg.priority > priority:
- new_pg =
LinkedBlockingMultiQueue.PriorityGroup(priority)
+ new_pg = self.PriorityGroup(priority)
new_pg.add_queue(sub_queue)
self.priority_groups.append(new_pg)
added = True
Review Comment:
When inserting a new PriorityGroup with higher priority than an existing
group (pg.priority > priority), the code appends the new group to the end of
priority_groups. This breaks the intended priority ordering (smaller number =
higher priority) and can cause selection to prefer lower-priority groups added
earlier (e.g., adding priorities 0,2 then 1 results in [0,2,1]). Use insert at
the current index instead of append.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]