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
{{ message }}
Repository navigation
asyncore does not handle EINTR in recv, send, connect, accept, #55475
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2014-07-24.16:36:25.826>created_at=<Date2011-02-21.05:31:30.435>labels= ['type-bug', 'library']
title='asyncore does not handle EINTR in recv, send, connect, accept,'updated_at=<Date2014-07-24.16:36:25.825>user='https://github.com/socketpair'
Again, it's not clear to me what you are complaining about.
Please try to be more clear and/or provide a patch.
socketpair commented on Mar 5, 2011
socketpairmannequin
MannequinAuthor
More actions
When using non-blocking IO, we issue select (or poll,epoll), and after that kernel should guarantee, that recv or send will complete immediatelly, transferring data as needed. But sometimes (as Linux is buggy), such operations results in EINTR error if some signal arrived during this call. In that case python exception generated and typically connection will be closed.
To recover from this situation it is OK to call recv or send again in case of EINTR. All network functions (recv*, send*, accept, connect) are vulnerable for EINTR in practice.
It was already discussed in other issues, the issue is not specific to asyncore: Python code should not handle EINTR. IMO the C module socket should handle EINTR for you.
Activity
socketpair commentedon Feb 21, 2011
in spite of usage of non-blocking IO, syscalls may return EINTR if signal arrive during some syscalls.
It is desirable to re-call syscall after receiving EINTR. Trivial loops should be implemented around (recv, send, connect, accept)
giampaolo commentedon Mar 3, 2011
Again, it's not clear to me what you are complaining about.
Please try to be more clear and/or provide a patch.
socketpair commentedon Mar 5, 2011
When using non-blocking IO, we issue select (or poll,epoll), and after that kernel should guarantee, that recv or send will complete immediatelly, transferring data as needed. But sometimes (as Linux is buggy), such operations results in EINTR error if some signal arrived during this call. In that case python exception generated and typically connection will be closed.
To recover from this situation it is OK to call recv or send again in case of EINTR. All network functions (recv*, send*, accept, connect) are vulnerable for EINTR in practice.
socketpair commentedon Mar 5, 2011
http://unix.derkeiler.com/Mailing-Lists/FreeBSD/hackers/2008-02/msg00457.html
Okay, linux is not buggy :)))
EINTR may occur if SA_RESTART is not specified in sigaction.
nvetoshkin commentedon Mar 5, 2011
Here's a similar bug: http://bugs.python.org/issue7978.
vstinner commentedon Jun 27, 2014
It was already discussed in other issues, the issue is not specific to asyncore: Python code should not handle EINTR. IMO the C module socket should handle EINTR for you.