There seems to be two different EOFExceptions being thrown: java.io.EOFException
and org.eclipse.jetty.io.EofException
. The main file in play here (used by both client/server side) is CommitSpool.java
This exception is being thrown to indicate an early, unexpected, EOF. The exception is most commonly thrown at the start of an ATH test against staging, but it can be found in prod with clients other than cloudbees
. Following the stack trace, it seems like, while reading the input stream, a read is requested with a valid size
determined from what is remaining to be read but the read()
call throws an exception because the stream returned at -1
here.
I think that it would be safe to just handle the exception gracefully from the server side, but still indicate to the client that it wasn't successful.
This one is more interesting since the error is being thrown at the initialization of the GZipInputStream
before an external read is even attempted. When CommitSpoolClient
starts the upload inside the send()
method, the first thing that happens is wrapping the output stream inside a GZipOutputStream
which, during the construction, writes the GZipHeaders. From the server side, the exception is getting thrown at the CommitSpool#receiveUpload()
when the input stream gets wrapped inside a GZIPInputStream
which, during construction, attempts to reads the same GZipHeaders. This read results in a -1
indicating an empty stream and throws the java.io.EOFException
.
I've been looking at the client to try and determine where an empty outputstream could possibly occur, but it seems like the outputstream always writes those GZipHeaders.