[issue16853] add a Selector to the select module

2014-03-17 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue16853] add a Selector to the select module

2013-09-05 Thread Charles-François Natali
Charles-François Natali added the comment: > Richard Oudkerk added the comment: > > Even with edge-triggered notification, doesn't registering an fd check > the current readiness: Hum... Looks like I forgot to turn my brain on this morning :-) -- ___

[issue16853] add a Selector to the select module

2013-09-05 Thread Richard Oudkerk
Richard Oudkerk added the comment: On 05/09/2013 9:28am, Charles-François Natali wrote: > As a side note, in the general case, there's more than a performance > optimization: the problem with unregister() + register() vs a real > modify (e.g. EPOLL_CTL_MOD) is that it's subject to a race conditio

[issue16853] add a Selector to the select module

2013-09-05 Thread Charles-François Natali
Charles-François Natali added the comment: > Giampaolo Rodola' added the comment: > > I have realized just now that at least epoll() and kqueue() selectors could > take advantage and define their own modify() method (there was even a TODO I > totally missed). As a side note, in the general cas

[issue16853] add a Selector to the select module

2013-09-04 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I have realized just now that at least epoll() and kqueue() selectors could take advantage and define their own modify() method (there was even a TODO I totally missed). Anyway, from now on I'm gonna file separate issues. -- __

[issue16853] add a Selector to the select module

2013-09-04 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > Is there anything left to do or can we close this issue? Add support for select.devpoll on Solaris. -- ___ Python tracker ___

[issue16853] add a Selector to the select module

2013-09-04 Thread Charles-François Natali
Charles-François Natali added the comment: > Is there anything left to do or can we close this issue? I usually wait until the test is run on the buildbots to check I didn't break anything: apparently that's OK, so we can close. > It would be nice to mention the new selectors module in the doc

[issue16853] add a Selector to the select module

2013-09-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: I feel this can be closed then :) Thanks, Charles-François! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

[issue16853] add a Selector to the select module

2013-09-04 Thread STINNER Victor
STINNER Victor added the comment: > Feel free to make documentation commits :) Ok, done. I also created the issue #18923: "Use the new selectors module in the subprocess module". -- ___ Python tracker __

[issue16853] add a Selector to the select module

2013-09-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 142ff216e4b4 by Victor Stinner in branch 'default': Issue #16853: Mention the new selectors module in the select module http://hg.python.org/cpython/rev/142ff216e4b4 -- ___ Python tracker

[issue16853] add a Selector to the select module

2013-09-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > Is there anything left to do or can we close this issue? > > It would be nice to mention the new selectors module in the documentation of > the select module. Feel free to make documentation commits :) They don't necessarily have to pass a review stage. -

[issue16853] add a Selector to the select module

2013-09-04 Thread STINNER Victor
STINNER Victor added the comment: > Is there anything left to do or can we close this issue? It would be nice to mention the new selectors module in the documentation of the select module. -- ___ Python tracker _

[issue16853] add a Selector to the select module

2013-09-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6b14ebe0f7ac by Victor Stinner in branch 'default': Issue #16853: Mention the new selectors module in What's New in Python 3.4 http://hg.python.org/cpython/rev/6b14ebe0f7ac -- ___ Python tracker

[issue16853] add a Selector to the select module

2013-09-04 Thread Guido van Rossum
Guido van Rossum added the comment: Agreed, this was a great feat of implementation and API design. Is there anything left to do or can we close this issue? (I looked at the Proactor code in Tulip again and I think it is not quite as easy to isolate it, so I'm not requesting that Proactors be

[issue16853] add a Selector to the select module

2013-09-04 Thread STINNER Victor
STINNER Victor added the comment: > New changeset e4d45315c38c by Charles-François Natali in branch 'default': > Issue #16853: Add new selectors module. > http://hg.python.org/cpython/rev/e4d45315c38c Great! Congrats Charles-François for the new module! I tried to implement such module once but

[issue16853] add a Selector to the select module

2013-09-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset e4d45315c38c by Charles-François Natali in branch 'default': Issue #16853: Add new selectors module. http://hg.python.org/cpython/rev/e4d45315c38c -- nosy: +python-dev ___ Python tracker

[issue16853] add a Selector to the select module

2013-08-31 Thread Guido van Rossum
Guido van Rossum added the comment: Hm... I like the [] return just fine, it matches what Tulip's selector did. The framework should be re-checking the clock anyway -- it's possible that select() returned late too... -- ___ Python tracker

[issue16853] add a Selector to the select module

2013-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Here's a patch returning [] on EINTR. Hmm... Shouldn't it simply let the InterruptedError bubble up? I know there's the sleep() precedent, but I find it a bit embarassing actually: the call can return early, but there's no way for the caller to know that it

[issue16853] add a Selector to the select module

2013-08-31 Thread Charles-François Natali
Charles-François Natali added the comment: Here's a patch returning [] on EINTR. I've tested it on Linux, Windows, FreeBSD, OpenSolaris and OS-X. -- Added file: http://bugs.python.org/file31536/selectors-15.diff ___ Python tracker

[issue16853] add a Selector to the select module

2013-08-31 Thread Guido van Rossum
Guido van Rossum added the comment: > Charles-François Natali added the comment: > Well, I'll change it, but: > We have to change the select() docstring to "Wait until some > registered file objects become ready, or for *at most* timeout > seconds" Doesn't sound so bad to me. It's about the sam

[issue16853] add a Selector to the select module

2013-08-31 Thread Charles-François Natali
Charles-François Natali added the comment: > I may be missing something here but isn't the whole point of EINTR to > interrupt a potentially long running syscall? No. EINTR is an artifact of the early Unix design, because failing when a signal was delivered was simpler than restarting the sysca

[issue16853] add a Selector to the select module

2013-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: > All the event loops I'm familiar with (twisted, tornado and asyncore) > just 'return' on EINTR, supposedly because that was the best > compromise to support syscall interruption without forcing users to > handle EINTR themselves. What do you mean? Tornado simp

[issue16853] add a Selector to the select module

2013-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I may be missing something here but isn't the whole point of EINTR to > interrupt a potentially long running syscall? Not exactly. The point is to signal (!) that a signal was received. The received signal is not necessarily expected. Also, from what I unders

[issue16853] add a Selector to the select module

2013-08-31 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I may be missing something here but isn't the whole point of EINTR to interrupt a potentially long running syscall? Why protract function return time as a consequence? All the event loops I'm familiar with (twisted, tornado and asyncore) just 'return' on EIN

[issue16853] add a Selector to the select module

2013-08-31 Thread Charles-François Natali
Charles-François Natali added the comment: Oh, and FWIW, that's also what Java does: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5100121 http://hg.openjdk.java.net/jdk6/jdk6-gate/jdk/file/6daa81bdfd18/src/solaris/native/sun/nio/ch/PollArrayWrapper.c (I know some people don't like Java, b

[issue16853] add a Selector to the select module

2013-08-31 Thread Charles-François Natali
Charles-François Natali added the comment: 2013/8/31 Guido van Rossum : > But still I agree with Giampaolo that the decorator doesn't feel > right. It's like a try/except around the entire body of your function, > which is usually a code smell (even though I realize the exception it > catches can

[issue16853] add a Selector to the select module

2013-08-30 Thread Guido van Rossum
Guido van Rossum added the comment: On Fri, Aug 30, 2013 at 6:34 AM, Charles-François Natali wrote: [Giampaolo Rodola'] > > - I'm not sure why in case of EINTR you retry with a different timeout; > > can't you just return []? > > Because when I do: > selector.select(10) > > I expect the selecto

[issue16853] add a Selector to the select module

2013-08-30 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I'm playing with devpoll on Open Solaris and it seems it works exactly as poll(). Basically a copy & paste of PollSelector class with a different self._poll attribute will suffice. With dev/poll support you now have 3 classes (PollSelector, EpollSelector, D

[issue16853] add a Selector to the select module

2013-08-30 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > That should be pretty easy to add by someone who has access to a > Solaris box: I could use the buildbots, but it'd take a couple > iterations to get it right. I can probably help with that. -- ___ Python tracke

[issue16853] add a Selector to the select module

2013-08-30 Thread Charles-François Natali
Charles-François Natali added the comment: Hello, > - What about Solaris' /dev/poll? That should be pretty easy to add by someone who has access to a Solaris box: I could use the buildbots, but it'd take a couple iterations to get it right. > - I'm not sure why in case of EINTR you retry with

[issue16853] add a Selector to the select module

2013-08-30 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Follows a couple of minor concerns. - What about Solaris' /dev/poll? - I'm not sure why in case of EINTR you retry with a different timeout; can't you just return []? - this is probably because I'm paranoid about performances but given that select() meth

[issue16853] add a Selector to the select module

2013-08-28 Thread Charles-François Natali
Charles-François Natali added the comment: Alright, here's the patch, with all the changes discussed (and of cours a separate selectors.py). -- Added file: http://bugs.python.org/file31499/selectors-14.diff ___ Python tracker

[issue16853] add a Selector to the select module

2013-08-26 Thread Guido van Rossum
Guido van Rossum added the comment: On Sat, Aug 24, 2013 at 5:04 AM, Charles-François Natali wrote: > Before I post it for final review, I have three more questions: > 1) In the documentation, I don't know how to best refer to files > object registered: is "file descriptor" OK, or is it too low-

[issue16853] add a Selector to the select module

2013-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > Didn't you forget to upload it? > > I wanted to have answer to my questions first :-): Ah, indeed, sorry! > 1) In the documentation, I don't know how to best refer to files > object registered: is "file descriptor" OK, or is it too low-level? > Otherwise I

[issue16853] add a Selector to the select module

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: > Didn't you forget to upload it? I wanted to have answer to my questions first :-): > Before I post it for final review, I have three more questions: -- ___ Python tracker

[issue16853] add a Selector to the select module

2013-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Alright, I've updated the patch to have a distinct selectors module, > and with Guido's comments. Didn't you forget to upload it? -- ___ Python tracker _

[issue16853] add a Selector to the select module

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: Alright, I've updated the patch to have a distinct selectors module, and with Guido's comments. Before I post it for final review, I have three more questions: 1) In the documentation, I don't know how to best refer to files object registered: is "file

[issue16853] add a Selector to the select module

2013-08-21 Thread Guido van Rossum
Guido van Rossum added the comment: On Wed, Aug 21, 2013 at 2:37 AM, STINNER Victor wrote: > > STINNER Victor added the comment: > > I like the idea of renaming select to _select, and add Lib/select.py > for the high-level wrapper (Selector). In my opinion, adding a module > just for 5 classes i

[issue16853] add a Selector to the select module

2013-08-21 Thread STINNER Victor
STINNER Victor added the comment: I like the idea of renaming select to _select, and add Lib/select.py for the high-level wrapper (Selector). In my opinion, adding a module just for 5 classes is overkill. Selector classes are a very thin abstraction over the low-level objects. A new module can be

[issue16853] add a Selector to the select module

2013-08-21 Thread Charles-François Natali
Charles-François Natali added the comment: > I've lost track -- who is waiting for whom? I reviewed the patch > selector-12.diff and received zero response AFAICT. (Maybe the email from > Rietveld didn't make it?) I was on vacation, and then had to cope with many emails :-) I'll update the p

[issue16853] add a Selector to the select module

2013-08-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, I suppose it waits on Charles-François to update the patch. I'd prefer not to add a separate module for this, personally. I think this functionality is fine in the select module. People who know how to use a selector certainly have heard about select() o

[issue16853] add a Selector to the select module

2013-08-20 Thread Guido van Rossum
Guido van Rossum added the comment: I've lost track -- who is waiting for whom? I reviewed the patch selector-12.diff and received zero response AFAICT. (Maybe the email from Rietveld didn't make it?) I'd like to get this into alpha2, even if the proactor won't make it (though I'd love to s

[issue16853] add a Selector to the select module

2013-08-20 Thread STINNER Victor
STINNER Victor added the comment: FYI I created the issue #18794: "select.devpoll objects have no close() method". If this method is added, it should also be called by the close() method of the selector. -- nosy: +haypo ___ Python tracker

[issue16853] add a Selector to the select module

2013-08-06 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry, replying to some direct questions in the bug: > I also made the following changes: > - BaseSelector is an abstract base class (so one could imagine user code > implementing its own selector on top of it) Fine (though I had to work around this for some

[issue16853] add a Selector to the select module

2013-08-06 Thread Guido van Rossum
Guido van Rossum added the comment: Actually there is a misunderstanding underlying you Tulip patch. Tulip needs to support Python 3.3 as well as Python 3.4, so it needs to do a little dance trying to import BaseSelector (or some other key class) from select and if that fails fall back to its

[issue16853] add a Selector to the select module

2013-08-06 Thread Guido van Rossum
Guido van Rossum added the comment: Yeah, the timeouts are a bad idea anyway. I've filed http://code.google.com/p/tulip/issues/detail?id=49 to remind us to do something about this. I'll review your tulip patch next. -- ___ Python tracker

[issue16853] add a Selector to the select module

2013-08-03 Thread Charles-François Natali
Charles-François Natali added the comment: > Guido van Rossum added the comment: > Can you try again with the failing assert replaced with this? > > self.assertTrue(0.018 <= t2-t0 <= 0.028, t2-t0) > > That should be a better way to check that code works. I'm still getting - less frequent -

[issue16853] add a Selector to the select module

2013-08-02 Thread Guido van Rossum
Guido van Rossum added the comment: No time for a full review yet, but a comment on the timeout test failure you are observing in Tulip. This particular test schedules a task that sleeps for 20 msecs, and first calls run_until_complete() with a timeout of 10 msecs, and then calls it again wit

[issue16853] add a Selector to the select module

2013-08-02 Thread Charles-François Natali
Charles-François Natali added the comment: Version addressing Antoine and Christian's comments. -- Added file: http://bugs.python.org/file31133/selector-12.diff ___ Python tracker __

[issue16853] add a Selector to the select module

2013-08-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: > One thought: would it be better if the selectors ended up in a > separate module rather than extending 'select'? IMHO they're fine in select. It's quite the natural place for them. -- ___ Python tracker

[issue16853] add a Selector to the select module

2013-08-02 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! We should make sure this makes it into alpha 2. Could you also prepare a patch for Tulip itself? That way I can make sure Tulip works with either its own or the stdlib implementation. One thought: would it be better if the selectors ended up in a

[issue16853] add a Selector to the select module

2013-08-02 Thread Charles-François Natali
Charles-François Natali added the comment: Here's a patch, based on the version in tulip's repo. I've added doc update and tests. I also made the following changes: - BaseSelector is an abstract base class (so one could imagine user code implementing its own selector on top of it) - SelectorKey

[issue16853] add a Selector to the select module

2013-04-12 Thread Charles-François Natali
Charles-François Natali added the comment: > If this goes inside the select module, it could probably help issue #17552 > (add socket.sendfile()) a bit. Yes, that's exactly the idea. See also the attached patches for telnetlib and multiprocessing (there would probably be other candidates like s

[issue16853] add a Selector to the select module

2013-04-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: If this goes inside the select module, it could probably help issue #17552 (add socket.sendfile()) a bit. -- ___ Python tracker ___ ___

[issue16853] add a Selector to the select module

2013-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: And the next Tulip rev renames Key to SelectorKey. -- ___ Python tracker ___ ___ Python-bugs-list

[issue16853] add a Selector to the select module

2013-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: I've fixed the signal handling issue. Please check Tulip revision 1c4db3d1a688: http://code.google.com/p/tulip/source/detail?r=1c4db3d1a68874dc22c84f9c1c376c5371037f09 -- ___ Python tracker

[issue16853] add a Selector to the select module

2013-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: On Wed, Jan 9, 2013 at 12:47 PM, Charles-François Natali wrote: >> - How shall we go forward? I've made a variety of small changes to the >> Tulip version (selector.py) now. Can you work those into a fresh unified >> patch for CPython 3.4? > > Yes, but I thi

[issue16853] add a Selector to the select module

2013-01-09 Thread Charles-François Natali
Charles-François Natali added the comment: > - How shall we go forward? I've made a variety of small changes to the > Tulip version (selector.py) now. Can you work those into a fresh unified > patch for CPython 3.4? Yes, but I think we could wait a little, to make sure the API is good enough t

[issue16853] add a Selector to the select module

2013-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: - How shall we go forward? I've made a variety of small changes to the Tulip version (selector.py) now. Can you work those into a fresh unified patch for CPython 3.4? - I tried making a single combined kqueue call in register(), and it caused the SSL test

[issue16853] add a Selector to the select module

2013-01-09 Thread Charles-François Natali
Charles-François Natali added the comment: > Please consider my patches instead; it seems our patches crossed. Merging is > now difficult because I already submitted my version to Tulip. That's fine, I don't think there's a point into maintaining a standalone patch for now: we can see how it g

[issue16853] add a Selector to the select module

2013-01-08 Thread Richard Oudkerk
Richard Oudkerk added the comment: > Richard, in Tulip's WSAPoll code, it reads: > > class WindowsPollPollster(PollPollster): > """Pollster implementation using WSAPoll. > > WSAPoll is only available on Windows Vista and later. Python > does not currently support WSA

[issue16853] add a Selector to the select module

2013-01-08 Thread Guido van Rossum
Guido van Rossum added the comment: Please consider my patches instead; it seems our patches crossed. Merging is now difficult because I already submitted my version to Tulip. Your version still has a bug: it uses select.kevent(...) twice, where it should just use kevent(...). Also my versi

[issue16853] add a Selector to the select module

2013-01-08 Thread Charles-François Natali
Charles-François Natali added the comment: As it is now, _Key is actually an implementation detail, that's why it's not part of the methods signature. Oonly the base register()/unregister() return the key because it's an easy way for the derived classes to get the FD without calling _fileobj_t

[issue16853] add a Selector to the select module

2013-01-08 Thread Guido van Rossum
Guido van Rossum added the comment: A patch for making register()/unregister() return the key. -- Added file: http://bugs.python.org/file28638/return_key_fix.diff ___ Python tracker

[issue16853] add a Selector to the select module

2013-01-08 Thread Guido van Rossum
Guido van Rossum added the comment: That ought to be added to the docstrings for register()/unregister() in _BaseSelector. -- ___ Python tracker ___

[issue16853] add a Selector to the select module

2013-01-08 Thread Guido van Rossum
Guido van Rossum added the comment: Whoops, the unregister() function needs to return key. -- ___ Python tracker ___ ___ Python-bugs-l

[issue16853] add a Selector to the select module

2013-01-08 Thread Charles-François Natali
Charles-François Natali added the comment: This should fix some kqueue failures (the FDs were not unregistered, which could result in spurious FDs being reported at a later time). For the "negative FDs", all spurious events are now caught and logged (I think it's better than silently ignoring th

[issue16853] add a Selector to the select module

2013-01-08 Thread Guido van Rossum
Guido van Rossum added the comment: Figured it out. KqueueSelector was missing the unregister() implementation. Here it is: def unregister(self, fileobj): key = super().unregister(fileobj) mask = 0 if key.events & SELECT_IN: mask |= K

[issue16853] add a Selector to the select module

2013-01-08 Thread Guido van Rossum
Guido van Rossum added the comment: Ok, I fixed test_writer_callback() in the tulip repo. Indeed the error I reported first is gone now. I logged the value of kev on failure, and got this output: ERROR:root:kev = Traceback (most recent call last): File "/Users/guido/tulip/tulip/selectors.py

[issue16853] add a Selector to the select module

2013-01-08 Thread Charles-François Natali
Charles-François Natali added the comment: So I assume that the second failure is fixed, which means that OS-X returns a funny event (and not POLLIN/POLLHUP/POLLERR) in case of ECONNREFUSED :-( > 2 - In EventLoopTestsMixin::test_writer_callback if the writer socket isn't > non-blocking, the tes

[issue16853] add a Selector to the select module

2013-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: There's a bug in the kqueue selector. The following code in your patch has 'fd' instead of 'key.fd', twice: if events & SELECT_IN: kev = kevent(key.fd, KQ_FILTER_READ, KQ_EV_ADD) self._kqueue.control([kev], 0, 0)

[issue16853] add a Selector to the select module

2013-01-07 Thread Felipe Cruz
Felipe Cruz added the comment: Hi.. 2 comments related to Kqueue/OSX(16.8) 1 - In tulip/selectors.py L311 and L314 - is key.fd not fd 2 - In EventLoopTestsMixin::test_writer_callback if the writer socket isn't non-blocking, the test hangs forever.. 3 - Errors: ERROR: testCreateSslTransport (

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file28619/tulip-selectors-2.diff ___ Python tracker ___ ___ Python-b

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file28617/selector-8.diff ___ Python tracker ___ ___ Python-bugs-lis

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Added file: http://bugs.python.org/file28622/tulip-selectors-2.diff ___ Python tracker ___ ___ Python-bug

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Added file: http://bugs.python.org/file28621/selector-8.diff ___ Python tracker ___ ___ Python-bugs-list

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file28575/selector-data.diff ___ Python tracker ___ ___ Python-bugs-

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file28564/selector-3.diff ___ Python tracker ___ ___ Python-bugs-lis

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Added file: http://bugs.python.org/file28619/tulip-selectors-2.diff ___ Python tracker ___ ___ Python-bug

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file28584/selector-5.diff ___ Python tracker ___ ___ Python-bugs-lis

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file28618/tulip-selectors-2.diff ___ Python tracker ___ ___ Python-b

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Added file: http://bugs.python.org/file28618/tulip-selectors-2.diff ___ Python tracker ___ ___ Python-bug

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Added file: http://bugs.python.org/file28617/selector-8.diff ___ Python tracker ___ ___ Python-bugs-list

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file28602/selector-6.diff ___ Python tracker ___ ___ Python-bugs-lis

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file28606/selector_poll_events.diff ___ Python tracker ___ ___ Pytho

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file28615/tulip-selectors-2.diff ___ Python tracker ___ ___ Python-b

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file28616/selector-8.diff ___ Python tracker ___ ___ Python-bugs-lis

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Charles-François Natali added the comment: > The second test runs fine on Linux, and from a cursory look, I don't > see how it could fail (the socket should be reported as write ready > upon ECONNREFUSED). Hum, thinking about it, I wonder is OS-X doesn't report POLLPRI or some other esoteric eve

[issue16853] add a Selector to the select module

2013-01-07 Thread Charles-François Natali
Charles-François Natali added the comment: > Also notice the need for a third constant, SELECT_CONNECT. For details see > the class WindowsPollPollster in the Tulip code. I'll trust Richard on all Windows matter, so if you need a SELECT_CONNECT constant, I'll expose one. > However, two Tulip

[issue16853] add a Selector to the select module

2013-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: (Adding Richard Oudkerk to the nosy list as I am pleading here for support of WSAPoll(), see last few messages.) -- nosy: +sbt ___ Python tracker ___

[issue16853] add a Selector to the select module

2013-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: Maybe I should explain the need for SELECT_CONNECT more. This is necessary so that on Windows the PollSelector can use WSAPoll(). The reason is that for async connect() calls, WSAPoll() doesn't return the FD as writable, just as having an exception. I did

[issue16853] add a Selector to the select module

2013-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: This seems okay. I am attaching the changes I had to make to Tulip to support this. However, two Tulip tests are now failing: - tulip.events_test.PollEventLoopTests.testCreateSslTransport fails with spurious file descriptors returned by poll() that aren't

[issue16853] add a Selector to the select module

2013-01-06 Thread Charles-François Natali
Charles-François Natali added the comment: > If you don't want to change the API back to separate register_*() methods for > readers and writers, perhaps you can add a method that tells me, for a given > fileobj, whether it is registered, and with which poll flags > (SELECT_IN/OUT/both) and th

[issue16853] add a Selector to the select module

2013-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: I am trying to use this module in Tulip instead of its pollster implementation, and am running into a problem. Tulip defines separate add_reader()/add_writer() methods, which call to the pollster's register_reader()/register_writer(), respectively. The tra

[issue16853] add a Selector to the select module

2013-01-05 Thread Charles-François Natali
Charles-François Natali added the comment: I've noticed a bug present in Tulip, pyftpdlib and tornado (and this implementation, too): none of them passes the maxevents argument to epoll.poll(), and by default the poll() wrapper in the socket module uses FD_SETSIZE-1, so you'll never get more than

[issue16853] add a Selector to the select module

2013-01-05 Thread Meador Inge
Meador Inge added the comment: The EpollSelector and PollSelector implementations are basically identical. You might want to refactor these to share more code. -- nosy: +meador.inge ___ Python tracker ___

[issue16853] add a Selector to the select module

2013-01-05 Thread Charles-François Natali
Charles-François Natali added the comment: > I think that this needs extensive tests that verify the behavior of many end > cases, including under duress (e.g. when there are too many connections for > the kernel to handle). That would seem the only way to make sure that the > code is reliabl

[issue16853] add a Selector to the select module

2013-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: I think that this needs extensive tests that verify the behavior of many end cases, including under duress (e.g. when there are too many connections for the kernel to handle). That would seem the only way to make sure that the code is reliable across platfo

[issue16853] add a Selector to the select module

2013-01-05 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > The actual error (which may be ECONNRESET, but also EBADF, ENOBUFS...) will > be raised > upon the next call to read()/write(), or can be retrieved through getsockopt(SO_ERROR). Mmmm... I would be tempted to think the same but the fact that both Tornado an

[issue16853] add a Selector to the select module

2013-01-05 Thread Charles-François Natali
Charles-François Natali added the comment: >> there's no SELECT_ERR anymore [...] the error will be reported when the FD >> will be read/written > > I don't think this is a good idea, particularly during this early stage. > This assumption might be valid for select() but not for poll() and epoll

  1   2   >