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

(FM-8553) Remove all caching from list_all_transports #237

Merged
merged 1 commit into from
Oct 3, 2019

Conversation

DavidS
Copy link
Contributor

@DavidS DavidS commented Oct 3, 2019

It turned out that the environment object in the puppetserver does not survive for longer than a request, making the ObjectIdCacheAdapter creating a new cache everytime. Since the autoloader was using require to load schemas, this lead to the cache not being refresehd, and the API would return wrong (empty) results.

This change fixes this by not caching at all and using load instead of require, so that the schemas are always freshly loaded.

It turned out that the environment object in the puppetserver does not survive for longer than a request, making the ObjectIdCacheAdapter creating a new cache everytime. Since the autoloader was using `require` to load schemas, this lead to the cache not being refresehd, and the API would return wrong (empty) results.

This change fixes this by not caching at all and using `load` instead of `require`, so that the schemas are always freshly loaded.
@DavidS DavidS added the bug label Oct 3, 2019
@DavidS DavidS requested a review from a team October 3, 2019 08:09
Copy link
Contributor

@carabasdaniel carabasdaniel left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@da-ar da-ar merged commit 0445fb0 into puppetlabs:master Oct 3, 2019
@DavidS DavidS deleted the fm-8553-remove-schema-caching branch October 3, 2019 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants