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

Checker Cache invalidated falsely on load in second run due to external resources #3489

Closed
rnveach opened this Issue Oct 2, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@rnveach
Member

rnveach commented Oct 2, 2016

I tried populating the cache file with a modified CS run with all files because of #3488, to verify another issue. During debugging, I noticed all files were being reported as not in the cache even though I could verify them in my cache file.
The cache file was being invalidated in the beginning due to:

final String cachedConfigHash = details.getProperty(CONFIG_HASH_KEY);
if (!currentConfigHash.equals(cachedConfigHash)) {
// Detected configuration change - clear cache
details.clear();
details.setProperty(CONFIG_HASH_KEY, currentConfigHash);
}

We always put in the config hash during a load. My run was saying the config hash key didn't exist on load.

After searching it turns out this is happening because external resources have changed and we clear out the entire cache and don't put the config hash back in to make it a valid cache file:

When we clear the cache file, we have to put the config hash back in, otherwise it won't be a valid cache file.

@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Oct 3, 2016

Contributor

@rnveach
We fill the cache here

fillCacheWithExternalResources(resources);
but... yes, you are right, we do not put config file in cache.

Contributor

MEZk commented Oct 3, 2016

@rnveach
We fill the cache here

fillCacheWithExternalResources(resources);
but... yes, you are right, we do not put config file in cache.

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Oct 15, 2016

Member

Fix is merged

Member

romani commented Oct 15, 2016

Fix is merged

@romani romani closed this Oct 15, 2016

@romani romani added the bug label Oct 15, 2016

@romani romani added this to the 7.2 milestone Oct 15, 2016

agcuda added a commit to agcuda/checkstyle that referenced this issue Oct 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment