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
make SimpleMemoryBackend store state in instance instead of class #562
make SimpleMemoryBackend store state in instance instead of class #562
Conversation
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.
Looks good, sorry for the delay.
Could you update to latest master?
d20f4f7
to
f5d2e4a
Compare
Resolved conflicts |
Should probably have a regression test too, but I'll merge this in for now, as it's pretty straightforward. |
Ah, seems you missed updating some tests. 28 failing tests currently. |
I'll fix those and test locally a bit later |
These weren't tests, there was one more line using class var added after this PR, now fixed |
Ah, I clearly didn't look closely enough. |
I followed CONTRIBUTING.rst and ran |
I've not looked at those instructions, so they could be outdated. Ultimately, whatever the CI does, is the correct way to run it: https://github.com/aio-libs/aiocache/blob/master/.github/workflows/ci.yml#L103-L106 |
It's just 1 test class failing now, so should be able to run it with |
Looks like it just needs this setup line needs to be updated: |
|
Codecov Report
@@ Coverage Diff @@
## master #562 +/- ##
==========================================
+ Coverage 99.60% 99.66% +0.05%
==========================================
Files 36 36
Lines 3560 3557 -3
Branches 447 0 -447
==========================================
- Hits 3546 3545 -1
Misses 12 12
+ Partials 2 0 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
What do these changes do?
Make SimpleMemoryBackend store state in instance instead of class.
While current behaviour matches other caches (same connection args == same cache; zero connection args in memory case), current design seems bad since it does not allow extending and customizing memory cache in future.
Tests adjusted accordingly.
Are there changes in behavior for the user?
Yes, if user for some reason expected different SimpleMemoryBackend objects to have shared storage. This is probably a breaking change for some weird setups.
Related issue number
Resolves: #531
Resolves: #479
There is a PR aimed to fix it: #523
But using namespace seem to not be sufficient. Instance local cache must be used for consistent behaviour.
Checklist
CHANGES
folder<issue_id>.<type>
(e.g.588.bugfix
)issue_id
change it to the pr id after creating the PR.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.Fix issue with non-ascii contents in doctest text files.