Richard Oudkerk added the comment: > The fact that that the FDs are duped shouldn't change anything to the > events reported: it works while the number of FDs is less than > FD_SETSIZE (epoll_wait() maxevents argument).
That assumes that epoll_wait() is supposed to return *all* ready fds. But that is not possible because maxevents is finite. If you want all events then obviously you may need to call epoll_wait() multiple times. > I just used dup() to make it easier to test, but you'll probably get > the same thing it your FDs were sockets connected to different > endpoints. This is the part I disagree with -- I think it makes all the difference. Please try making such a modification. >> while True: >> ready_writers = set(fd for fd, evt in >> ep.poll(-1, MAXEVENTS) if fd != r) >> if ready_writers.issubset(seen_writers): >> break >> seen_writers |= ready_writers > >Of course it does, since the returned FDs are a subset of all the >ready file descriptors. > >The point is precisely that, when there are more FDs ready than >maxevents, some FDs will never be reported. The program can only terminate when the outer while all_writers - seen_writers: ... loop terminates. So seen_writers == all_writers, and every fd has been reported. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16873> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com