Skip to content

Commit

Permalink
fix (DISET): sentBytes should never be negative, otherwise we end up …
Browse files Browse the repository at this point in the history
…in an infinite loop
  • Loading branch information
ryuwd committed Oct 23, 2024
1 parent 56268a1 commit 5b7c54b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/DIRAC/Core/DISET/private/Transports/BaseTransport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5b7c54b

Please sign in to comment.