Skip to content

Commit

Permalink
fix(serialization): Add extra logging statements for pwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Eta0 committed Nov 25, 2024
1 parent 5e5fe76 commit 9d30c2a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tensorizer/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -3549,7 +3549,15 @@ def _pwrite_syscall(
)
if bytes_just_written == 0:
if requested_write_size == 0:
logger.error("pwrite: Attempted to write 0 bytes")
if logger.isEnabledFor(logging.ERROR):
logger.error(
(
"pwrite: Attempted to write 0 bytes,"
" original size: %d, original type: %s"
),
self._buffer_size(data),
repr(data.__class__.__name__),
)
break
attempts += 1
logger.debug("pwrite: Retrying (attempt %d/3)", attempts)
Expand Down

0 comments on commit 9d30c2a

Please sign in to comment.