[Bug]: _recv_line() can block on partial TCP receive #1
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
_recv_line()can block indefinitely if the newline does not arrive at the end of a singlerecv()chunk.Current code
Why this is a bug
recv(4096)can return partial TCP chunks.If the instrument sends
OK\nbut it arrives as two calls such asOK+\n, theb.endswith(b"\n")check on the first chunk misses the line ending. That can leave the function waiting longer than expected or blocking until timeout or socket close.Fix approach
Accumulate into a
bytearrayand check the joined buffer forb"\n"instead of only checking the most recent chunk.Status
Local fix already implemented in the current v0.2 working copy.
Still needs commit, push, and hardware verification before closing.
_recv_line() can block on partial TCP receiveto [Bug]: _recv_line() can block on partial TCP receive