Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-1843

ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallel[proxy][http2-clear-upgrade] fails, buffer leak

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 2.2.1.Final, 2.2.2.Final, 2.2.3.Final
    • Servlet
    • None
    • Hide
      1. cd <undertow_root>
        
      2. mvn -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dmdep.analyze.skip=true -Dpmd.skip clean install -DskipTests
        
      3. cd servlet
        
      4. mvn test --show-version -Dmaven.javadoc.skip=true -DskipUnitTests -Pproxy -Denforcer.skip -Dtest=ServletInputStreamRequestBufferingTestCase.java -DfailIfNoTests=false -Dtest.level=DEBUG
        
      Show
      cd <undertow_root> mvn -Dmaven.javadoc.skip= true -Dcheckstyle.skip= true -Dmdep.analyze.skip= true -Dpmd.skip clean install -DskipTests cd servlet mvn test --show-version -Dmaven.javadoc.skip= true -DskipUnitTests -Pproxy -Denforcer.skip -Dtest=ServletInputStreamRequestBufferingTestCase.java -DfailIfNoTests= false -Dtest.level=DEBUG
    • Undefined

      This test:

      io.undertow.servlet.test.streams.ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallel[proxy][http2-clear-upgrade]
      

      started to fail quite consistently on my machine with following failure:

      [ERROR] Errors: 
      [ERROR] io.undertow.servlet.test.streams.ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade](io.undertow.servlet.test.streams.ServletInputStreamRequestBufferingTestCase)
      [ERROR]   Run 1: ServletInputStreamRequestBufferingTestCase>AbstractServletInputStreamTestCase.testAsyncServletInputStreamInParallelOffIoThread:130->AbstractServletInputStreamTestCase.runTestParallel:293 » Execution
      [ERROR]   Run 2: ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade] » Runtime
      [ERROR]   Run 3: ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade] » Runtime
      [ERROR]   Run 4: ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade] » Runtime
      [ERROR]   Run 5: ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade] » Runtime
      [ERROR]   Run 6: ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade] » Runtime
      [ERROR]   Run 7: ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade] » Runtime
      [ERROR]   Run 8: ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade] » Runtime
      [ERROR]   Run 9: ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade] » Runtime
      [ERROR]   Run 10: ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade] » Runtime
      [ERROR]   Run 11: ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade] » Runtime
      [ERROR]   Run 12: ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade] » Runtime
      

      I can see e.g. these in the surefire output:

      [ERROR] testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade](io.undertow.servlet.test.streams.ServletInputStreamRequestBufferingTestCase)  Time elapsed: 21.668 s  <<< ERROR!
      java.lang.RuntimeException: Buffer Leak io.undertow.servlet.test.streams.ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallelOffIoThread[proxy][http2-clear-upgrade]
      	at io.undertow.testutils.DefaultServer$2.testFinished(DefaultServer.java:294)
      	at org.junit.runner.notification.SynchronizedRunListener.testFinished(SynchronizedRunListener.java:87)
      	at org.junit.runner.notification.RunNotifier$9.notifyListener(RunNotifier.java:225)
      	at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
      	at org.junit.runner.notification.RunNotifier.fireTestFinished(RunNotifier.java:222)
      	at org.junit.internal.runners.model.EachTestNotifier.fireTestFinished(EachTestNotifier.java:38)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:372)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
      	at io.undertow.testutils.DefaultServer.runChild(DefaultServer.java:532)
      	at io.undertow.testutils.DefaultServer.runChild(DefaultServer.java:105)
      	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
      	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
      	at io.undertow.testutils.DefaultServer.run(DefaultServer.java:302)
      	at org.junit.runners.Suite.runChild(Suite.java:128)
      	at org.junit.runners.Suite.runChild(Suite.java:27)
      	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
      	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
      	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
      	at org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:55)
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:137)
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:107)
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:83)
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75)
      	at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:158)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:383)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:344)
      	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:125)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:417)
      Caused by: java.lang.RuntimeException: java.nio.DirectByteBuffer[pos=0 lim=8192 cap=8192] NO: 71050 [NO_CONTEXT]
      	at io.undertow.testutils.DebuggingSlicePool$DebuggingBuffer.<init>(DebuggingSlicePool.java:84)
      	at io.undertow.testutils.DebuggingSlicePool.allocate(DebuggingSlicePool.java:45)
      	at io.undertow.conduits.ChunkedStreamSourceConduit$1.allocate(ChunkedStreamSourceConduit.java:73)
      	at io.undertow.conduits.ChunkedStreamSourceConduit.read(ChunkedStreamSourceConduit.java:183)
      	at org.xnio.conduits.ConduitStreamSourceChannel.read(ConduitStreamSourceChannel.java:127)
      	at io.undertow.util.ConnectionUtils.doDrain(ConnectionUtils.java:96)
      	at io.undertow.util.ConnectionUtils.cleanClose(ConnectionUtils.java:74)
      	at io.undertow.client.http.HttpClientConnection.close(HttpClientConnection.java:472)
      	at org.xnio.IoUtils.safeClose(IoUtils.java:152)
      	at io.undertow.server.handlers.proxy.ProxyHandler$IoExceptionHandler.handleException(ProxyHandler.java:809)
      	at org.xnio.ChannelListeners.invokeChannelExceptionHandler(ChannelListeners.java:126)
      	at io.undertow.util.Transfer.initiateTransfer(Transfer.java:82)
      	at io.undertow.server.handlers.proxy.ProxyHandler$ResponseCallback.completed(ProxyHandler.java:741)
      	at io.undertow.server.handlers.proxy.ProxyHandler$ResponseCallback.completed(ProxyHandler.java:692)
      	at io.undertow.client.http.HttpClientExchange.setResponse(HttpClientExchange.java:125)
      	at io.undertow.client.http.HttpClientConnection$ClientReadListener.handleEvent(HttpClientConnection.java:651)
      	at io.undertow.client.http.HttpClientConnection$ClientReadListener.handleEvent(HttpClientConnection.java:516)
      	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
      	at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
      	at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
      	at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)
      

      I'm adding complete surefire reports ran with `-Dtest.level=DEBUG`.

      Basic info about my machine:

      $ uname -a
      Linux localhost.localdomain 5.10.11-200.fc33.x86_64 #1 SMP Wed Jan 27 20:21:22 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
      $ java --version
      openjdk 11.0.10 2021-01-19
      OpenJDK Runtime Environment 18.9 (build 11.0.10+9)
      OpenJDK 64-Bit Server VM 18.9 (build 11.0.10+9, mixed mode, sharing)
      $ mvn --show-version
      Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
      Maven home: /home/jstourac/mvns/latest
      Java version: 11.0.10, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.10.0.9-0.fc33.x86_64
      Default locale: en_US, platform encoding: UTF-8
      OS name: "linux", version: "5.10.11-200.fc33.x86_64", arch: "amd64", family: "unix"
      

              flaviarnn Flavia Rainone
              jstourac@redhat.com Jan Stourac
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: