Message373777
Unlike with all the other sock_* functions, sock_accept() only removes the reader on the server socket when the socket becomes available for reading (ie. when there's an incoming connection). If the operation is cancelled instead, the reader is not removed.
If then the server socket is closed and a new socket is created which has the same file number and it is used for a socket operation, it will cause a FileNotFoundError because the event loop thinks it has this fd registered but the epoll object does not agree since all closed sockets are automatically removed from it.
The attached script reproduces the problem on Fedora Linux 32 (all relevant Python versions), but not on Windows (on any tested Python versions from 3.6 to 3.8). |
|
Date |
User |
Action |
Args |
2020-07-16 22:12:05 | alex.gronholm | set | recipients:
+ alex.gronholm, asvetlov, yselivanov |
2020-07-16 22:12:05 | alex.gronholm | set | messageid: <1594937525.52.0.117066426287.issue41317@roundup.psfhosted.org> |
2020-07-16 22:12:05 | alex.gronholm | link | issue41317 messages |
2020-07-16 22:12:05 | alex.gronholm | create | |
|