From 5b7c54b5983cd882780a05d6c3f28c984fd73b6a Mon Sep 17 00:00:00 2001 From: Ryunosuke O'Neil Date: Wed, 23 Oct 2024 11:00:02 +0200 Subject: [PATCH] fix (DISET): sentBytes should never be negative, otherwise we end up in an infinite loop --- src/DIRAC/Core/DISET/private/Transports/BaseTransport.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/DIRAC/Core/DISET/private/Transports/BaseTransport.py b/src/DIRAC/Core/DISET/private/Transports/BaseTransport.py index d3fb1e618eb..2e8558f7b99 100755 --- a/src/DIRAC/Core/DISET/private/Transports/BaseTransport.py +++ b/src/DIRAC/Core/DISET/private/Transports/BaseTransport.py @@ -176,6 +176,8 @@ def sendData(self, uData, prefix=b""): sentBytes = result["Value"] except Exception as e: return S_ERROR(f"Exception while sending data: {e}") + if sentBytes < 0: + return S_ERROR("Unknown unrecoverable error from socket while sending data") if sentBytes == 0: return S_ERROR("Connection closed by peer") packSentBytes += sentBytes