You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KqueueSelector.select() may not get all events if a fd is registered for both read and write.
kqueue requires to register two filters, one for read and one for write. But KqueueSelector.select() calls kqueue.control() counting the number of registered fds, not the filters. As a result a single call to select() won't return all the available events.
(Note that the two events are only visible on two subsequent selects)
For users like asyncio, this might mean missing a loop cycle or more (depending on number of registered readers/writers and ready events) before an event is seen. I previously said that this might cause deadlocks but I could not produce an example where a read/write event is never seen.
Activity
pythongh-110038: KqueueSelector must count all read/write events
gh-110038: KqueueSelector must count all read/write events (#110039)
[3.12] pythongh-110038: KqueueSelector must count all read/write even…
[3.11] pythongh-110038: KqueueSelector must count all read/write even…
[3.11] gh-110038: KqueueSelector must count all read/write events (GH…
pythongh-110038: KqueueSelector must count all read/write events (pyt…
[3.12] gh-110038: KqueueSelector must count all read/write events (GH…
hugovk commentedon Nov 9, 2023
Thanks for the issue and PRs!
vstinner commentedon Nov 9, 2023
Thanks for the fix @sorcio.
pythongh-110038: KqueueSelector must count all read/write events (pyt…