-
Notifications
You must be signed in to change notification settings - Fork 131
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
Cache registry module errors #1258
Conversation
Errors don't have a version, so we update the compound index to allow missing indices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, aside from the minor comments about naming. 👍🏻
@@ -14,6 +14,7 @@ import ( | |||
type RegistryModuleData struct { | |||
Source tfaddr.Module | |||
Version *version.Version | |||
Error bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we only cache 404 errors, is it worth calling this e.g. NotFound
or something similar instead of just Error
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we now cache most 4XX errors, I'll keep it as is?
@@ -67,3 +75,31 @@ func (s *RegistryModuleStore) Cache(sourceAddr tfaddr.Module, modVer *version.Ve | |||
txn.Commit() | |||
return nil | |||
} | |||
|
|||
func (s *RegistryModuleStore) CacheError(sourceAddr tfaddr.Module) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar question to above - should we call this e.g. CacheNotFound()
?
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
This PR introduces caching for registry module HTTP request errors. We're currently only caching 404 errors, but it might also be sensible to cache other errors.
The change dramatically improves the performance when many jobs run in the background after a more significant text change.
UX
Before
After