Skip to content

Commit 9d30c2a

Browse files
committed
fix(serialization): Add extra logging statements for pwrite
1 parent 5e5fe76 commit 9d30c2a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tensorizer/serialization.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3549,7 +3549,15 @@ def _pwrite_syscall(
35493549
)
35503550
if bytes_just_written == 0:
35513551
if requested_write_size == 0:
3552-
logger.error("pwrite: Attempted to write 0 bytes")
3552+
if logger.isEnabledFor(logging.ERROR):
3553+
logger.error(
3554+
(
3555+
"pwrite: Attempted to write 0 bytes,"
3556+
" original size: %d, original type: %s"
3557+
),
3558+
self._buffer_size(data),
3559+
repr(data.__class__.__name__),
3560+
)
35533561
break
35543562
attempts += 1
35553563
logger.debug("pwrite: Retrying (attempt %d/3)", attempts)

0 commit comments

Comments
 (0)