Skip to content
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

fix EVFILT_EXCEPT loop if autoRead is off on Darwin #1305

Merged
merged 1 commit into from
Dec 16, 2019

Conversation

weissi
Copy link
Member

@weissi weissi commented Dec 14, 2019

Motivation:

Due to rdar://53656794, we sometimes (especially on UNIX Domain Sockets)
see EVFILT_EXCEPT firing when data is available to read depite the fact
that we're setting the low watermark to CInt.max. This means that
EVFILT_EXCEPT becomes essentially unusable.

Modifications:

  • Don't use EVFILT_EXCEPT on Darwin
  • We lose early EOF delivery on Darwin

Result:

Fewer possibilities of a spin loop on Darwin.

@weissi weissi added the semver/minor Adds new public API. label Dec 14, 2019
@weissi weissi added this to the 2.12.0 milestone Dec 14, 2019
Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. I’ll let @normanmaurer review as well, but I’m fine with this patch as-is.

Copy link
Member

@normanmaurer normanmaurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM... just a few nits.

Sources/NIO/SelectableEventLoop.swift Outdated Show resolved Hide resolved
Tests/NIOTests/StreamChannelsTest.swift Outdated Show resolved Hide resolved
Tests/NIOTests/StreamChannelsTest.swift Show resolved Hide resolved
@weissi weissi force-pushed the jw-fix-evfilt-except-loop branch 2 times, most recently from f2c96a9 to 5fec5ef Compare December 16, 2019 13:57
Motivation:

Due to rdar://53656794, we sometimes (especially on UNIX Domain Sockets)
see EVFILT_EXCEPT firing when data is available to read depite the fact
that we're setting the low watermark to CInt.max. This means that
EVFILT_EXCEPT becomes essentially unusable.

Modifications:

- Don't use EVFILT_EXCEPT on Darwin
- We lose early EOF delivery on Darwin

Result:

Fewer possibilities of a spin loop on Darwin.
@weissi weissi merged commit c1f0544 into apple:master Dec 16, 2019
@weissi weissi deleted the jw-fix-evfilt-except-loop branch December 16, 2019 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants