-
Notifications
You must be signed in to change notification settings - Fork 27
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
⚗️ env-vars to control cachetools #6169
Conversation
Quality Gate passedIssues Measures |
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.
👍
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6169 +/- ##
=========================================
- Coverage 84.5% 81.8% -2.8%
=========================================
Files 10 577 +567
Lines 214 29418 +29204
Branches 25 234 +209
=========================================
+ Hits 181 24064 +23883
- Misses 23 5294 +5271
- Partials 10 60 +50
Flags with carried forward coverage won't be shown. Click here to find out more.
|
What do these changes do?
Occasionally, listing services respond with a 500 error.
The logs indicate that this issue is due to a validation error caused by an invalid key in the caching mechanism, which uses the sync library cachetools. The bug appears to stem from concurrent access to a synchronous cache registry. It's important to note that the new design requests each page concurrently, and validation is also performed asynchronously.
The likely solution is to switch to
aiocache
even for this synchronous case, but that would require some design changes. Before moving forward with that approach, I'd like to introduce these new variables to control thecachetools
options and conduct some manual exploratory testing:CACHETOOLS_CACHE_MAXSIZE
: Maximum number of items (defaults to 100)CACHETOOLS_CACHE_TTL_SECS
: Time-to-live in seconds (defaults to 60 seconds)CACHETOOLS_DISABLE
: If set to1
, caching is disabled (defaults to0
)Related issue/s
How to test
Dev-ops checklist
These variables are only for development pursposes and therefore should not be part of the repo.configs