homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: asyncore does not handle EINTR in recv, send, connect, accept,
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7, Python 2.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: handle EINTR in the stdlib
View: 18885
Assigned To: Nosy List: giampaolo.rodola, nvetoshkin, segfaulthunter, socketpair, vstinner
Priority: normal Keywords:

Created on 2011年02月21日 05:31 by socketpair, last changed 2022年04月11日 14:57 by admin. This issue is now closed.

Messages (6)
msg128940 - (view) Author: Марк Коренберг (socketpair) * Date: 2011年02月21日 05:31
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)
msg130015 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2011年03月03日 23:24
Again, it's not clear to me what you are complaining about.
Please try to be more clear and/or provide a patch.
msg130103 - (view) Author: Марк Коренберг (socketpair) * Date: 2011年03月05日 05:09
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.
msg130104 - (view) Author: Марк Коренберг (socketpair) * Date: 2011年03月05日 05:12
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.
msg130106 - (view) Author: Vetoshkin Nikita (nvetoshkin) Date: 2011年03月05日 06:01
Here's a similar bug: http://bugs.python.org/issue7978.
>EINTR may occur if SA_RESTART is not specified in sigaction.
Some syscalls (like select) will generate EINTR despite SA_RESTART. man 7 signal
msg221748 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014年06月27日 22:29
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.
History
Date User Action Args
2022年04月11日 14:57:13adminsetgithub: 55475
2014年07月24日 16:36:25vstinnersetstatus: open -> closed
superseder: handle EINTR in the stdlib
resolution: duplicate
2014年06月27日 22:29:52vstinnersetnosy: + vstinner
messages: + msg221748
2011年03月05日 06:01:06nvetoshkinsetnosy: + nvetoshkin
messages: + msg130106
2011年03月05日 05:12:22socketpairsetnosy: giampaolo.rodola, segfaulthunter, socketpair
messages: + msg130104
2011年03月05日 05:09:45socketpairsetnosy: giampaolo.rodola, segfaulthunter, socketpair
messages: + msg130103
2011年03月03日 23:39:48segfaulthuntersetnosy: + segfaulthunter
2011年03月03日 23:24:28giampaolo.rodolasetnosy: + giampaolo.rodola
messages: + msg130015
2011年02月21日 05:31:30socketpaircreate

AltStyle によって変換されたページ (->オリジナル) /