-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fall back to expired cached results when datasources error #19414
Comments
Can be implemented in the decorator level, but shouldn't be a default behavior since we're also using decorators for caching intermediate results. |
This should apply to any form of package cache, i.e. also including file-based. We need to work out terminology for the concepts of:
Redis uses the term TTL for the latter, so maybe we could use Redis will take care of expunging records itself, but file cache does not. So file cache should delete the record and return empty result if the ttl has been reached. |
A related performance improvement: some datasources could be made more efficient if they were allowed to return metadata about the result, which is then passed back to it after soft expiry. For example with npm, it could be as simple as returning the etag and/or last-modified headers. Then, these could be used for the requery to (hopefully) get back a 304 response instead of needing the full one.
|
In theory each datasource could cache the metadata separately/independently however it's better to combine it so that:
Also, there may be some paginated datasources where having the existing results can mean reduced data fetching even when something has changed (e.g. filtering by last updated more recently than the last fetch) |
I've implemented this for npm, and would now like to add this partially for the cache decorator. To close this issue:
There might be some cases where we should also replace a result of |
Idea for decorator:
|
So if there's an etag, never consider the cache "hot" and return data without checking? |
no, updated idea. @zharinov @JamieMagee Any idea how to pass the |
You'd have to refactor out the |
Let's set aside the performance improvement related to etag and just get the error fallback working with the decorator if possible |
🎉 This issue has been resolved in version 35.19.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What would you like Renovate to be able to do?
Reuse cached results instead of aborting runs when external datasource hosts fail
If you have any ideas on how this should be implemented, please tell us here.
If this needs to be implemented manager-by-manager then focusing on Docker Hub and npmjs would be best.
Is this a feature you are interested in implementing yourself?
Maybe
The text was updated successfully, but these errors were encountered: