-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins version 2.332.2, Amazon EC2 Plugin version 2.0.4
After using the EC2 plugin with Windows agents, we're seeing file handles leaked that reference remoting.jar. A couple thousand of these file handles are occurring daily, resulting in us needing to restart the controller every night as a workaround.
Below is an example, which is reported by the File Leak Detector Plugin. This example reports the thread as "input copy", while other instances read "output copy". But otherwise the files reported including the stack trace are always the same, and originate in hudson.plugins.ec2.win.winrm.*
#1689 socket to /172.30.87.121:5985 by thread:input copy: java -jar C:\Windows\Temp\remoting.jar -workDir c:\j on Thu Nov 17 00:35:32 UTC 2022 at java.base/java.net.AbstractPlainSocketImpl.create(AbstractPlainSocketImpl.java:151) at java.base/java.net.Socket.createImpl(Socket.java:477) at java.base/java.net.Socket.getImpl(Socket.java:540) at java.base/java.net.Socket.setSoTimeout(Socket.java:1159) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:120) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) at hudson.plugins.ec2.win.winrm.WinRMClient.sendRequest(WinRMClient.java:262) at hudson.plugins.ec2.win.winrm.WinRMClient.sendRequest(WinRMClient.java:237) at hudson.plugins.ec2.win.winrm.WinRMClient.sendInput(WinRMClient.java:126) at hudson.plugins.ec2.win.winrm.WindowsProcess$2.run(WindowsProcess.java:141)
We have tried to tweak EC2 Plugin settings, etc but haven't managed to find a way to avoid this yet. Any recommendations would be greatly appreciated. Thanks!