Skip to content
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

Untangle file access in codec-registration-checker-compiler-plugin #312

Open
PawelLipski opened this issue Apr 24, 2023 · 0 comments
Open
Labels
code quality Code quality

Comments

@PawelLipski
Copy link
Collaborator

PawelLipski commented Apr 24, 2023

We've got two places now:

  1. CodecRegistrationCheckerCompilerPlugin#init
  2. SerializerCheckCompilerPluginComponent...#interactWithTheCacheFile

where there's pessimistic locking (java.nio.channels.FileChannel#lock(), introduced on #131) wrapped into optimistic locking (retry on OverlappingFileLockException, first introduced on #218 and then by myself on #310).

The need for retry on OverlappingFileLockException clearly indicates that FileChannel#lock() doesn't fulfil its purpose. Let's figure out a proper solution for the problem. Probably the easiest approach would be not to use filesystem locks at all, just application-level locks within codec-registration-checker-compiler-plugin itself instead. Still, if it's possible to achieve pessimistic locking on filesystem, that's probably the cleanest solution.

I'd suggest doing a research/comparing viable options on a separate sandbox project, unrelated to ASH, and only then updating CodecRegistrationCheckerCompilerPlugin and SerializerCheckCompilerPluginComponent.

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

No branches or pull requests

1 participant