Skip to content

AWS: Close the S3SeekableInputStreamFactory before removing from cache #12891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SanjayMarreddi
Copy link
Contributor

Current integration with the S3 Analytics Accelerator Library ( #12299 ) is not closing the S3SeekableInputStreamFactory on S3FileIO close. This PR incorporates that logic by closing it before removing from cache.

@github-actions github-actions bot added the AWS label Apr 24, 2025
}
}
}

public static void cleanupCache(
S3AsyncClient asyncClient, S3FileIOProperties s3FileIOProperties) {
STREAM_FACTORY_CACHE.invalidate(Pair.of(asyncClient, s3FileIOProperties));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before invalidating the factories from the cache also we should close the factories.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, current removalListener implementation already handles this case. In Caffeine, 'invalidation' (manual removal by the caller) and 'eviction' (removal due to cache policy) are both treated as removals.

Copy link

@rajdchak rajdchak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before invalidating the factories from the cache also we should close the factories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants