diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java index 8d39a22ac..eabe72b25 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java @@ -118,7 +118,13 @@ public void run() { for (;;) { try { if (readInterrupted) { - dst.flush(); + try { + dst.flush(); + } catch (InterruptedIOException e) { + // There was a new flush() call during flush previous bytes + // need continue read/write/flush for the new bytes + continue; + } readInterrupted = false; if (!flushCount.compareAndSet(flushCountBeforeRead, 0)) { // There was a flush() call since last blocked read.