Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added debug info for memoryview error #2908

Merged
merged 3 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
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
17 changes: 12 additions & 5 deletions nvflare/fuel/f3/streaming/blob_streamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)


Expand Down
5 changes: 5 additions & 0 deletions nvflare/private/aux_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading