Recently, we have been seeing our Jenkins instance regularly consume a ton of file descriptors, to the point of maxing out the users limit.
This growth is quite visible when using the monitoring plugin attached at the bottom.
We had fairly stable performance up until this point.
In investigating, the files that were open in large frequencies were almost always files that had been loaded with the libraryResource pipeline step.
Upon further investigation, I found this recent change: https://github.com/jenkinsci/workflow-cps-global-lib-plugin/commit/e03488893cdeabe4738a443a0bfadd5306c46b73#diff-fd5e052acc6b8e96384fe9ab7850852aL205
Previously, the implementation used FilePath.readToString() in order to read the file. This method uses a try-with-resources to read the InputStream, ensuring the input is closed prior to the method exiting.
The newer implementation has lost this safety, causing a file leak anytime a file is ready with libraryResource.
We had fairly