Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ def _handle_request(self, req_meta: dict[str, Any]):
f"{remote_request_id}: {e}",
exc_info=True)
finally:
self._send_done_signal_to_free_remote_port(remote_request_id, remote_host,
remote_port_send_num)
Comment on lines +447 to +448
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Moving this call to the beginning of the finally block correctly resolves a race condition. For multi-task requests, the run-once flag (self.proc_not_transfer_request) was previously deleted on the final task before this function was called, causing its logic to execute twice. This change ensures the flag is checked before it's cleared when all_task_done is true, preventing the double execution.

if all_task_done:
self.task_tracker.update_done_task_count(request_id)
if request_id in self.proc_not_transfer_request:
Expand All @@ -455,8 +457,6 @@ def _handle_request(self, req_meta: dict[str, Any]):
self._send_done_recv_signal(remote_request_id, remote_host,
remote_handshake_port,
remote_port_send_num)
self._send_done_signal_to_free_remote_port(remote_request_id, remote_host,
remote_port_send_num)

def _send_done_signal_to_free_remote_port(self, request_id, remote_host,
remote_port_send_num):
Expand Down
Loading