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: asyncio: SelectorEventLoop.sock_connect() must not retry connect() on InterruptedError
Type: Stage:
Components: asyncio Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, python-dev, vstinner, yselivanov
Priority: normal Keywords: patch

Created on 2015-04-07 08:23 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
connect_eintr.patch vstinner, 2015-04-07 08:23 review
Messages (4)
msg240195 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-04-07 08:23
According to the issue #23618, when connect() fails with EINTR, retrying connect() may only work on some platforms. To have a reliable behaviour on all platforms, we should wait until the socket becomes writable because the connection runs asynchronously in background. When the socket becomes writable, we have to gets its error code (getsockopt(SO_ERROR)) to check if the connection succeeded or failed.

Attached patch fixes SelectorEventLoop.sock_connect().
msg240214 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2015-04-07 15:45
LGTM.
On Apr 7, 2015 1:23 AM, "STINNER Victor" <report@bugs.python.org> wrote:

>
> New submission from STINNER Victor:
>
> According to the issue #23618, when connect() fails with EINTR, retrying
> connect() may only work on some platforms. To have a reliable behaviour on
> all platforms, we should wait until the socket becomes writable because the
> connection runs asynchronously in background. When the socket becomes
> writable, we have to gets its error code (getsockopt(SO_ERROR)) to check if
> the connection succeeded or failed.
>
> Attached patch fixes SelectorEventLoop.sock_connect().
>
> ----------
> components: asyncio
> files: connect_eintr.patch
> keywords: patch
> messages: 240195
> nosy: gvanrossum, haypo, yselivanov
> priority: normal
> severity: normal
> status: open
> title: asyncio: SelectorEventLoop.sock_connect() must not retry connect()
> on InterruptedError
> versions: Python 3.4, Python 3.5
> Added file: http://bugs.python.org/file38854/connect_eintr.patch
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue23879>
> _______________________________________
>
msg240226 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-04-07 19:40
New changeset eca51493c770 by Victor Stinner in branch '3.4':
Issue #23879, asyncio: SelectorEventLoop.sock_connect() must not call connect()
https://hg.python.org/cpython/rev/eca51493c770
msg240227 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-04-07 19:41
> LGTM.

Thanks for the review.
History
Date User Action Args
2022-04-11 14:58:15adminsetgithub: 68067
2015-04-07 19:41:02vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg240227
2015-04-07 19:40:45python-devsetnosy: + python-dev
messages: + msg240226
2015-04-07 15:45:22gvanrossumsetmessages: + msg240214
2015-04-07 08:23:09vstinnercreate