You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be better to just implement the retrying version
of select directly.
It would be nice to share more code between subprocess and multiprocessing, but I don't know where such code should be moved. Create a new module just for one function is stupid. Handling EINTR is a common problem when managing subprocesses.
subprocess has a _eintr_retry_call() function.
multiprocessing has a @_eintr_retry decorator handling supporting more error types (use except (EnvironmentError, select.error):).
sbt commented on Mar 16, 2012
sbtmannequin
MannequinAuthor
More actions
_eintr_retry is currently unused. The attached patch removes it.
If it is retained then we should at least add a warning that it does not recalculate timeouts.
Activity
sbt commentedon Jun 15, 2011
multiprocessing.util._eintr_retry is only used to wrap select.select, but it fails to recalculate timeouts.
Also, it will never retry the function it wraps because of a missing "import errno".
I think it would be better to just implement the retrying version of select directly.
vstinner commentedon Jun 19, 2011
subprocess._communicate_with_select() retries select.select() on EINTR: it recomputes timeout before each call.
It has a similar code for select.poll().
asyncore.poll() handles EINTR: it just returns.
It would be nice to share more code between subprocess and multiprocessing, but I don't know where such code should be moved. Create a new module just for one function is stupid. Handling EINTR is a common problem when managing subprocesses.
subprocess has a _eintr_retry_call() function.
multiprocessing has a @_eintr_retry decorator handling supporting more error types (use except (EnvironmentError, select.error):).
sbt commentedon Mar 16, 2012
_eintr_retry is currently unused. The attached patch removes it.
If it is retained then we should at least add a warning that it does not recalculate timeouts.
pitrou commentedon Mar 16, 2012
AFAICT it's still used in forking.py.
vstinner commentedon Apr 8, 2012
SocketServer has been changed to restart select() on EINTR, but it doesn't recompute the timeout.
vstinner commentedon Apr 8, 2012
See issue bpo-7978.
pitrou commentedon Apr 8, 2012
Note that socketserver's timeout is not really important: it's just used for a polling loop, with a default of 0.5 seconds.
sbt commentedon May 25, 2012
_eintr_retry was removed by 99ef4501205b.