-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Can't shutdown stdin of process #2199
Copy link
Copy link
Closed
Labels
A-tokioArea: The main tokio crateArea: The main tokio crateC-bugCategory: This is a bug.Category: This is a bug.M-processModule: tokio/processModule: tokio/process
Metadata
Metadata
Assignees
Labels
A-tokioArea: The main tokio crateArea: The main tokio crateC-bugCategory: This is a bug.Category: This is a bug.M-processModule: tokio/processModule: tokio/process
Type
Fields
Give feedbackNo fields configured for issues without a type.
Version
0.2.11
Platform
Ubuntu 18.04 x64
Subcrates
process, io
Description
So I'm piping into and out of a process using tokio process. And the input goes fine, and the output pipe was getting to the last byte then hanging (when I did it in chunks) or just hanging if I tried to use
read_to_end.I ended up diagnosing this further and finding that the stdin wasn't being closed so I added a shutdown() to my code but then the write hung there (write function included).
To solve this temporarily I've removed the shutdown and in my read I read chunks into a buffer and have a timeout to spot the end of stream since the program I'm piping to/from is very fast. But I'm wondering if there's an issue there