Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EpollPoller registers with mask EPOLLIN, but filters as if also expecting EPOLLHUP #1063

Open
moreati opened this issue Apr 18, 2024 · 0 comments
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome

Comments

@moreati
Copy link
Member

moreati commented Apr 18, 2024

EpollPoller registers with the mask EPOLLIN | EPOLLOUT

mitogen/mitogen/parent.py

Lines 1044 to 1047 in bb9c51b

def _control(self, fd):
mitogen.core._vv and IOLOG.debug('%r._control(%r)', self, fd)
mask = (((fd in self._rfds) and select.EPOLLIN) |
((fd in self._wfds) and select.EPOLLOUT))

but when looping over a poll result it filters read file descriptors (self._rfds) on EPOLLIN | EPOLLHUP

mitogen/mitogen/parent.py

Lines 1080 to 1081 in bb9c51b

_inmask = (getattr(select, 'EPOLLIN', 0) |
getattr(select, 'EPOLLHUP', 0))

mitogen/mitogen/parent.py

Lines 1089 to 1090 in bb9c51b

for fd, event in events:
if event & self._inmask:

I'm not familiar with epoll() so this may be working as intended, but it feels like a bug. Noticed while investigating #957.

@moreati moreati added bug Code feature that hinders desired execution outcome affects-0.3 Issues related to 0.3.X Mitogen releases labels Apr 18, 2024
@moreati moreati changed the title EpollPoller registers with mask EPOLLIN, but filters as if also expecting POLLHUP EpollPoller registers with mask EPOLLIN, but filters as if also expecting EPOLLHUP Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome
Projects
None yet
Development

No branches or pull requests

1 participant