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

Windows named pipes hits unreachable code during read operation #1819

Open
akahan opened this issue Jul 27, 2024 · 5 comments
Open

Windows named pipes hits unreachable code during read operation #1819

akahan opened this issue Jul 27, 2024 · 5 comments

Comments

@akahan
Copy link

akahan commented Jul 27, 2024

The error occurs at this location:

_ => unreachable!(),

In io.read comes State::Err with: Err The pipe has been ended. (os error 109)
This appears on both Windows 11 and Windows 10.

It reproduced almost stably when closing the laptop lid with running service and client, apparently after switching to standby mode.

If I handle this state and simply exit the read_done method without calling unreachable (and assign the same error state to io.read again. Perhaps it's better not to do this?), everything continues to work, seemingly normal. Any comments guys?

My environment works like this:
The Windows service creates a named pipe as an administrator (both PipeMode::Bytes and PipeMode::Message modes were tested). After which the client connects to it and sends a message 2 times per second and reads the response.

@Thomasdezeeuw
Copy link
Collaborator

Maybe related to #1660?

@akahan what version of Mio are you running?

@akahan
Copy link
Author

akahan commented Jul 27, 2024

last version 1.0.1

@akahan
Copy link
Author

akahan commented Jul 27, 2024

Even if it's a similar bug #1660. In any case, it is not fixed.

@akahan
Copy link
Author

akahan commented Jul 27, 2024

I can not understand. If io.read | io.write state can be Err, why is it not checked here, but only Pending is checked, and the rest is supposedly unreachable?

@akahan
Copy link
Author

akahan commented Jul 27, 2024

Here https://github.com/akahan/mio/tree/v1.0.1-dev is the code that I used to temporarily solve this problem.

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

No branches or pull requests

2 participants