-
Notifications
You must be signed in to change notification settings - Fork 749
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 HUP notifications on windows #1370
Conversation
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.
Looks good 👍
@@ -36,6 +36,7 @@ jobs: | |||
displayName: cargo ${{ parameters.cmd }} --all-features | |||
env: | |||
CI: "True" | |||
RUST_TEST_THREADS: "1" |
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.
Setting "linger" to 0 and forcibly terminating the connection can cause problems in other tests. Avoiding concurrency can help some.
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.
Let's just improve the test, I don't think this is a solution.
@@ -48,6 +48,7 @@ ntapi = "0.3" | |||
[dev-dependencies] | |||
env_logger = { version = "0.6.2", default-features = false } | |||
rand = "0.4" | |||
socket2 = "0.3.15" |
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.
This is a bad idea, socket2 is not ready for use.
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.
btw, why do you say it is not ready for use?
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.
Commits such as rust-lang/socket2@7bf31f9, rust-lang/socket2@b3badc7 are only 1/2 releases old. I'm working on a proper review/rewrite, but I just don't have enough time.
@@ -36,6 +36,7 @@ jobs: | |||
displayName: cargo ${{ parameters.cmd }} --all-features | |||
env: | |||
CI: "True" | |||
RUST_TEST_THREADS: "1" |
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.
Let's just improve the test, I don't think this is a solution.
); | ||
|
||
let (sock, _) = listener.accept().unwrap(); | ||
set_linger_zero(&sock); |
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.
This should work without setting linger here.
Created #1372 to address my own comments. |
Currently, on windows, when receiving a "writeable" notification, HUP interest is disabled. This results in not receiving HUP notifications.
Fixes: tokio-rs/tokio#2982