Commit 2e46613
Client side caching refactoring (#3350)
* Restructure client side caching code
Right now the client side caching code is implemented mostly on the
level of Connections, which is too low. We need to have a shared cache
across several connections.
Move the cache implementation higher, while trying to encapsulate it
better, into a `CacheMixin` class.
This is work in progress, many details still need to be taken care of!
* Temporary refactor
* Finished CacheProxyConnection implementation, added comments
* Added test cases and scheduler dependency
* Added support for RedisCluster and multi-threaded test cases
* Added support for BlockingConnectionPool
* Fixed docker-compose command
* Revert port changes
* Initial take on Sentinel support
* Remove keys option after usage
* Added condition to remove keys entry on async
* Added same keys entry removal in pipeline
* Added caching support for Sentinel
* Added locking when accesing cache object
* Rmoved keys option from options
* Removed redundant entities
* Added cache support for SSLConnection
* Moved ssl argument handling to cover cluster case
* Revert local test changes
* Fixed bug with missing async operator
* Revert accidental changes
* Added API to return cache object
* Added eviction policy configuration
* Added mark to skip test on cluster
* Removed test case that makes no sense
* Skip tests in RESP2
* Added scheduler to dev_requirements
* Codestyle changes
* Fixed characters per line restriction
* Fixed line length
* Removed blank lines in imports
* Fixed imports codestyle
* Added CacheInterface abstraction
* Removed redundant references
* Moved hardcoded values to constants, restricted dependency versions
* Changed defaults to correct values
* Added custom background scheduler, added unit testing
* Codestyle changes
* Updated RESP2 restriction
* Cahnged typing to more generic
* Restrict pytest-asyncio version to 0.23
* Added upper version limit
* Removed usntable multithreaded tests
* Removed more flacky multithreaded tests
* Fixed issue with Sentinel killing healthcheck thread before execution
* Removed cachetools dependency, added custom cache implementation
* Updated test cases
* Updated typings
* Updated types
* Revert changes
* Removed use_cache, make health_check configurable, removed retry logic around can_read()
* Revert test skip
* Added documentation and codestyle fixes
* Updated excluded wordlist
* Added health_check thread cancelling in BlockingPool
* Revert argument rename, extended documentation
* Updated NodesManager to create shared cache between all nodes
* Codestyle fixes
* Updated docs
* Added version restrictions
* Added missing property getter
* Updated Redis server version
* Skip on long exception message
* Removed keys entry as it's csc specific
* Updated exception message for CSC
* Updated condition by adding server name check
* Added test coverage for decoded responses
* Codestyle changes
* Removed background healthcheck, use connection reference approach instead
* Removed unused imports
* Fixed broken tests
* Codestyle changes
* Fixed additional broken tests
* Codestyle changes
* Increased timer to avoid flackiness
* Restrict tests cause of PyPy
* Codestyle changes
* Updated docs, convert getters function to properties, added dataclasses
---------
Co-authored-by: Gabriel Erzse <gabriel.erzse@redis.com>1 parent 7d73d74 commit 2e46613
File tree
30 files changed
+2344
-1766
lines changed- .github
- workflows
- docs
- examples
- redis
- _parsers
- asyncio
- commands
- tests
- test_asyncio
30 files changed
+2344
-1766
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | 72 | | |
74 | | - | |
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
0 commit comments