You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] FileInJarReadableDataSource.close() does not release the JAR file #3660
FileInJarReadableDataSource opens a JarFile during construction, but its close() method only sets the read buffer to null. The JarFile remains open after the data source is closed.
On Linux, creating and closing 20 data sources for 20 different temporary JARs leaves all 20 JAR file descriptors open while those closed data source objects remain reachable. This can consume file descriptors during repeated data source initialization and cleanup, and retain locks on JAR files on platforms that lock open files.
Describe what you expected to happen
Closing the data source should immediately close its owned JarFile, including when the initial configuration parser fails. Repeated closes should remain safe.
How to reproduce it (as minimally and precisely as possible)
Create 20 distinct temporary JAR files using JarOutputStream, each containing rules.json with the content [].
For each JAR, construct a FileInJarReadableDataSource<String> with an identity converter, retain the data source in a list, and call close().
Inspect /proc/self/fd symlink targets within the same JVM for those temporary JAR paths.
Observed with the current 1.8 branch (a3f40ba8e900c8489bd520274739f17235a7721c):
JAR descriptors before=0; after closing 20 sources=20
Closing the owned JarFile in close() gives:
JAR descriptors before=0; after closing 20 sources=0
Tell us your environment
Linux, Eclipse Temurin JDK 17.0.20.1, current 1.8 branch. The file descriptor check uses real JAR files and real data sources without mocks.
Anything else we need to know?
This resource lifecycle issue is independent of how entry contents are read.
Activity