Author sobomax
Recipients
Date 2007-01-04.21:37:50
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The socket.readline() interface doesn't handle EINTR properly. Currently, when EINTR received exception is not handled and all data that has been in the buffer is lost. There is no way to recover that data from the code that uses the interface.

Correct behaviour would be to catch EINTR and restart recv(). Patch is attached.

Following is the real world example of how it affects httplib module:

  File "/usr/local/lib/python2.4/xmlrpclib.py", line 1096, in __call__
    return self.__send(self.__name, args)
  File "/usr/local/lib/python2.4/xmlrpclib.py", line 1383, in __request
    verbose=self.__verbose
  File "/usr/local/lib/python2.4/xmlrpclib.py", line 1131, in request
    errcode, errmsg, headers = h.getreply()
  File "/usr/local/lib/python2.4/httplib.py", line 1137, in getreply
    response = self._conn.getresponse()
  File "/usr/local/lib/python2.4/httplib.py", line 866, in getresponse
    response.begin()
  File "/usr/local/lib/python2.4/httplib.py", line 336, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python2.4/httplib.py", line 294, in _read_status
    line = self.fp.readline()
  File "/usr/local/lib/python2.4/socket.py", line 325, in readline
    data = recv(1)
error: (4, 'Interrupted system call')

-Maxim
History
Date User Action Args
2007-08-23 15:56:00adminlinkissue1628205 messages
2007-08-23 15:56:00admincreate