Skip to content

Commit

Permalink
[JENKINS-32825] Deadlock in Channel Abort
Browse files Browse the repository at this point in the history
Additional `closed` state check introduced to break writing loop.
  • Loading branch information
Andres Rodriguez committed Feb 7, 2016
1 parent 54cec7a commit 3ea38c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/org/jenkinsci/remoting/nio/FifoBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,12 @@ public void write(byte[] buf, int start, int len) throws InterruptedException, I
int chunk;

synchronized (lock) {
while ((chunk = Math.min(len,writable()))==0)
while ((chunk = Math.min(len,writable()))==0) {
if (closed)
throw new IOException("closed during write operation");

lock.wait(100);
}

w.write(buf, start, chunk);

Expand Down

0 comments on commit 3ea38c8

Please sign in to comment.