-
Notifications
You must be signed in to change notification settings - Fork 601
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
Update scaladoc for Process #3381
Update scaladoc for Process #3381
Conversation
* and interrupting or otherwise canceling a read-in-progress may kill the process. Not draining | ||
* this `Stream` can block the process and may cause the process to block, or even deadlock. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same is true of stderr
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that but was not sure because the docs on the java side only mention stdin and stdout:
Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, or even deadlock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. Maybe I'm wrong actually and stderr
is special. Thanks for pointing it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure it's special, so I've added the warning to stderr
as well.
95d3c34
to
76728c7
Compare
76728c7
to
2900001
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
I fell into this trap last week. Essentially, I was running a program that looks like this:
Unfortunately for me, when the file in question (
lightweight-dynamo.json
in this instance) was somewhat large, my program would hang. I tracked this down to: you must drain stdout if the process you starts is writing to it. Failure to do it can cause the process to block because it's write buffer is full (because nobody reads from it). Relevant java docs.This change in the documentation should help avoiding such issue. But I think the best thing would be to have a mechanism in place to ensure stdin is drained. I'm not sure how I would implemented this though.