On Fri, Sep 12, 2025 at 12:56 PM Rainer Jung <[email protected]> wrote:
> I am seeing sporadic but relatively frequent test errors for > org.apache.coyote.http2.TestCancelledUpload when used with NIO2 (not > with NIO). Details checked for 10.1.46. > > - alway test case testCancelledRequest[0: loop [0], useAsyncIO[false]] > > - either a broken pipe: > > Testcase: testCancelledRequest[0: loop [0], useAsyncIO[false]] took > 3.819 sec > Caused an ERROR > Connection reset by peer > java.net.SocketException: Connection reset by peer > at > java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:425) > at java.base/sun.nio.ch > .NioSocketImpl.write(NioSocketImpl.java:445) > at > java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:831) > at > java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1035) > at > java.base/java.io > .BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81) > at > java.base/java.io > .BufferedOutputStream.write(BufferedOutputStream.java:122) > at > org.apache.coyote.http2.Http2TestBase.writeFrame(Http2TestBase.java:492) > at > org.apache.coyote.http2.Http2TestBase.writeFrame(Http2TestBase.java:486) > at > org.apache.coyote.http2.Http2TestBase.writeFrame(Http2TestBase.java:481) > at > > org.apache.coyote.http2.TestCancelledUpload.testCancelledRequest(TestCancelledUpload.java:60) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native > Method) > at > > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) > at > > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > > - or a connection reset: > > Testcase: testCancelledRequest[0: loop [0], useAsyncIO[false]] took > 3.819 sec > Caused an ERROR > Connection reset by peer > java.net.SocketException: Connection reset by peer > at > java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:425) > at java.base/sun.nio.ch > .NioSocketImpl.write(NioSocketImpl.java:445) > at > java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:831) > at > java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1035) > at > java.base/java.io > .BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81) > at > java.base/java.io > .BufferedOutputStream.write(BufferedOutputStream.java:122) > at > org.apache.coyote.http2.Http2TestBase.writeFrame(Http2TestBase.java:492) > at > org.apache.coyote.http2.Http2TestBase.writeFrame(Http2TestBase.java:486) > at > org.apache.coyote.http2.Http2TestBase.writeFrame(Http2TestBase.java:481) > at > > org.apache.coyote.http2.TestCancelledUpload.testCancelledRequest(TestCancelledUpload.java:60) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native > Method) > at > > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) > at > > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > > It is always test case "useAsyncIO[false]]". > > Best regards, > > Rainer > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > The server waits for the writing to finish, with NIO2 useAsyncIO[false]], in order to send the 403 response, but it reaches timeout before this since it seems 5 seconds are not enough for the parser to start reading. We could override the http2Connect() for this specific scenario to increase the streamWriteTimeout. private void http2Connect() { if (isNio2 && !useAsyncIO) { enableHttp2(200, false, 10000, 10000, 25000, 10000, *30000*); } else { enableHttp2(tls); } configureAndStartWebApplication(); openClientConnection(false); doHttpUpgrade(); sendClientPreface(); validateHttp2InitialResponse(); } Though since it's sporadic and personally have not faced this error before, I don't think there's real value to this change. Kind regards, Dimitris
