-
Notifications
You must be signed in to change notification settings - Fork 269
Epoll doesn't remove closed descriptors/files from the interest list #1101
Description
When a descriptor/file that an epoll object is watching closes, the epoll object doesn't remove it from its watching table. If the descriptor isn't removed using EPOLL_CTL_DEL, then the epoll object will never unref that descriptor/file and it will remain in the watching table until the epoll descriptor itself is closed.
Will closing a file descriptor cause it to be removed from all epoll interest lists?
Yes, but be aware of the following point. [...] A file descriptor is removed from an interest list only after all the file descriptors referring to the underlying open file description have been closed.
I think when _epoll_descriptorStatusChanged() runs, it should check if the descriptor/file has been closed (the EpollWatch flag EWF_CLOSED is set) and if so remove it from the watching table.