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

io.undertow.servlet.spec.ServletPrintWriter.close() high CPU when encoding characters on previously errored writer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 2.3.16.Final, 2.2.35.Final
    • 2.3.15.Final, 2.2.33.SP1
    • Servlet
    • None

      io.undertow.servlet.spec.ServletPrintWriter.close can reach a high CPU state if encoding characters on a writer that experienced a previous error.

      Below is one of these threads' stack trace.

      "default task-308" #1852 prio=5 os_prio=0 tid=0x000055569338e000 nid=0x4243c runnable [0x00007fa229393000]
      java.lang.Thread.State: RUNNABLE
      at sun.nio.cs.UTF_8$Encoder.encodeLoop(UTF_8.java:693)
      at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:579)
      at io.undertow.servlet.spec.ServletPrintWriter.close(ServletPrintWriter.java:104)
      at io.undertow.servlet.spec.ServletPrintWriterDelegate.close(ServletPrintWriterDelegate.java:81)
      at io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:491)
      at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:586)
      at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:339)
      at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:79)
      at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134)
      at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131)
      at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
      at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
      at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
      at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction$$Lambda$1615/584218055.call(Unknown Source)
      at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
      at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$1616/1062105923.call(Unknown Source)
      at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
      

              rhn-support-aogburn Aaron Ogburn
              rhn-support-aogburn Aaron Ogburn
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: