twisted
twisted
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
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
[pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci
Mic92:epoll
12 hours ago
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
Clean up test_usesGlobalInitFunction getargspec method was removed in Python 3.11 and was deprecated since Python 3.0 Also inspect has had the attribute 'signature' since Python 3.3 so the else statement is never run today on support Python versions.
gudnimg:_passedArgSpec-removal
20 days 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%
#12564 Remove `_passedArgSpec` method in `deprecate.py`
last run
20 days ago
#12565
CodSpeed Performance Gauge
0%
#12562 python: update type annotations for Python 3.9+ (1/1)
last run
23 days ago
#12563
CodSpeed Performance Gauge
0%
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs