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 HUP notifications on windows #1370

Merged
merged 7 commits into from
Oct 19, 2020
Merged

Fix HUP notifications on windows #1370

merged 7 commits into from
Oct 19, 2020

Conversation

carllerche
Copy link
Member

@carllerche carllerche commented Oct 19, 2020

Currently, on windows, when receiving a "writeable" notification, HUP interest is disabled. This results in not receiving HUP notifications.

Fixes: tokio-rs/tokio#2982

@carllerche carllerche marked this pull request as ready for review October 19, 2020 20:14
Copy link
Contributor

@kleimkuhler kleimkuhler left a 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"
Copy link
Member Author

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.

Copy link
Collaborator

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.

@carllerche carllerche merged commit 50c299a into master Oct 19, 2020
@@ -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"
Copy link
Collaborator

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.

Copy link
Member Author

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?

Copy link
Collaborator

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"
Copy link
Collaborator

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);
Copy link
Collaborator

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.

@Thomasdezeeuw Thomasdezeeuw deleted the win-hup branch October 20, 2020 08:16
@Thomasdezeeuw
Copy link
Collaborator

Created #1372 to address my own comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client TcpStream has no response after server termination
4 participants