summaryrefslogtreecommitdiff
path: root/tests/test_asyncio/test_cluster.py
Commit message (Collapse)AuthorAgeFilesLines
* Combine auto-concatenated strings (#2482)David Gilman2022-12-141-3/+3
|
* Added a replacement for the default cluster node in the event of failure. ↵Bar Shaul2022-12-011-0/+40
| | | | (#2463)
* Failover handling improvements for RedisCluster and Async RedisCluster (#2377)Bar Shaul2022-11-101-1/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Cluster&AsyncCluster: Removed handling of timeouts/connection errors within the cluster loop, fixed "cannot pickle '_thread.lock' object" bug, added client's side failover handling improvements * Fixed linters * Type fixes * Added to CHANGES * Added getter and setter for the client's retry object and added more tests * Fixed linters * Fixed test * Fixed test_client_kill test * Changed get_default_backoff to default_backoff, removed retry_on_error and connection_error_retry_attempts from RedisCluster, default retry changed to no retries * Fixing linters * Reverting deletion of connection_error_retry_attempts to maintain backward compatibility * Updating retry object for existing and new connections * Changed the default value of reinitialize_steps from 10 to 5 * fix review comments Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: dvora-h <dvora.heller@redis.com> Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Fix KeyError in async cluster - initialize before execute multi key commands ↵dvora-h2022-10-301-0/+9
| | | | | | | | | (#2439) * Fix KeyError in async cluster * link to issue * typo
* Dev/no can read (#2360)Kristján Valur Jónsson2022-09-291-4/+4
| | | | | | | | * make can_read() destructive for simplicity, and rename the method. Remove timeout argument, always timeout immediately. * don't use can_read in pubsub * connection.connect() now has its own retry, don't need it inside a retry loop
* Dev/no lock (#2308)Kristján Valur Jónsson2022-09-281-26/+22
| | | | | * Remove async lock in asyncio.Connection.read_response * Skip concurrent-commands test on non-pooled connections
* Drop python 3.6 support (#2306)dvora-h2022-07-271-11/+3
|
* async_cluster: fix max_connections/ssl & improve args (#2217)Utkarsh Gupta2022-07-271-32/+178
| | | | | | | | | | | | | | | | | | | | | | * async_cluster: fix max_connections/ssl & improve args - set proper connection_class if ssl = True - pass max_connections/connection_class to ClusterNode - recreate startup_nodes to properly initialize - pass parser_class to Connection instead of changing it in on_connect - only pass redis_connect_func if read_from_replicas = True - add connection_error_retry_attempts parameter - skip is_connected check in acquire_connection as it is already checked in send_packed_command BREAKING: - RedisCluster args except host & port are kw-only now - RedisCluster will no longer accept unknown arguments - RedisCluster will no longer accept url as an argument. Use RedisCluster.from_url - RedisCluster.require_full_coverage defaults to True - ClusterNode args except host, port, & server_type are kw-only now * async_cluster: remove kw-only requirement from client Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Fix warnings and resource usage problems in asyncio unittests (#2258)Kristján Valur Jónsson2022-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use pytest-asyncio in auto mode Remove overly genereric `pytestmark=pytest.mark.asyncio` causing lots of warning noise * Use "Factories as Fixtures" test pattern for the `create_redis` fixture this fixture is now async, avoiding teardown problems with missing event loops. * Fix sporadic error on fast event loops, such as `--uvloop` * Close connection, even if "username" was in kwargs This fixes a resource usage warning in the async unittests. * Do async cleanup of acl passwords via a fixture * Remove unused import, fix whitespace * Fix test with missing "await" * Close pubsub objects after use in unittest Use a simple fixture where possible, otherwise manually call pubsub.close() * re-introduce `pytestmark=pytest.mark.asyncio` for python 3.6 * Use context manager to clean up connections in connection pool for unit tests * Provide asynccontextmanager for python 3.6 * make `test_late_subscribe()` more robuste * Catch a couple of additional leaked resources
* async_cluster: fix concurrent pipeline (#2280)Utkarsh Gupta2022-07-241-0/+8
| | | - each pipeline should create separate stacks for each node
* Reuse the old nodes' connections when a cluster topology refresh is being ↵Bar Shaul2022-06-231-3/+7
| | | | | | | | | | | | | done (#2235) * A fix was made to reuse the old nodes' connections when a cluster topology refresh is being done * Fixed RedisCluster to immediately raise AuthenticationError * Updated CHANGES * Fixed cluster async bgsave test to ignore "bgsave already in progress" error * Fixed linters
* async_cluster: fix simultaneous initialize (#2231)Utkarsh Gupta2022-06-191-3/+5
| | | - close startup_nodes too during client.close(), in case they are different
* async_cluster: add pipeline support (#2199)Utkarsh Gupta2022-05-301-1/+253
| | | Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* async_cluster: add/update typing (#2195)Utkarsh Gupta2022-05-301-26/+9
| | | | | | | * async_cluster: add/update typing * async_cluster: update cleanup_kwargs with kwargs from async Connection * async_cluster: properly remove old nodes
* set default response_callbacks to redis.asyncio.cluster.ClusterNode (#2201)rapidia2022-05-301-0/+5
| | | | | | | | | * set default response_callbacks to redis.asyncio.cluster.ClusterNode * add test case for ClusterNode class * fix lint error * merge test case into `test_startup_nodes`
* Add Async RedisCluster (#2099)Utkarsh Gupta2022-05-081-0/+2232
* Copy Cluster Client, Commands, Commands Parser, Tests for asyncio * Async Cluster Tests: Async/Await * Add Async RedisCluster * cluster: use ERRORS_ALLOW_RETRY from self.__class__ * async_cluster: rework redis_connection, initialize, & close - move redis_connection from NodesManager to ClusterNode & handle all related logic in ClusterNode class - use Locks while initializing or closing - in case of error, close connections instead of instantly reinitializing - create ResourceWarning instead of manually deleting client object - use asyncio.gather to run commands/initialize/close in parallel - inline single use functions - fix test_acl_log for py3.6 * async_cluster: add types * async_cluster: add docs * docs: update sphinx & add sphinx_autodoc_typehints * async_cluster: move TargetNodesT to cluster module * async_cluster/commands: inherit commands from sync class if possible * async_cluster: add benchmark script with aredis & aioredis-cluster * async_cluster: remove logging * async_cluster: inline functions * async_cluster: manage Connection instead of Redis Client * async_cluster/commands: optimize parser * async_cluster: use ensure_future & generators for gather * async_conn: optimize * async_cluster: optimize determine_slot * async_cluster: optimize determine_nodes * async_cluster/parser: optimize _get_moveable_keys * async_cluster: inlined check_slots_coverage * async_cluster: update docstrings * async_cluster: add concurrent test & use read_response/_update_moved_slots without lock Co-authored-by: Chayim <chayim@users.noreply.github.com>