ServiceLoader leaks jar_cache file handles
In the AttachmentsClassLoaderBuilder a ServiceLoader is used to load SerializationWhitelists. This ServiceLoader will cache jars from the URLClasspath. The handles to these jars are not closed.
Fix here is to disable the caching of the URLConnection object.
The increase in start time is acceptable knowing the issue in anything prior to JDK 9, can’t fix this.
could you please confirm on above?
This slight increase in start time is acceptable to me, compared to the problem it is fixing. what do you think?
We have checked the case which covers leaking file descriptors where nodes have exchanged transactions with attachments, and it looks like this issue has been fixed in 4.8-RC02. The number of open file descriptors remained stable during the test, while in 4.8-HC01 we saw a steady increase. Please see screenshots below:
Open File Descriptors
However, looking at the node startup time performance, we have observed that startup time has increased for CE4.8-RC02 in approximately 6-7% relatively to CE4.8-HC01. Please see the stats for 135 start up attempts:
Startup Time (Seconds) - 135 Starts
The newly created node with finance cordapp installed was used for both runs.
Could you please confirm if this growth is expected and acceptable for that change?
Can you check performance, i.e. node startup time is about the same. Nothing else specifically, other than the existing tests should all still work.
Also if you do check file handle leaks, then you now wont see them grow, specifically the jar_cache handles, or rather they will grow until a GC occurs, then number goes down.
Yes this also affects CE, and there is a PR outstanding to fix 4.8 (and all the other branches).