diff --git a/jina/serve/networking.py b/jina/serve/networking.py index 54dab66097d0c..4eade14858478 100644 --- a/jina/serve/networking.py +++ b/jina/serve/networking.py @@ -1013,7 +1013,6 @@ async def task_wrapper(): connection_list=connections, ) if error: - print(f'--->returning error: {type(error)}') return error return asyncio.create_task(task_wrapper()) diff --git a/jina/serve/runtimes/gateway/graph/topology_graph.py b/jina/serve/runtimes/gateway/graph/topology_graph.py index a261ae189289c..df4554c0052cd 100644 --- a/jina/serve/runtimes/gateway/graph/topology_graph.py +++ b/jina/serve/runtimes/gateway/graph/topology_graph.py @@ -141,9 +141,7 @@ async def _wait_previous_and_send( need_copy=not copy_request_at_send ) if self._reduce and len(self.parts_to_send) > 1: - self.parts_to_send = [ - WorkerRequestHandler.reduce_requests(self.parts_to_send) - ] + WorkerRequestHandler.reduce_requests(self.parts_to_send) # avoid sending to executor which does not bind to this endpoint if endpoint is not None and executor_endpoint_mapping is not None: diff --git a/jina/serve/runtimes/head/__init__.py b/jina/serve/runtimes/head/__init__.py index 5b5fc1ab3a966..81edf40c628d4 100644 --- a/jina/serve/runtimes/head/__init__.py +++ b/jina/serve/runtimes/head/__init__.py @@ -382,7 +382,8 @@ async def _handle_data_request( else: response_request, uses_after_metadata = result elif len(worker_results) > 1 and self._reduce: - response_request = WorkerRequestHandler.reduce_requests(worker_results) + # reduce in place + WorkerRequestHandler.reduce_requests(worker_results) elif len(worker_results) > 1 and not self._reduce: # worker returned multiple responses, but the head is configured to skip reduction # just concatenate the docs in this case diff --git a/jina/serve/runtimes/request_handlers/worker_request_handler.py b/jina/serve/runtimes/request_handlers/worker_request_handler.py index 5e132fe632d6f..88f0bb5573e86 100644 --- a/jina/serve/runtimes/request_handlers/worker_request_handler.py +++ b/jina/serve/runtimes/request_handlers/worker_request_handler.py @@ -463,5 +463,3 @@ def reduce_requests(requests: List['DataRequest']) -> 'DataRequest': params = WorkerRequestHandler.get_parameters_dict_from_request(requests) WorkerRequestHandler.replace_parameters(requests[0], params) - - return requests[0]