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

Unlock enhanced datasets #1303

Merged

Conversation

tdrwenski
Copy link
Member

@tdrwenski tdrwenski commented Feb 7, 2024

Description of Changes

This change ensures that "wrapped" datasets created from NetcdfDataset.enhance or from netcdfDataset.toBuilder can close the original NetcdfDataset if it was acquired from the cache. A new wrapped NetcdfDataset cannot directly close the original in the cache when close is called, but it can delegate this to the origFile. So the origFile needs to point to whatever the wrapped object is. This makes the behavior between enhanced NetcdfDatasets and NetcdfFiles the same.

Add tests for this. Note before the fix tests two and four (shouldReleaseLockOnNetcdfDatasetUsingBuilder and shouldReleaseLockOnAggregation) failed.

Jenkins tests are passing on this branch: https://jenkins-aws.unidata.ucar.edu/view/Users/job/tara-netcdf-java/47/

@tdrwenski tdrwenski marked this pull request as ready for review February 7, 2024 21:20
@haileyajohnson haileyajohnson merged commit b13d8b5 into Unidata:maint-5.x Feb 7, 2024
10 checks passed
@tdrwenski tdrwenski deleted the fix-aggregation-lock-issue branch February 7, 2024 21:56
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.

None yet

2 participants