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 WMS netcdf file locking issue #461

Merged
merged 11 commits into from
Feb 13, 2024

Conversation

tdrwenski
Copy link
Contributor

@tdrwenski tdrwenski commented Jan 31, 2024

Currently, when a dataset is opened through WMS, it stays locked in the netcdf file cache. This means the file will never be cleaned up in the cache, since the soft limit does not apply to locked files and the hard limit is set to -1 (no limit) by default.

This PR:

  • Use try with resources in wms to ensure netcdf file gets closed and does not stay locked.
  • Use guava cache instead of map for WMS cache
  • Update tests and add tests ro check if file is locked in the netcdf file cache after a wms request

This change is Reviewable

@tdrwenski tdrwenski marked this pull request as ready for review February 13, 2024 18:08
}

static int getCacheLoads() {
return cacheLoads;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we using the number of cache loads somewhere/need to track it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just in the TestWmsCache to test if it reloaded vs reused the cached dataset

@haileyajohnson haileyajohnson merged commit b29e2c4 into Unidata:main Feb 13, 2024
9 checks passed
@tdrwenski tdrwenski deleted the wms-lock-issue branch February 13, 2024 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants