-
Notifications
You must be signed in to change notification settings - Fork 471
Track armed events in muxnotes closely #295
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
@swift-ci please test |
I'd appreciate a review from someone, @weissi (who is on vacation atm) has indepdently checked that it fixes SR-5759 for him. the problem with epoll is that what is two different filters in the kevent world (EVFILT_READ/EVFILT_WRITE) is really a single one in epoll. the multiplexing code which is a simplified version of the kevent one assumes that the first source that is resumed, resumes the multiplexing note, and that delivery disables it fully. However this is not quite how it works, we need to be able to do partial resumes/disarm of EPOLLIN and EPOLLOUT independently as all write sources of a given fd could be suspended while read sources are active and vice versa. |
Note: this is slated for swift4 too |
was out on vacation last week; will take a look at this tomorrow (unburying from other stuff today). Sorry for the delay. |
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.
LGTM
No regression against our codebase.
@dgrove-oss no worries, this isn't even a day old ;) I'll wait for you to have a look then. |
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.
The fix makes sense to me and generally looks good. It just needs one small tweak to compile with the additional compilation warnings enabled when using CMake. The type of the local variable filter in _dispatch_muxnote_create needs to be updated to match the change of du_filter from intt_16 to intt_8. Patch below:
diff --git a/src/event/event_epoll.c b/src/event/event_epoll.c
index 6e4c29a..323772c 100644
--- a/src/event/event_epoll.c
+++ b/src/event/event_epoll.c
@@ -151,7 +151,7 @@ _dispatch_muxnote_create(dispatch_unote_t du, uint32_t events)
dispatch_muxnote_t dmn;
struct stat sb;
int fd = (int)du._du->du_ident;
- int16_t filter = du._du->du_filter;
+ int8_t filter = du._du->du_filter;
bool skip_outq_ioctl = false, skip_inq_ioctl = false;
sigset_t sigmask;
This fixes issues around resuming or re-registering file-descriptors with a previously triggered EPOLLONESHOT event. Signed-off-by: Pierre Habouzit <phabouzit@apple.com> Fixes: SR-5759
c7ec2db
to
917884a
Compare
Track armed events in muxnotes closely Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
This fixes issues around resuming or re-registering file-descriptors with
a previously triggered EPOLLONESHOT event.
Signed-off-by: Pierre Habouzit phabouzit@apple.com
Fixes: SR-5759