ServiceLoader leaks jar_cache file handles

Description

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.

Activity

Show:
Sachin Gokhale
March 18, 2021, 4:27 PM

The increase in start time is acceptable knowing the issue in anything prior to JDK 9, can’t fix this.

Marina Kudryavtseva
March 18, 2021, 7:41 AM

could you please confirm on above?

(FYI )

Adel El-Beik
March 11, 2021, 1:59 PM

This slight increase in start time is acceptable to me, compared to the problem it is fixing. what do you think?

Alexey Panfilov
March 11, 2021, 1:37 PM

Hello

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:

Test Overview

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

 

50th Percentile

90th Percentile

95th Percentile

4.8-HC01

18.86

19.552

19.71

4.8-RC02

20.01

20.804

21.066

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?

Logs attached.

 

Adel El-Beik
February 17, 2021, 1:43 PM

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).

Done

Assignee

Alexey Panfilov

Reporter

Adel El-Beik

Labels

Sprint

None

Epic Link

None

Priority

Medium

Engineering Teams

None

Fix versions

Affects versions

None

Ported to...

None

Story Points / Dev Days

None

Build cut

None

Squad

None