From 902da9071f67d00ea979f2e6dfe2113096053416 Mon Sep 17 00:00:00 2001 From: ChengjieLi Date: Mon, 31 Jul 2023 14:04:52 +0800 Subject: [PATCH] fix ucx buffer of size 0 --- python/xoscar/backends/communication/ucx.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/xoscar/backends/communication/ucx.py b/python/xoscar/backends/communication/ucx.py index 09a17c4e..cc66f7fb 100644 --- a/python/xoscar/backends/communication/ucx.py +++ b/python/xoscar/backends/communication/ucx.py @@ -312,8 +312,7 @@ async def send_buffers(self, buffers: list, meta: Optional[_MessageBase] = None) for buf in meta_buffers: await self.ucp_endpoint.send(buf) for buffer in buffers: - if buffer.nbytes if hasattr(buffer, "nbytes") else len(buffer) > 0: - await self.ucp_endpoint.send(buffer) + await self.ucp_endpoint.send(buffer) except ucp.exceptions.UCXBaseException: # pragma: no cover self.abort() raise ChannelClosed("While writing, the connection was closed")