Use unwrapped underlying subprocess input streams when pumping #3360
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sometimes when you run tests in client/server mode and interrupt the run, it leaves the server stuck at the stack trace below. Eventually,
jps
shows a bunch ofMillServerMain
processes that seem to be stuckThe problem seems to go away when using unwrapped streams. I suspect it's due to com-lihaoyi/os-lib#28 which means that the
InputPumper
calling.available()
never gets-1
to indicate the stream is complete, but instead keeps getting0
telling it to try again.The failure mode is nondeterministic, but running
./mill main.resolve.test
, entering garbage into the terminal, andCtrl-C
to cancel seems to reproduce it reasonably well in a few minutes. And with this PR, I haven't been able to reproduce it: no matter how I fiddle with./mill main.resolve.test
and garbage input andCtrl-C
, I always end up with only a singleMillServerMain
process when callingjps
I don't know exactly what the failure mechanism is, but as a shot in the dark hopefully this fixes it