Issue 32568: Fix handling of sizehint=-1 in select.epoll() (original) (raw)

Created on 2018-01-16 10:48 by taleinat, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 7840 merged taleinat,2018-06-21 06:45
PR 4265 taleinat,2018-06-22 19:54
PR 8024 merged miss-islington,2018-06-30 12:44
PR 8025 merged taleinat,2018-06-30 12:56
Messages (9)
msg310072 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-01-16 10:48
In 2fb9ae9dfc5a6830d902332ba93b13387e292ddb, select.epoll() was changed to reject sizehint=-1, despite that still being documented as the default value. Would it be possible to reverse this change, making -1 a special value signaling select.epoll() to use sizehint=FD_SETSIZE-1, as was before this change? Additionally, in the same commit the docs were changed to say that the sizehint parameter is deprecated and has no effect, but later changes have restored use of sizehint in certain cases without updating the documentation. This inconsistency should be fixed. For reference, this came up as part of #31938.
msg310073 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-01-16 10:49
Also see discussion in GitHub PR 4265 for #31938.
msg310075 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-01-16 10:58
Also sizehint=0 was rejected before 2fb9ae9dfc5a6830d902332ba93b13387e292ddb. Now it is accepted.
msg320236 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-06-22 13:46
> *flags* is deprecated and completely ignored. What if tomorrow, Linux accepts a new flag, passing the flag would just be ignored? Maybe it's fine. Especially usually Python developers only use flags exposed in Python, and currently, only EPOLL_CLOEXEC is exposed and this flag is useless in the specific case of Python (Python always uses the flag).
msg320238 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-06-22 14:06
> Also sizehint=0 was rejected before 2fb9ae9dfc5a6830d902332ba93b13387e292ddb. Now it is accepted. DESCRIPTION epoll_create() creates a new epoll(7) instance. Since Linux 2.6.8, the size argument is ignored, but must be greater than zero; see NOTES below. (...) NOTES In the initial epoll_create() implementation, the size argument informed the kernel of the number of file descriptors that the caller expected to add to the epoll instance. The kernel used this informa‐ tion as a hint for the amount of space to initially allocate in inter‐ nal data structures describing events. (If necessary, the kernel would allocate more space if the caller's usage exceeded the hint given in size.) Nowadays, this hint is no longer required (the kernel dynami‐ cally sizes the required data structures without needing the hint), but size must still be greater than zero, in order to ensure backward com‐ patibility when new epoll applications are run on older kernels.
msg320252 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-06-22 18:27
>> Also sizehint=0 was rejected before 2fb9ae9dfc5a6830d902332ba93b13387e292ddb. Now it is accepted. Please note that by "Now it is accepted" I meant in the current codebase, before PR 7840. In this regard, that PR changes nothing. Given the documentation quoted by Victor, perhaps it would be wise to review that earlier change.
msg320774 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-06-30 12:43
New changeset 0cdf5f42898350261c5ff65d96334e736130780f by Tal Einat in branch 'master': bpo-32568: make select.epoll() and its docs consistent (#7840) https://github.com/python/cpython/commit/0cdf5f42898350261c5ff65d96334e736130780f
msg320776 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-06-30 13:03
New changeset fd1c092bb9fee46d8d543710973c69a0e93a697a by Tal Einat (Miss Islington (bot)) in branch '3.7': bpo-32568: make select.epoll() and its docs consistent (GH-7840) (GH-8024) https://github.com/python/cpython/commit/fd1c092bb9fee46d8d543710973c69a0e93a697a
msg320778 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-06-30 13:15
New changeset db7ac30ef52ce35a4ead1bc1b9f0dd5331ed9779 by Tal Einat in branch '3.6': [3.6] bpo-32568: make select.epoll() and its docs consistent (GH-7840) (GH-8025) https://github.com/python/cpython/commit/db7ac30ef52ce35a4ead1bc1b9f0dd5331ed9779
History
Date User Action Args
2022-04-11 14:58:56 admin set github: 76749
2018-06-30 13:16:38 taleinat set status: open -> closedresolution: fixedstage: patch review -> resolved
2018-06-30 13:15:56 taleinat set messages: +
2018-06-30 13:03:21 taleinat set messages: +
2018-06-30 12:56:47 taleinat set pull_requests: + <pull%5Frequest7635>
2018-06-30 12:44:41 miss-islington set pull_requests: + <pull%5Frequest7633>
2018-06-30 12:43:25 taleinat set messages: +
2018-06-25 13:51:41 serhiy.storchaka set versions: + Python 3.8
2018-06-23 08:01:22 giampaolo.rodola set nosy: + giampaolo.rodola
2018-06-22 19:54:36 taleinat set pull_requests: + <pull%5Frequest7470>
2018-06-22 18:27:18 taleinat set messages: +
2018-06-22 14:06:26 vstinner set messages: +
2018-06-22 13:46:07 vstinner set nosy: + vstinnermessages: +
2018-06-21 06:45:25 taleinat set keywords: + patchstage: needs patch -> patch reviewpull_requests: + <pull%5Frequest7449>
2018-01-16 10:58:56 serhiy.storchaka set messages: +
2018-01-16 10:56:44 serhiy.storchaka set stage: needs patchtype: behaviorcomponents: + Extension Modulesversions: + Python 3.6, Python 3.7
2018-01-16 10:49:40 taleinat set messages: +
2018-01-16 10:48:25 taleinat create