gemini-code-assist[bot] commented on code in PR #37528:
URL: https://github.com/apache/beam/pull/37528#discussion_r2775892888


##########
sdks/python/apache_beam/ml/inference/model_manager.py:
##########
@@ -508,19 +538,17 @@ def acquire_model(self, tag: str, loader_func: 
Callable[[], Any]) -> Any:
 
       finally:
         # Remove self from wait queue once done
-        if self._wait_queue and self._wait_queue[0][2] is my_id:
+        if self._wait_queue and self._wait_queue[0].ticket_num == ticket_num:
           heapq.heappop(self._wait_queue)
         else:
           logger.warning(
               "Item not at head of wait queue during cleanup"
               ", this is not expected: tag=%s ticket num=%s",
               tag,
               ticket_num)

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The warning message 'Item not at head of wait queue during cleanup, this is 
not expected' might be misleading now that the `_cancelled_tickets` mechanism 
is in place. If a ticket is not at the head, it is now explicitly marked as 
cancelled, which is an expected behavior for tickets that are no longer needed 
but haven't reached the head of the queue yet. This warning could imply an 
error state when it's actually a handled scenario. Consider rephrasing or 
removing this warning if it no longer indicates an unexpected condition.



-- 
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]

Reply via email to