Skip to content

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

Description

@PawelLipski

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions