-
Notifications
You must be signed in to change notification settings - Fork 28
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 WMS guava cache concurrency issues #467
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…files" This reverts commit 3188915.
haileyajohnson
approved these changes
Feb 28, 2024
WeatherGod
pushed a commit
to WeatherGod/tds
that referenced
this pull request
Apr 18, 2024
* Add test for WMS requests in parallel * Do not mutate (by reopening/closing) files in the wms cache * Update wms cache tests * Use guava cache loader instead of put * Add test for bad wms request * Rethrow execution exceptions io or edal exceptions * Clear wms cache before netcdf file cache * Update test before/after steps to avoid problems with locked files * Revert "Update test before/after steps to avoid problems with locked files" This reverts commit 3188915. * Ignore WMS test that updates a file * Update WMS cache tests to alter last modified rather than replace file to test cache * Add extra asserts to test after step * Disable Raf cache to avoid file locks for wms tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The changes from #461 introduced concurrency issues in the WMS cache. This happened because cache entries were mutated after access since the
NetcdfFile
that is part of theThreddsWmsCatalogue
was reacquired and then closed after use.This PR:
NetcdfFile
s needed by the WMS cache entries to remain locked so they don't have to be closed/reopened. This should not cause memory issues as the cache is limited to 100 entries.RemovalListener
which closes theNetcdfFile
when guava removes catalogue from the cacheget(Key, Callable<v>)
pattern to retrieve or create a value in the cacheget(Key, Callable<v>)
will throw anExecutionException
orUncheckedExecutionException
, so we also need to catch and rethrow these since theWmsServlet
only expectsIOException
s orEdalException
s (and everything else becomes a 500 error).