
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2014-12-08 10:36 byAlexey.Poryadin, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| epoll_01.patch | yselivanov,2014-12-08 15:42 | review | ||
| epoll_02.patch | yselivanov,2014-12-08 15:55 | review | ||
| Messages (13) | |||
|---|---|---|---|
| msg232300 -(view) | Author: Alexey Poryadin (Alexey.Poryadin) | Date: 2014-12-08 10:36 | |
When is called `select`, but registered no one `fileobject` rise exception:... polled = self._selector.select(timeout) File "/usr/lib/python3.4/selectors.py", line 424, in select fd_event_list = self._epoll.poll(timeout, max_ev)ValueError: maxevents must be greater than 0, got 0Of course, it makes no sense to call `select` if there is nothing to watch. But "select.epol.poll" is not raises exception in the same case if `max_ev`=-1. And this simplifies the application code and is useful if need just sleep for a timeout.So, I suggest a small fix:- fd_event_list = self._epoll.poll(timeout, max_ev)+ fd_event_list = self._epoll.poll(timeout, max_ev or -1) | |||
| msg232307 -(view) | Author: Yury Selivanov (yselivanov)*![]() | Date: 2014-12-08 15:42 | |
Patch attached. Tests pass on Linux. | |||
| msg232309 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2014-12-08 15:51 | |
+ s.select(timeout=0)I suggest to ensure that the result is an empty list. | |||
| msg232310 -(view) | Author: Yury Selivanov (yselivanov)*![]() | Date: 2014-12-08 15:56 | |
I agree. Please see another one. | |||
| msg232311 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2014-12-08 16:01 | |
It's a little bit surprising to call epoll_wait() without any FD subscribed, but select([], [], [], delay) is a known way to sleep 'delay' seconds, so why not using epoll in a similar way? :-)epoll_02.patch looks good to me. Can you please also apply the patch to the Tulip project?(By the way, test_selectors.py to Tulip is completly different, we may just reuse the file from CPython and drop the code from Tulip.) | |||
| msg232314 -(view) | Author: Guido van Rossum (gvanrossum)*![]() | Date: 2014-12-08 16:35 | |
Please add a comment explaining the complaint from epoll.poll() we'retrying to avoid here.I presume Tulip never gets into this state because of the self-pipe.On Mon, Dec 8, 2014 at 8:01 AM, STINNER Victor <report@bugs.python.org>wrote:>> STINNER Victor added the comment:>> It's a little bit surprising to call epoll_wait() without any FD> subscribed, but select([], [], [], delay) is a known way to sleep 'delay'> seconds, so why not using epoll in a similar way? :-)>> epoll_02.patch looks good to me. Can you please also apply the patch to> the Tulip project?>> (By the way, test_selectors.py to Tulip is completly different, we may> just reuse the file from CPython and drop the code from Tulip.)>> ---------->> _______________________________________> Python tracker <report@bugs.python.org>> <http://bugs.python.org/issue23009>> _______________________________________> | |||
| msg232316 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2014-12-08 17:23 | |
New changesetb2ee06684b6a by Yury Selivanov in branch '3.4':selectors: Make sure EpollSelecrtor.select() works when no FD is registered.https://hg.python.org/cpython/rev/b2ee06684b6aNew changeset202995833ef4 by Yury Selivanov in branch 'default':selectors: Make sure EpollSelecrtor.select() works when no FD is registered.https://hg.python.org/cpython/rev/202995833ef4 | |||
| msg232317 -(view) | Author: Yury Selivanov (yselivanov)*![]() | Date: 2014-12-08 17:23 | |
> Please add a comment explaining the complaint from epoll.poll() we'retrying to avoid here.Good point! Committed. | |||
| msg232318 -(view) | Author: Charles-François Natali (neologix)*![]() | Date: 2014-12-08 17:35 | |
Thanks for taking care of this. | |||
| msg232320 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2014-12-08 17:38 | |
New changeset8f1be68dfcab by Yury Selivanov in branch '3.4':NEWS: Add news entry for issue#23009.https://hg.python.org/cpython/rev/8f1be68dfcabNew changesetd36711410f48 by Yury Selivanov in branch 'default':NEWS: Add news entry for issue#23009.https://hg.python.org/cpython/rev/d36711410f48 | |||
| msg232779 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2014-12-17 00:13 | |
New changeset1e985daa7be6 by Victor Stinner in branch 'default':Issue#23009: Skip test_selectors.test_empty_select() on Windowshttps://hg.python.org/cpython/rev/1e985daa7be6 | |||
| msg234480 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2015-01-22 08:09 | |
New changesetd3a27a27e008 by Victor Stinner in branch '3.4':Issue#23009: Skip test_selectors.test_empty_select() on Windowshttps://hg.python.org/cpython/rev/d3a27a27e008 | |||
| msg234484 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2015-01-22 08:36 | |
New changeset4f928c70f135 by Victor Stinner in branch '3.4':Issue#23009: Add missing "import sys" in test_selectorshttps://hg.python.org/cpython/rev/4f928c70f135 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:10 | admin | set | github: 67198 |
| 2015-01-22 08:36:20 | python-dev | set | messages: +msg234484 |
| 2015-01-22 08:09:46 | python-dev | set | messages: +msg234480 |
| 2014-12-17 00:13:38 | python-dev | set | messages: +msg232779 |
| 2014-12-08 17:38:20 | python-dev | set | messages: +msg232320 |
| 2014-12-08 17:35:21 | neologix | set | messages: +msg232318 |
| 2014-12-08 17:24:07 | yselivanov | set | status: open -> closed resolution: fixed stage: resolved |
| 2014-12-08 17:23:31 | yselivanov | set | messages: +msg232317 |
| 2014-12-08 17:23:02 | python-dev | set | nosy: +python-dev messages: +msg232316 |
| 2014-12-08 16:35:44 | gvanrossum | set | messages: +msg232314 |
| 2014-12-08 16:01:36 | vstinner | set | messages: +msg232311 |
| 2014-12-08 15:56:07 | yselivanov | set | messages: +msg232310 |
| 2014-12-08 15:55:35 | yselivanov | set | files: +epoll_02.patch |
| 2014-12-08 15:51:40 | vstinner | set | messages: +msg232309 |
| 2014-12-08 15:42:47 | yselivanov | set | files: +epoll_01.patch keywords: +patch messages: +msg232307 |
| 2014-12-08 10:40:59 | vstinner | set | nosy: +yselivanov,gvanrossum components: + asyncio |
| 2014-12-08 10:40:53 | vstinner | set | versions: + Python 3.5 |
| 2014-12-08 10:40:47 | vstinner | set | nosy: +vstinner,neologix |
| 2014-12-08 10:36:45 | Alexey.Poryadin | create | |