[issue20611] socket.create_connection() doesn't handle EINTR properly

tholzer report at bugs.python.org
Mon May 26 05:42:02 CEST 2014


tholzer added the comment:

I've also attached a potential patch for the C module Modules/socketmodule.c inside internal_connect().

A few notes:

This seems to work both without time-out and with time-out sockets (non-blocking).

One concern would be a signal storm prolonging the operation beyond the time-out. Should we keep track of the actual time taken in this loop and check it against the 'timeout' parameter ?

Also, I don't think we can call PyErr_CheckSignals() in this context. Does this need to happen at all ?

----------
Added file: http://bugs.python.org/file35360/socketmodule_2.7.6_eintr_patch.c

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


More information about the Python-bugs-list mailing list