diff --git a/nvflare/fuel/f3/streaming/blob_streamer.py b/nvflare/fuel/f3/streaming/blob_streamer.py index 53a7075981..e3ba9ab11c 100644 --- a/nvflare/fuel/f3/streaming/blob_streamer.py +++ b/nvflare/fuel/f3/streaming/blob_streamer.py @@ -109,10 +109,17 @@ def _read_stream(blob_task: BlobTask): break length = len(buf) - if blob_task.pre_allocated: - blob_task.buffer[buf_size : buf_size + length] = buf - else: - blob_task.buffer.append(buf) + try: + if blob_task.pre_allocated: + blob_task.buffer[buf_size : buf_size + length] = buf + else: + blob_task.buffer.append(buf) + except Exception as ex: + log.error( + f"memory view error: {ex} " + f"Debug info: {length=} {buf_size=} {len(blob_task.pre_allocated)=} {type(buf)=}" + ) + raise ex buf_size += length @@ -129,7 +136,7 @@ def _read_stream(blob_task: BlobTask): blob_task.future.set_result(result) except Exception as ex: log.error(f"Stream {blob_task.future.get_stream_id()} read error: {ex}") - log.debug(secure_format_traceback()) + log.error(secure_format_traceback()) blob_task.future.set_exception(ex) diff --git a/nvflare/private/aux_runner.py b/nvflare/private/aux_runner.py index be7bc8d436..a808652d10 100644 --- a/nvflare/private/aux_runner.py +++ b/nvflare/private/aux_runner.py @@ -132,6 +132,11 @@ def dispatch(self, topic: str, request: Shareable, fl_ctx: FLContext) -> Shareab Returns: reply message """ + + if not isinstance(request, Shareable): + self.log_error(fl_ctx, f"received invalid aux request: expects a Shareable but got {type(request)}") + return make_reply(ReturnCode.BAD_REQUEST_DATA) + peer_props = request.get_peer_props() if peer_props: peer_ctx = FLContext()