Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1321)

Issue 131370043: BaseSelectorEventLoop.sock_connect() unregisters the socket on timeout

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 8 months ago by haypo_gmail
Modified:
9 years, 8 months ago
Reviewers:
GvR
Visibility:
Public.

Description

BaseSelectorEventLoop.sock_connect() unregisters the socket on timeout

Patch Set 1 #

Total comments: 6

Patch Set 2 : Split _sock_connect() #

Total comments: 11

Patch Set 3 : Simplify _sock_connect_cb() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -35 lines) Patch
M asyncio/selector_events.py View 1 2 2 chunks +31 lines, -13 lines 0 comments Download
M tests/test_selector_events.py View 1 2 2 chunks +52 lines, -22 lines 0 comments Download

Messages

Total messages: 11
GvR
https://codereview.appspot.com/131370043/diff/1/asyncio/selector_events.py File asyncio/selector_events.py (left): https://codereview.appspot.com/131370043/diff/1/asyncio/selector_events.py#oldcode356 asyncio/selector_events.py:356: return Wouldn't it be much simpler to just unregister ...
9 years, 8 months ago (2014-08-27 14:18:23 UTC) #1
haypo_gmail
https://codereview.appspot.com/131370043/diff/1/asyncio/selector_events.py File asyncio/selector_events.py (left): https://codereview.appspot.com/131370043/diff/1/asyncio/selector_events.py#oldcode356 asyncio/selector_events.py:356: return On 2014/08/27 14:18:23, GvR wrote: > Wouldn't it ...
9 years, 8 months ago (2014-08-27 15:22:57 UTC) #2
GvR
OK. But I wonder if it wouldn't be cleaner to split _sock_connect() completely -- a ...
9 years, 8 months ago (2014-08-27 16:40:25 UTC) #3
haypo_gmail
On 2014/08/27 16:40:25, GvR wrote: > OK. But I wonder if it wouldn't be cleaner ...
9 years, 8 months ago (2014-08-27 20:52:27 UTC) #4
GvR
https://codereview.appspot.com/131370043/diff/20001/asyncio/selector_events.py File asyncio/selector_events.py (right): https://codereview.appspot.com/131370043/diff/20001/asyncio/selector_events.py#newcode385 asyncio/selector_events.py:385: except (BlockingIOError, InterruptedError): I don't think this can be ...
9 years, 8 months ago (2014-08-27 21:08:59 UTC) #5
GvR
Sorry, the OSError constructor does that. But I still think we can make it simpler! ...
9 years, 8 months ago (2014-08-27 21:30:49 UTC) #6
haypo_gmail
https://codereview.appspot.com/131370043/diff/20001/asyncio/selector_events.py File asyncio/selector_events.py (right): https://codereview.appspot.com/131370043/diff/20001/asyncio/selector_events.py#newcode385 asyncio/selector_events.py:385: except (BlockingIOError, InterruptedError): On 2014/08/27 21:08:59, GvR wrote: > ...
9 years, 8 months ago (2014-08-27 21:49:05 UTC) #7
GvR
Our emails crossed, I recanted but then added a bunch of other ideas/questions. https://codereview.appspot.com/131370043/diff/20001/asyncio/selector_events.py File ...
9 years, 8 months ago (2014-08-27 23:26:57 UTC) #8
haypo_gmail
https://codereview.appspot.com/131370043/diff/20001/asyncio/selector_events.py File asyncio/selector_events.py (right): https://codereview.appspot.com/131370043/diff/20001/asyncio/selector_events.py#newcode357 asyncio/selector_events.py:357: self._sock_connect(fut, sock, address) On 2014/08/27 21:30:48, GvR wrote: > ...
9 years, 8 months ago (2014-08-29 13:30:22 UTC) #9
GvR
LGTM I take it that the original code was broken if the initial connect() call ...
9 years, 8 months ago (2014-08-30 00:07:55 UTC) #10
haypo_gmail
9 years, 8 months ago (2014-08-31 13:36:23 UTC) #11
On 2014/08/30 00:07:55, GvR wrote:
> LGTM

Thanks for the feedback, I agree that the final version is now simpler.
 
> I take it that the original code was broken if the initial connect() call got
an
> EINTR?

Seriously, I don't know. It's really hard to get information on the exact
behaviour of syscalls on EINTR. If you have some free time, you may read this
long article:
http://www.madore.org/~david/computers/connect-intr.html

But the article looks to be oriented to blocking socket (according to the final
example).

I don't know how to test the behaviour of connect() on EINTR. Maybe with a
tricky debugger and manual operations.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b