Undertow multi-part upload can potentially leak file descriptors
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.1.x
- 7.2.1
Issue
- When Too many open files occurred, there are a lot of FDs like as follows in lsof results. And those continues to remain.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
...
java 14293 jboss 2022r REG 253,0 0 123123411 /PATH_TO/undertow3910449410434351231upload (deleted)
java 14293 jboss 2023r REG 253,0 12311 321232114 /PATH_TO/undertow1123943802489403213upload (deleted)
java 14293 jboss 2024r REG 253,0 12311 298237411 /PATH_TO/undertow3190321842317483219upload (deleted)
Resolution
Upgrading EAP 7.2.1 or later.
As a temporary measure, increasing FD and restart EAP periodically.
But it needs to upgrade 7.2.1 to resolve fundamentally.
Root Cause
This issue has reported as Content from issues.jboss.org is not included.JBEAP-16176 / Content from issues.jboss.org is not included.UNDERTOW-1474.
If using multi-part file uploading in web application, Undertow has potential to leak file descriptor by this bug.
This issue was fixed on 7.2.1 and later.
Diagnostic Steps
When getting lsof -p <PID>, you can see the following FD increasing and remaining.
/PATH_TO/undertow1123943802489403213upload (deleted)
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.