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

Don't mutate cached data in DatasetInfoPlugin #153

Merged
merged 1 commit into from
Feb 8, 2023

Conversation

kwilcox
Copy link
Member

@kwilcox kwilcox commented Feb 7, 2023

Multiple requests to the /info endpoint are failing. The DatasetInfoPlugin is changing the cached metadata by removing the _ARRAY_DIMENSIONS attribute key which is required on subsequent calls. I did not dive into the caching internals to figure out why the value is mutable at all. If it is a simple dict on the backend, the returned cache values could be being changed inside the cache dict itself.

Added a test that fails without the change!

Multiple requests to the /info endpoint are failing.
The DatasetInfoPlugin is changing the cached
metadata by removing the `_ARRAY_DIMENSIONS`
attribute key which is required on subsequent calls. I did
not dive into the caching internals to figure out why the
the value is mutable at all. If it is a simple dict on the
backend, the returned cache values could be being
changed inside the cache dict itself.

Added a test that fails without the change!
Copy link
Member

@abkfenris abkfenris left a comment

Choose a reason for hiding this comment

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

Nice catch, thanks Kyle!

@abkfenris abkfenris merged commit 1872bdc into xpublish-community:main Feb 8, 2023
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