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

std: Ignore close_read_wakes_up on Windows #38867

Merged
merged 1 commit into from
Jan 12, 2017

Conversation

alexcrichton
Copy link
Member

It looks like in practice at least this test will not pass on Windows.
Empirically it is prone to blocking forever, presumably because a call to
shutdown doesn't actually wake up other threads on Windows.

We don't document this as a guarantee for shutdown, nor do we internally rely
on it. This test originated in a time long since passed when it was leveraged
for canceling I/O, but nowadays there's nothing fancy happening in the standard
library so it's not really a productive test anyway, hence just ignoring it on
Windows.

Closes #31657

It looks like in practice at least this test will not pass on Windows.
Empirically it is prone to blocking forever, presumably because a call to
`shutdown` doesn't actually wake up other threads on Windows.

We don't document this as a guarantee for `shutdown`, nor do we internally rely
on it. This test originated in a time long since passed when it was leveraged
for canceling I/O, but nowadays there's nothing fancy happening in the standard
library so it's not really a productive test anyway, hence just ignoring it on
Windows.

Closes rust-lang#31657
@rust-highfive
Copy link
Collaborator

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@ranma42
Copy link
Contributor

ranma42 commented Jan 6, 2017

Cancelling I/O can be even more complex than this as Windows, Linux and MacOS have different behaviours regarding the interruption of blocking calls (and what about the BSDs? and so on).
While looking for a fix/workaround to an issue in Mono I had tested what would interrupt a blocked accept() call:

  • on Linux it can be interrupted by a signal() or a shutdown() call
  • on MacOS it can be interrupted by a signal() or a close() call
  • on Windows only closesocket() interrupts the blocked call

Note that on *nix shutdown() seems to be sufficient to interrupt blocked read() or write() calls but aborting an accept() call is harder (and less portable).

@brson
Copy link
Contributor

brson commented Jan 12, 2017

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Jan 12, 2017

📌 Commit 7eb43f1 has been approved by brson

@bors
Copy link
Contributor

bors commented Jan 12, 2017

⌛ Testing commit 7eb43f1 with merge 2782e8f...

bors added a commit that referenced this pull request Jan 12, 2017
std: Ignore close_read_wakes_up on Windows

It looks like in practice at least this test will not pass on Windows.
Empirically it is prone to blocking forever, presumably because a call to
`shutdown` doesn't actually wake up other threads on Windows.

We don't document this as a guarantee for `shutdown`, nor do we internally rely
on it. This test originated in a time long since passed when it was leveraged
for canceling I/O, but nowadays there's nothing fancy happening in the standard
library so it's not really a productive test anyway, hence just ignoring it on
Windows.

Closes #31657
@bors
Copy link
Contributor

bors commented Jan 12, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: brson
Pushing 2782e8f to master...

@bors bors merged commit 7eb43f1 into rust-lang:master Jan 12, 2017
@alexcrichton alexcrichton deleted the ignore-test-on-windows branch January 13, 2017 23:26
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Mar 8, 2022
…, r=Mark-Simulacrum

Enable `close_read_wakes_up` test on Windows

I wonder if we could/should try enabling this again? It was closed by rust-lang#38867 due to rust-lang#31657. I've tried running this test (along with other tests) on my machine a number of times and haven't seen this fail yet,

Caveat: the worst that can happen is this succeeds initially but then causes random hangs in CI. This is not a great failure mode and would be a reason not to do this.

If this does work out, closes rust-lang#39006

r? `@Mark-Simulacrum`
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.

5 participants