-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Strange freezing behavior of unidirectional Windows named pipes on single-threaded runtime #5170
Comments
Seems like a Tokio bug to me. Currently filed as tokio-rs/tokio#5170.
Does tokio-console report any tasks being constantly busy? |
This code spins inside tokio/tokio/src/net/windows/named_pipe.rs Lines 194 to 206 in 01f0193
I think changing pub async fn connect(&self) -> io::Result<()> {
self.io.registration().async_io(Interest::WRITABLE, || self.io.connect()).await?;
Ok(())
} |
@Darksonn does the suggestion by @satakuma solve the issue, or do I need to look into the Mio side of things? Also /cc @carllerche who wrote the implementation. |
I was just about to say that the current implementation is equivalent to what |
@satakuma I tried applying your suggestion, but it seems that it isn't working and the windows CI seems to be stuck. Do you happen to know why? I don't have a windows machine available, so its quite difficult for me to test myself. |
I apologize, should have tested it properly. It seems that with my suggestion |
Version
Tested on latest 1.21.2 and also on 1.8.0
Platform
64-bit Windows 10, version
10.0.19043 N/A Build 19043
Description
The issue occurs with the following snippet (I believe this is the best MCVE I can come up with as I have no ideas on how to reduce the size of this further):
On a single-threaded runtime, the program freezes, as if having encountered a deadlock. (This state is actually a busy loop where the process is at 100% utilization of a single core.) If the
INBOUND
constant is set totrue
, the snippet runs fine.On a multi-threaded runtime, the program runs correctly in both situations (timely termination with no output).
I assume that the freezing isn't intended behavior because
spawn_blocking()
isn't called anywhere in the program, but please let me know if I got something wrong and wrote code that cannot work on a single-threaded runtime by design. Thanks in advance!The text was updated successfully, but these errors were encountered: