[issue7322] Socket timeout can cause file-like readline() method to lose data

R. David Murray report at bugs.python.org
Thu Oct 20 20:01:15 CEST 2011


R. David Murray <rdmurray at bitdance.com> added the comment:

I don't think it is optimistic.  The poplib transaction pattern is: send a command, get a response.  If the response is not properly terminated, throw it away.  Send a new command, get a response.  There's no ambiguity there.  In addition, this is a common tcp client-server model, so I think it applies more widely than just poplib.

Please note that the timeout is *not* because the socket data transmission has timed out and data was lost in transit.  There are no partially filled readline buffers in this scenario.  The timeout is because the client is waiting for a *line* of data that the server never sends.  Again, this is likely to be a common failure mode in tcp client/server applications, and to my mind is exactly what the timeout parameter to the constructor is most useful for.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7322>
_______________________________________


More information about the Python-bugs-list mailing list