aglinxinyuan commented on code in PR #6522:
URL: https://github.com/apache/texera/pull/6522#discussion_r3643188568
##########
amber/src/main/python/core/architecture/handlers/control/end_worker_handler.py:
##########
@@ -37,13 +37,19 @@ async def end_worker(self, req: EmptyRequest) ->
EmptyReturn:
has finished not only the data processing logic, but also the
processing
of all the control messages.
"""
- # Ensure this is really the last message.
- input_queue: IQueue = self.context.input_queue
- if not input_queue.is_empty():
+ # Ensure this is really the last message. Read the queued count once
(InternalQueue
+ # exposes size(); the base IQueue interface does not) and branch on it.
+ input_queue: InternalQueue = self.context.input_queue
+ queued_count = input_queue.size()
Review Comment:
Good catch — the description was stale from the original `peek()`-based
version. Updated it to match the current diff: the guard reads the pending
count once via `size()` and raises (no `peek()`, so `internal_queue.py` /
`test_internal_queue.py` are untouched), and the PR now changes only
`end_worker_handler.py` plus its new test.
--
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]