High CPU usage in io.undertow.servlet.spec.ServletPrintWriter.close() on JBoss EAP 7.x/8.0.x
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.x
- 8.0.x
Issue
- JBoss EAP reaches a point of high CPU and we have to restart to clear it. High CPU consumers are shown on default task request processing threads in calls like below:
"default task-1" #175 prio=5 os_prio=0 tid=0x000055ff6ad45800 nid=0x23858c runnable [0x00007f89967fd000]
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:328)
...(snip)...
Resolution
- Update to EAP 7.4.20+ and EAP 8.0.5+
Root Cause
- This issue has been reported as the following JIRAs:
- For EAP 7.4.x: This content is not included.JBEAP-27599 fixed in EAP 7.4.20
- For EAP 8.0.x: This content is not included.JBEAP-27703 fixed in EAP 8.0.5
- Upstream Undertow: This content is not included.UNDERTOW-2425
SBR
Components
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.