Skip to content

Epoll doesn't remove closed descriptors/files from the interest list #1101

@stevenengler

Description

@stevenengler

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: MainComposing the core Shadow executableType: BugError or flaw producing unexpected results

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions