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]: FileSystems have a high risk of leaking resources due to the repeated invocation of FileSystems.setDefaultPipelineOptions #26321
The underlying issue here is the repeated initialization of filesystems triggered in SerializablePipelineOptions (#18430).
Every call to FileSystems.setDefaultPipelineOptions() will silently replace any existing previous file systems without cleaning up resources.
In the case of S3FileSystem this can leak threads if the file system was already in use.
The simple test below shows the every increasing number of threads in the system.
publicclassS3FileSystemTest {
@TestpublicvoidtestSetDefaultPipelineOptions() throwsException {
S3Optionss3Options = s3Options();
s3Options.setAwsCredentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("key", "secret")));
for (inti = 0; i < 1000; i++) {
FileSystems.setDefaultPipelineOptions(s3Options);
FileSystems.match(ImmutableList.of("s3://bucket/key*"));
System.out.println("Number of threads " + Thread.activeCount());
}
}
}
This is particularly bad with some runners, e.g. see #17645:
A normal Go Flink ValidatesRunner execution would contain the logging line from this class nearly 80,000 times, making it much more difficult to read the logs.
Activity