EPOLLONESHOT should not remove fd
While mike.zeller was investigating unrelated epoll failures in the (Rust) mio runtime, the involved tests indicated that our behavior for
EPOLLONESHOTmay not be correct. Specifically, after an epoll watch fires an event for a given fd, the software was trying to modify that watch, causing an
ENOENTerror, since it had been removed from the set. After writing up a test case (in the epoll-test-suite) which configures an
EPOLLONESHOTwatch, fires it, and then modifies it with
EPOLL_CTL_MOD, I found that on Linux, the modification works fine, while on illumos it bails.
While this differs from the
POLLONESHOT, it should be fixed so that epoll semantics are preserved.
The proposed wad passes LTP (as it did before). The
POLLONESHOTportions of pmooney's epoll test suite, which previous failed, are now happy with the update. The other tests in the suite pass as well.
The mio test suite, which originally uncovered this behavior, passes with the wad applied as well.
Updated by Patrick Mooney 3 months ago
Prior to integration of the change, the oneshot epoll test fails, as expected:
test_oneshot 0 TPASS test_oneshot 1 TPASS test_oneshot 2 TBROK: epoll_ctl(EPOLL_CTL_MOD): No such file or directory
With it applied, the test passes (with no regressions to the other tests):
test_oneshot 0 TPASS test_oneshot 1 TPASS test_oneshot 2 TPASS test_oneshot 3 TPASS
Updated by Electric Monk 3 months ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
commit 95e434b588459fbd3ca313889cc0223436f1b0cd Author: Patrick Mooney <firstname.lastname@example.org> Date: 2020-07-07T18:10:23.000Z 12910 EPOLLONESHOT should not remove fd Reviewed by: Bryan Cantrill <email@example.com> Reviewed by: Mike Zeller <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>