There are actually a few different things going on here.
One, DeflaterOutputStream.write and some other methods could single a closed stream in ways that the existing fix of
JENKINS-10524 did not handle.
Two, while ResponseImpl tries to ensure that only one of getOutputStream or getWriter is called on a given response, this apparently does not work when
JENKINS-20080 is triggered; I think something earlier in the servlet chain called getOutputStream, and then getWriter is called on the wrapper, which calls super, which Jetty treats as an error condition (according to spec) by throwing IllegalStateException(STREAM) from org.eclipse.jetty.server.Response.getWriter. And Stapler’s ResponseImpl wrapper fails to handle this.
Three, InstallUncaughtExceptionHandler would be triggered by the first or second problem and try to display the error…which would fail for the same reason the error was thrown to begin with, yet this failure would be thrown up the call stack and be printed to the servlet log by the container.