there was apparently some kind of race condition, because occasionally test fails trying to call close once too many (that is, one channel (X) sends CloseCommand to the other (Y), which sends back CloseCommand to X, and somehow X sends one more CloseCommand to Y, causing an exception below.) I thought the use of the 'close' field and synchronization is enough to guard against this condition, but apparently it's not. I added one more 'closing' field, which seems to fix the problem. It just doesn't feel right when you fix the issue without getting to the bottom, but the concurrency bug is hard to reproduce and I'm exhausted. ---- forking a new process Feb 15, 2007 6:09:30 AM hudson.remoting.Channel$CloseCommand execute SEVERE: close command failed java.io.IOException: Pipe closed         at java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:190)         at java.io.PipedInputStream.receive(PipedInputStream.java:156)         at java.io.PipedOutputStream.write(PipedOutputStream.java:129)         at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1682)         at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1591)         at java.io.ObjectOutputStream.writeNonProxyDesc(ObjectOutputStream.java:1173)         at java.io.ObjectOutputStream.writeClassDesc(ObjectOutputStream.java:1127)         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)         at java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1398)         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:305)         at hudson.remoting.Channel.send(Channel.java:183)         at hudson.remoting.Channel.close(Channel.java:347)         at hudson.remoting.Channel$CloseCommand.execute(Channel.java:329)         at hudson.remoting.Channel$ReaderThread.run(Channel.java:372) Feb 15, 2007 6:09:30 AM hudson.remoting.Channel$ReaderThread run SEVERE: I/O error in channel java.io.EOFException         at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2498)         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1273)         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)         at hudson.remoting.Channel$ReaderThread.run(Channel.java:366) channel started
there was apparently some kind of race condition, because occasionally test fails trying to call close once too many (that is, one channel (X) sends CloseCommand to the other (Y), which sends back CloseCommand to X, and somehow X sends one more CloseCommand to Y, causing an exception below.) I thought the use of the 'close' field and synchronization is enough to guard against this condition, but apparently it's not. I added one more 'closing' field, which seems to fix the problem. It just doesn't feel right when you fix the issue without getting to the bottom, but the concurrency bug is hard to reproduce and I'm exhausted. ---- forking a new process Feb 15, 2007 6:09:30 AM hudson.remoting.Channel$CloseCommand execute SEVERE: close command failed java.io.IOException: Pipe closed         at java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:190)         at java.io.PipedInputStream.receive(PipedInputStream.java:156)         at java.io.PipedOutputStream.write(PipedOutputStream.java:129)         at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1682)         at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1591)         at java.io.ObjectOutputStream.writeNonProxyDesc(ObjectOutputStream.java:1173)         at java.io.ObjectOutputStream.writeClassDesc(ObjectOutputStream.java:1127)         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)         at java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1398)         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:305)         at hudson.remoting.Channel.send(Channel.java:183)         at hudson.remoting.Channel.close(Channel.java:347)         at hudson.remoting.Channel$CloseCommand.execute(Channel.java:329)         at hudson.remoting.Channel$ReaderThread.run(Channel.java:372) Feb 15, 2007 6:09:30 AM hudson.remoting.Channel$ReaderThread run SEVERE: I/O error in channel java.io.EOFException         at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2498)         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1273)         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)         at hudson.remoting.Channel$ReaderThread.run(Channel.java:366) channel started

git-svn-id: 28f34f9aa52bc55a5ddd5be9e183c5cccadc6ee4@2217 71c3de6d-444a-0410-be80-ed276b4c234a

oleg-nenashev/remoting,oleg-nenashev/remoting,jenkinsci/remoting,jenkinsci/remoting