-
Notifications
You must be signed in to change notification settings - Fork 410
epoll: handle edge case for epoll_ctl #3829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/shims/unix/linux/epoll.rs
Outdated
| /// This helper function checks whether an epoll notification should be triggered for a specific | ||
| /// epoll_interest and, if necessary, triggers the notification. Unlike check_and_update_readiness, | ||
| /// this function sends a notification to only one epoll instance. | ||
| fn check_fd_ready_event( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better name to differentiate this function from check_and_update_readiness? They essentially do the same thing, but this function only checks one epoll_event_interest, where check_and_update_readiness checks all epoll_event_interest. As a result, this function can only return notification to one epoll instance where check_and_update_readiness can return notification to multiple epoll instances.
EDIT: currently named it as check_and_update_one_event_interest
I am confused by this description. There's only one epoll_wait in the first sentence so the second sentence seems to talk about a different case? Looking at the testcase I think I understand now, but the PR description doesn't explain the problem. The problem is
|
|
@rustbot author |
|
@rustbot ready |
|
@bors r+ |
|
☔ The latest upstream changes (presumably #3836) made this pull request unmergeable. Please resolve the merge conflicts. |
|
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message |
|
Rebased and CI is green. r? @oli-obk |
|
@bors r+ |
|
☀️ Test successful - checks-actions |
There is a test case that revealed that our implementation differs from the real system:
This happened because, in
epoll_ctl, we usedcheck_and_update_readiness, which is a function that would return notification for all epoll file description that registered a particular file description. But we shouldn't do that because no notification should be returned if there is no I/O activity between twoepoll_wait(every firstepoll_waitthat happens afterepoll_ctlis an exception, we should return notification that reflects the readiness of file description).r? @oli-obk