Community
Participate
Working Groups
Build Identifier: We should not check flushCounter.get() > 0 in catch block, because of such scenario: StreamCopyThread |OtherThread -----------------------------------------+----------------------------------- |invoke flush() | flushCounter.incrementAndGet(); n = src.read(buf);//read smth | if (flushCounter.get() > 0) continue; | if (needFlush()) | dst.flush(); //now flushCounter is 0 | src.read(buf); //block on read | | interrupt(); //in catch: | if (flushCounter.get() > 0) //false | throw wakey; | //in finally: | src.close(); | dst.close(); | |//return from flush() and try to write smth to closed stream, |//get IOException("Pipe closed") Since we use StreamCopyThrea.interrupt() for signaling it should make flush(), let's always ignore InterruptedExceptions. Patch to fix it is attached. Reproducible: Always
Created attachment 168696 [details] patch to fix problem
Applied in b3247ba5244d95e0d2c850a3fa1f69668a5790f5