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

Remove the global caches for project files #12370

Merged
merged 1 commit into from Mar 8, 2023
Merged

Conversation

Frassle
Copy link
Member

@Frassle Frassle commented Mar 7, 2023

Description

Fixes #12152

This caching was originally added in #6576 two years ago. It saved a lot of file access because the system was repeatedly calling into the workspace module to load and re-load project files. We've cleaned up the system code to instead load the project files once, and pass the loaded workspace.Project object down the callchain to other sites that need it, rather than each site searching and loading the project. As such removing these caches shouldn't regress performance.

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have run make changelog and committed the changelog/pending/<file> documenting my change
  • Yes, there are changes in this PR that warrants bumping the Pulumi Service API version

@pulumi-bot
Copy link
Contributor

Changelog

[uncommitted] (2023-03-07)

Bug Fixes

  • [auto/go] The various workspace load routines (e.g. LoadProject) are no longer singularly cached.
    #12370

@squaremo
Copy link
Contributor

squaremo commented Mar 7, 2023

Simple is smooth, smooth is fast :-)


reloaded, err := s.workspace.StackSettings(ctx, stackName)
assert.NoError(t, err)
assert.Equal(t, stackConfig, reloaded)
Copy link
Member Author

Choose a reason for hiding this comment

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

Amusingly because of the old caching logic this just asserted that X=X

Copy link
Contributor

@abhinav abhinav left a comment

Choose a reason for hiding this comment

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

🎉

Comment on lines -29 to -31
var projectSingleton = &projectLoader{
internal: map[string]*Project{},
}
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Red code has no bugs

@abhinav
Copy link
Contributor

abhinav commented Mar 8, 2023

Merging per @Frassle's request.

@abhinav
Copy link
Contributor

abhinav commented Mar 8, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented Mar 8, 2023

Build succeeded:

@bors bors bot merged commit da2fb40 into master Mar 8, 2023
@bors bors bot deleted the fraser/removeFileCaches branch March 8, 2023 00:51
squaremo added a commit to pulumi/pulumi-kubernetes-operator that referenced this pull request Mar 9, 2023
Other than being the most recent, this picks up the change made in

    pulumi/pulumi#12370

which removes caching of project and stack files, which fixes #411.

Signed-off-by: Michael Bridgen <mbridgen@pulumi.com>
squaremo added a commit to pulumi/pulumi-kubernetes-operator that referenced this pull request Mar 9, 2023
Other than being the most recent, this picks up the change made in

    pulumi/pulumi#12370

which removes caching of project and stack files, which fixes #411.

Signed-off-by: Michael Bridgen <mbridgen@pulumi.com>
squaremo added a commit to pulumi/pulumi-kubernetes-operator that referenced this pull request Mar 9, 2023
* Update Pulumi SDK and base image to v3.57.1

Other than being the most recent, this picks up the change made in

    pulumi/pulumi#12370

which removes caching of project and stack files, which fixes #411.

* Add entry for #422 to changelog
---------

Signed-off-by: Michael Bridgen <mbridgen@pulumi.com>
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.

Repeatedly running a stack with the automation API ignores project/stack config file changes
4 participants