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

Fix resource leak in Maven plugin #571

Merged
merged 11 commits into from
Jun 29, 2020

Commits on Jun 27, 2020

  1. NPM formatters changed to have their signatures based on package.json…

    … file instead of the
    
    whole node_modules directory.
    lutovich authored and nedtwigg committed Jun 27, 2020
    Configuration menu
    Copy the full SHA
    b695622 View commit details
    Browse the repository at this point in the history
  2. Fix resource leak in Maven plugin

    The resource leak increased the number of threads with every execution of
    Exclipse-based formatter step in a Maven module. It happened because the
    `SpotlessCache` wasn't properly utilized. Every cache key was based on
    randomized file names because Maven plugin relocates config files into
    the target directory with a random file name. This resulted in all cache
    accesses being cache misses.
    
    This commit fixes the problem by:
    
     * making the Maven plugin use non-random file names for output files.
       `FileLocator` is changed to construct names based on a hash of the
       input path. Input path can be a URL, file in a JAR, or a regular
       local file
    
     * changing `FileSignature` (used for `SpotlessCache` keys) to use filenames
       instead of paths and file hashes instead of last modified timestamps
    
    These two changes allow `FileSignature` to uniquely identify a set of files
    by their content and not take file paths into account. As a result, created
    keys for `SpotlessCache` are properly comparable which results in lots of
    cache hits and decreased number of created threads.
    
    Changed `FileSignature` only accepts files, not directories.
    lutovich authored and nedtwigg committed Jun 27, 2020
    Configuration menu
    Copy the full SHA
    823c2c3 View commit details
    Browse the repository at this point in the history
  3. Use a central cache for the FileSignature, so that we keep the local …

    …performance based on lastModified that we had prior to this PR.
    nedtwigg committed Jun 27, 2020
    Configuration menu
    Copy the full SHA
    e4db705 View commit details
    Browse the repository at this point in the history
  4. No need for the FileSignature cache to store multiple versions per-fi…

    …le, once a file has changed, we can discard the old one.
    nedtwigg committed Jun 27, 2020
    Configuration menu
    Copy the full SHA
    e872905 View commit details
    Browse the repository at this point in the history
  5. Add a descriptive error-message for the highly-unexpected case

    where a FileSignature is generated for multiple files with the same filename.
    nedtwigg committed Jun 27, 2020
    Configuration menu
    Copy the full SHA
    aaddff8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    cb724e9 View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2020

  1. Configuration menu
    Copy the full SHA
    5ca3b18 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    267767a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    51647ab View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2020

  1. Configuration menu
    Copy the full SHA
    5bf0896 View commit details
    Browse the repository at this point in the history
  2. Suppress unused warnings.

    nedtwigg committed Jun 29, 2020
    Configuration menu
    Copy the full SHA
    2395492 View commit details
    Browse the repository at this point in the history