From efcef1ed92ec5cdaefd4a76e8441e14fb7d4284a Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Sat, 12 Mar 2016 17:48:57 +0100 Subject: [PATCH] fixing lots of 'java.io.IOException: Stream closed' exceptions in logs --- platform/util/src/com/intellij/util/io/BaseDataReader.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/util/src/com/intellij/util/io/BaseDataReader.java b/platform/util/src/com/intellij/util/io/BaseDataReader.java index 29610d72ef59..a1007f7d39e9 100644 --- a/platform/util/src/com/intellij/util/io/BaseDataReader.java +++ b/platform/util/src/com/intellij/util/io/BaseDataReader.java @@ -128,7 +128,9 @@ public abstract class BaseDataReader { while (true) { boolean read = readAvailable(); - if (isStopped) { + if ((!read && isStopped) || mySleepingPolicy == SleepingPolicy.BLOCKING) { + // in non-blocking mode, if we have read something on a previous step, we should check + // if some additional output is available no matter whether the process is already stopped or not break; }