Roundup Robot added the comment:
New changeset bff88c866886 by Victor Stinner in branch 'default':
Issue #23618: Fix internal_select() for negative timeout (blocking socket) when
https://hg.python.org/cpython/rev/bff88c866886
--
___
Python tracker
STINNER Victor added the comment:
Example of test_connect_eintr3.py output on OpenIndiana:
Register SIGINT
Register SIGALRM
Register SIGWINCH
Register SIGTERM
Register SIGCHLD
Send SIGALRM every 200.0 ms
Run func() during 5.0 seconds
Type CTRL+c, resize the window, etc.
Roundup Robot added the comment:
New changeset 75fcc7a3738a by Victor Stinner in branch 'default':
Issue #23618: socket.socket.connect() now waits until the connection completes
https://hg.python.org/cpython/rev/75fcc7a3738a
--
___
Python tracker
STINNER Victor added the comment:
http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.x/builds/2904/steps/test/logs/stdio
==
FAIL: test_connect_ex_error (test.test_ssl.NetworkedTests)
STINNER Victor added the comment:
test_connect_eintr3.py: even better:
- block signals in the server thread
- count signals during connect()
- display progress: * for signal received during connect(), _ for signal
received before/after connect(), [ and ] for the beginning and end of a
Roundup Robot added the comment:
New changeset 44adbb5eeb4b by Victor Stinner in branch 'default':
Issue #23618: Fix sock_connect_impl(), set the socket error code
https://hg.python.org/cpython/rev/44adbb5eeb4b
--
___
Python tracker
STINNER Victor added the comment:
test_connnect_eintr.py: program to interrupt socket.connect() with signals. It
looks like socket.connect() cannot be interrupted by signals: connect() only
fails with WSAEINTR when WSACancelBlockingCall() is called, but
WSACancelBlockingCall() has been
STINNER Victor added the comment:
Hum, connect() does not always block with test_connect_eintr.py, and this
program sometimes fail with ConnectionResetError on connect() on FreeBSD.
New program which works on Linux and FreeBSD. It now ensures that connect()
will block.
--
Added file:
STINNER Victor added the comment:
Example of test_connect_eintr3.py output on Linux (3.18):
Register SIGINT
Register SIGALRM
Register SIGWINCH
Register SIGTERM
Register SIGCHLD
Send SIGALRM every 200.0 ms
Run func() during 5.0 seconds
Type CTRL+c, resize the window, etc.
Roundup Robot added the comment:
New changeset aad52bfc816f by Victor Stinner in branch 'default':
Issue #23618: Don't declare recvmsg/sendmsg helper functions on Windows
https://hg.python.org/cpython/rev/aad52bfc816f
New changeset f22188acc77d by Victor Stinner in branch 'default':
Issue
Changes by STINNER Victor victor.stin...@gmail.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23618
___
Roundup Robot added the comment:
New changeset 09a4d5cc6afd by Victor Stinner in branch 'default':
Issue #23618: Ooops, remove abort() added for debug purpose
https://hg.python.org/cpython/rev/09a4d5cc6afd
--
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset 8ec4acfdb851 by Victor Stinner in branch 'default':
Issue #23618: Fix EINTR handling on Windows
https://hg.python.org/cpython/rev/8ec4acfdb851
--
___
Python tracker rep...@bugs.python.org
Changes by STINNER Victor victor.stin...@gmail.com:
Removed file: http://bugs.python.org/file38743/test_selectors.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23618
___
Roundup Robot added the comment:
New changeset e8246baad0f6 by Victor Stinner in branch 'default':
Issue #23618: Refactor the _socket module
https://hg.python.org/cpython/rev/e8246baad0f6
New changeset fa5542660b17 by Victor Stinner in branch 'default':
Issue #23618: Refactor internal_select()
Roundup Robot added the comment:
New changeset 47b2d1ff9743 by Victor Stinner in branch 'default':
Issue #23618: Fix internal_connect_select()
https://hg.python.org/cpython/rev/47b2d1ff9743
--
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset daf3d2a717e5 by Victor Stinner in branch 'default':
Issue #23618: Refactor internal_connect()
https://hg.python.org/cpython/rev/daf3d2a717e5
New changeset c59d81b802f8 by Victor Stinner in branch 'default':
Issue #23618: Refactor internal_connect()
Roundup Robot added the comment:
New changeset d9374864d4a9 by Victor Stinner in branch 'default':
Issue #23618: Cleanup internal_connect() in socketmodule.c
https://hg.python.org/cpython/rev/d9374864d4a9
New changeset 4fad2b9fc4e6 by Victor Stinner in branch 'default':
Issue #23618: Fix EINTR
STINNER Victor added the comment:
Le mardi 31 mars 2015, Roundup Robot rep...@bugs.python.org a écrit :
New changeset c59d81b802f8 by Victor Stinner in branch 'default':
Issue #23618: Refactor internal_connect()
https://hg.python.org/cpython/rev/c59d81b802f8
Oh I forgot to add an #ifdef
STINNER Victor added the comment:
connect_eintr-4.patch: Updated patch after all my changes to refactor
socket.connect() (which is now almost a rewrite from scratch!).
--
Added file: http://bugs.python.org/file38766/connect_eintr-4.patch
___
Python
Roundup Robot added the comment:
New changeset 7ed567ad8b4c by Victor Stinner in branch 'default':
Issue #23618: Enhance EINTR handling in socket.connect()
https://hg.python.org/cpython/rev/7ed567ad8b4c
--
___
Python tracker rep...@bugs.python.org
Changes by STINNER Victor victor.stin...@gmail.com:
Added file: http://bugs.python.org/file38767/connect_eintr-4.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23618
___
STINNER Victor added the comment:
test_selectors.patch: Enhance test_selector to test the two kinds of signal
handlers: one raises an exception, the other one doesn't. I wait until kqueue
devpoll retry on EINTR to push test_selectors.patch.
--
Added file:
Changes by STINNER Victor victor.stin...@gmail.com:
--
title: PEP 475: handle EINTR in the socket module - PEP 475: handle EINTR in
the socket module (connect)
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23618
Roundup Robot added the comment:
New changeset f841d3bc30ee by Victor Stinner in branch 'default':
Issue #23618, #22117: refactor socketmodule.c
https://hg.python.org/cpython/rev/f841d3bc30ee
--
nosy: +python-dev
___
Python tracker
STINNER Victor added the comment:
I tested polling+getsockopt(SO_ERROR) with connect_test.c on Linux, it works:
haypo@smithers$ gcc -D TEST_TWO=1 connect_test.c -o connect_test
haypo@smithers$ ./connect_test
Will try to connect to 127.0.0.1 on port 80
(connect has been interrupted and now
Charles-François Natali added the comment:
Could you regenerate your latest patch?
It doesn't show properly in the review tool.
Also, what's with the assert?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23618
STINNER Victor added the comment:
connect_eintr.py: script calling socket.connect() in a loop and sending SIGARLM
signal every millisecond.
--
Added file: http://bugs.python.org/file38408/connect_eintr.py
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
Oops, connect_eintr.py noticed me (thanks to my recent change of the issue
#23571 !) that connect_eintr.patch is wrong: socket.connect() returned None
with an exception sent, send connect() was interrupted by SIGINT (CTRL+c).
Fixed patch.
--
Added
STINNER Victor added the comment:
http://www.madore.org/~david/computers/connect-intr.html
This article contains a program connect_test.c to test how connect() behaves on
EINTR. Since it's in the public domain, I attached a copy.
The program contains the comment: All systems function as
STINNER Victor added the comment:
connect_eintr-3.patch: Different patch, don't retry connect() if it returns
EINTR, but poll using poll/select. The patch changes also the asyncio module.
--
Added file: http://bugs.python.org/file38412/connect_eintr-3.patch
STINNER Victor added the comment:
If EINTR is received during connect, the socket is unusable,
that's why i didn't implement it.
Can you elaborate?
socket.connect() should be modified according to the PEP 475:
https://www.python.org/dev/peps/pep-0475/#modified-functions
What do you mean by
New submission from STINNER Victor:
The PEP 475 has been accepted and is partialy implemented. The socket module is
not fully patched to handle EINTR. For example, socket.socket.connect() doesn't
handle EINTR yet.
Attached patch fixes socket.connect() to handle EINTR. It should fix issue
Charles-François Natali added the comment:
If EINTR is received during connect, the socket is unusable, that's why i
didn't implement it.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23618
Antoine Pitrou added the comment:
About EINTR and connect(), I've found the following insightful page:
http://www.madore.org/~david/computers/connect-intr.html
Official POSIX wording is this:
If connect() is interrupted by a signal that is caught while blocked waiting
to establish a
35 matches
Mail list logo