twisted
twisted
BlogDocsChangelog

Performance History

Latest Results

epollreactor: Handle ENOENT from epoll_ctl gracefully When epoll_ctl(EPOLL_CTL_MOD) is called on a file descriptor that is no longer registered with epoll, it returns ENOENT. This can happen due to fd reuse race conditions: 1. Old connection uses fd N, registered for writes in _writes set 2. Old connection closes, kernel removes fd N from epoll interest list 3. New connection accepted, kernel reuses fd N 4. startReading() -> addReader() -> _add() sees fd N still in _writes 5. Calls self._poller.modify(fd, flags) to add read events 6. modify() fails with ENOENT - fd N is not in epoll (old one was removed) Stack trace from buildbot: tcp.py:1431: transport = self.transport(...) tcp.py:834: self.startReading() abstract.py: self.reactor.addReader(self) epollreactor.py:117: self._add(...) epollreactor.py:103: self._poller.modify(fd, flags) FileNotFoundError: [Errno 2] No such file or directory The epoll(7) manpage documents: ENOENT: op was EPOLL_CTL_MOD or EPOLL_CTL_DEL, and fd is not registered with this epoll instance. Instead of raising an exception, clean up the internal tracking state and schedule connectionLost to properly notify the protocol layer. Fixes race condition observed in buildbot.
Mic92:epoll
12 hours ago
Add news fragment
gudnimg:_passedArgSpec-removal
20 days ago
Drop Python 2 code to fix coverage gap in deprecate.py
gudnimg:python-pyupgrade-py39-plus
23 days ago
Add news fragment
gudnimg:python-pyupgrade-py39-plus
23 days ago
Add news fragment
gudnimg:python-pyupgrade-py39-plus
23 days ago

Active Branches

epollreactor: Handle ENOENT from epoll_ctl gracefully
last run
12 hours ago
#12568
CodSpeed Performance Gauge
0%
#12565
CodSpeed Performance Gauge
0%
#12563
CodSpeed Performance Gauge
0%
© 2026 CodSpeed Technology
Home Terms Privacy Docs