-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
io: enable closed event for listener filter #21585
Changes from all commits
7d7c0e3
fc0c166
69587bc
caa1f93
a2fa342
fc21a6e
172f1b6
71a41e2
6481fa0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,9 +55,7 @@ void FileEventImpl::activate(uint32_t events) { | |
void FileEventImpl::assignEvents(uint32_t events, event_base* base) { | ||
ASSERT(dispatcher_.isThreadSafe()); | ||
ASSERT(base != nullptr); | ||
// TODO(antoniovicente) remove this once ConnectionImpl can | ||
// handle Read and Close events delivered together. | ||
ASSERT(!((events & FileReadyType::Read) && (events & FileReadyType::Closed))); | ||
|
||
enabled_events_ = events; | ||
event_assign( | ||
&raw_event_, base, fd_, | ||
|
@@ -137,10 +135,6 @@ void FileEventImpl::registerEventIfEmulatedEdge(uint32_t event) { | |
ASSERT((event & (FileReadyType::Read | FileReadyType::Write)) == event); | ||
if (trigger_ == FileTriggerType::EmulatedEdge) { | ||
auto new_event_mask = enabled_events_ | event; | ||
if (event & FileReadyType::Read && (enabled_events_ & FileReadyType::Closed)) { | ||
// We never ask for both early close and read at the same time. | ||
new_event_mask = new_event_mask & ~FileReadyType::Read; | ||
} | ||
updateEvents(new_event_mask); | ||
} | ||
} | ||
|
@@ -149,15 +143,6 @@ void FileEventImpl::registerEventIfEmulatedEdge(uint32_t event) { | |
void FileEventImpl::mergeInjectedEventsAndRunCb(uint32_t events) { | ||
ASSERT(dispatcher_.isThreadSafe()); | ||
if (injected_activation_events_ != 0) { | ||
// TODO(antoniovicente) remove this adjustment to activation events once ConnectionImpl can | ||
// handle Read and Close events delivered together. | ||
if constexpr (PlatformDefaultTriggerType == FileTriggerType::EmulatedEdge) { | ||
if (events & FileReadyType::Closed && injected_activation_events_ & FileReadyType::Read) { | ||
// We never ask for both early close and read at the same time. If close is requested | ||
// keep that instead. | ||
injected_activation_events_ = injected_activation_events_ & ~FileReadyType::Read; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't sure why the windows remove the read event, not sure there is the reason why windows can't handle both read and closed events. at least the CI works. If nobody knows the history or background, a safer way is only register both read and closed events for non-Windows platforms, just silent ignore closed events when both read and closed events registered for Windows There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @davinci26 do you remember the history of this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it was an implementation detail based on how event registration worked at that point on Envoy and it wasnt a windows issue per se. @rectified95 works now at Microsoft so he should be able to test event registrations and which events get raised. |
||
} | ||
} | ||
events |= injected_activation_events_; | ||
injected_activation_events_ = 0; | ||
activation_cb_->cancel(); | ||
|
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.
As this comment said, this code is for
ConnectionImpl
and can't work with both read and close events. So I assume both read and close event should work for listener filter.