summaryrefslogtreecommitdiff
path: root/redis/connection.py
Commit message (Collapse)AuthorAgeFilesLines
* same for hiredisChayim I. Kirshen2022-11-291-3/+3
|
* Signifying that parsers should be privateChayim I. Kirshen2022-11-291-3/+3
|
* Reorganizing the code, in preparation for RESP3Chayim I. Kirshen2022-11-291-431/+16
|
* Failover handling improvements for RedisCluster and Async RedisCluster (#2377)Bar Shaul2022-11-101-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* CredentialsProvider class added to support password rotation (#2261)Bar Shaul2022-11-101-9/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * A CredentialsProvider class has been added to allow the user to add his own provider for password rotation * Moved CredentialsProvider to a separate file, added type hints * Changed username and password to properties * Added: StaticCredentialProvider, examples, tests Changed: CredentialsProvider to CredentialProvider Fixed: calling AUTH only with password * Changed private members' prefix to __ * fixed linters * fixed auth test * fixed credential test * Raise an error if username or password are passed along with credential_provider * fixing linters * fixing test * Changed dundered to single per side underscore * Changed Connection class members username and password to properties to enable backward compatibility with changing the members value on existing connection. * Reverting last commit and adding backward compatibility to 'username' and 'password' inside on_connect function * Refactored CredentialProvider class * Fixing tuple type to Tuple * Fixing optional string members in UsernamePasswordCredentialProvider * Fixed credential test * Added credential provider support to AsyncRedis * linters * linters * linters * linters - black Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> Co-authored-by: dvora-h <dvora.heller@redis.com>
* fix docs for password protected socket access (#2378)Robert Hofer2022-11-071-1/+1
| | | Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Catch `Exception` and not `BaseException` in the `Connection` (#2104)Kristján Valur Jónsson2022-09-291-2/+2
| | | | | | | * Add failing unittests for passing BaseException through * Resolve failing unittest * Remove redundant checks for asyncio.CancelledError
* Support Hiredis >= 1.x only (remove `packaging` dependency) (#2385)Aarni Koskela2022-09-281-44/+10
| | | | | | | * Only set HIREDIS_AVAILABLE if Hiredis is not 0.x * Remove compatibility code for old Hiredis versions * Move packaging dependency to dev only
* Handle auth errors for newer versions of Redis. (#2325) (#2329)Luca Cillario2022-08-301-1/+11
|
* Be more strict about url scheme parsing (#2343)Klaas van Schelven2022-08-211-6/+11
| | | | | | | | | | The error message implied that urls had to start with `scheme://`. However, if the double slash was left out, the url parsed just fine and the part that was ostensibly intended to be the hostname ended up as part of the path, whereas the default (localhost) would be used for the hostname. This commit makes the check as strict as the error message implies by including a check for the double slash. Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Fix retries in async mode (#2180)Eric Lemoine2022-06-191-2/+6
| | | | | | | | | * Avoid mutating a global retry_on_error list * Make retries config consistent in sync and async * Fix async retries * Add new TestConnectionConstructorWithRetry tests
* update black to 22.3.0 (#2171)Utkarsh Gupta2022-05-301-14/+5
|
* Replace OSError exceptions from `can_read` with `redis.ConnectionError` (#2140)Kristján Valur Jónsson2022-05-081-1/+7
| | | | | | | * Replace OSError exceptions from `can_read` with `redis.ConnectionError` * Fix formatting * Revert unintended formatting change
* Rename 'update_supported_erros' to 'update_supported_errors' in Retry module ↵Jean Lopin2022-05-021-2/+2
| | | | (#2144)
* Add support to use certificates from string in ssl connection (#2048)dvora-h2022-03-141-2/+11
| | | | | | | | | * ssl string cert * fix async test * linters * change test name
* Catch OSError in BlockingConnectionPool.get_connection (#2001)Éric Lemoine2022-02-221-1/+1
| | | Co-authored-by: Chayim I. Kirshen <c@kirshen.com>
* Add support for Redis 7 functions (#1998)dvora-h2022-02-221-2/+9
| | | | | | | | | | | | | | | | | | | * add function support * linters * test fcall * decode reponses for unstable_r * linters * fix evalsho_ro test * fix eval_ro test * add response callbaks * linters
* Fixing AttributeError on some connection errors (#1905)Chayim2022-01-261-4/+7
|
* Fixing AttributeError in UnixDomainSocketConnection (#1903)dvora-h2022-01-261-5/+12
|
* Added retry mechanism on socket timeouts when connecting to the server (#1895)Bar Shaul2022-01-251-2/+4
|
* OCSP Stapling Support (#1873)Chayim2022-01-171-1/+47
|
* get_connection: catch OSError too (#1832)Iñaki Ucar2022-01-101-1/+1
|
* Documentation cleanup (#1841)Chayim2021-12-301-2/+3
|
* OCSP stapling support (#1820)Chayim2021-12-261-2/+15
|
* Support for specifying error types with retry (#1817)Bar Shaul2021-12-231-4/+23
|
* Support for password-encrypted SSL private keys (#1782)Chayim2021-12-161-4/+31
| | | Adding support for SSL private keys with a password. This PR also adds support for future SSL tests.
* close socket after server disconnect (#1797)Paul Brown2021-12-161-2/+7
|
* Support SYNC and PSYNC (#1741)Avital Fine2021-12-151-1/+1
| | | Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Ensure redis_connect_func is set on uds connection (#1794)Ali-Akber Saifee2021-12-151-1/+3
|
* Allow overriding connection class via keyword arguments (#1752)Maksim Novikov2021-12-021-0/+4
|
* Added black and isort (#1734)Anas2021-11-301-185/+244
|
* Pyupgrade + flynt + f-strings (#1759)Aarni Koskela2021-11-301-34/+31
| | | @akx Thank you so much for this! Thanks again for introducing me to a new tool that I'm sliding into my workflow as well.
* Fixing deprecating distutils (PEP 632) (#1730)Chayim2021-11-251-5/+5
|
* Adding support for non-decodable commands (#1731)Chayim2021-11-251-6/+9
|
* Adding RedisCluster client to support Redis Cluster Mode (#1660)Bar Shaul2021-11-251-6/+23
| | | | Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: Anas <anas.el.amraoui@live.com>
* Better removal of hiredis warning (#1726)Alex Wu2021-11-211-4/+0
| | | Co-authored-by: Alex Wu <alex@anyscale.com>
* removing hiredis warning (#1721)Chayim2021-11-171-5/+0
|
* Fix garbage collection deadlock (#1578)Eugene Morozov2021-11-081-3/+6
|
* Adding vulture for static analysis (#1655)Chayim2021-10-281-1/+0
| | | | | * Adding vulture for static analysis Removing dead code found previously by vulture in local runs.
* Add warning when hiredis not installed. Recommend installation. (#1621)adiamzn2021-10-191-0/+3
|
* Removing packaging dependency (#1626)Chayim2021-10-191-5/+5
|
* Fix `retry` attribute in UnixDomainSocketConnection (#1604)nbraun-amazon2021-10-141-1/+15
|
* Use Version instead of StrictVersion since distutils is deprecated. (#1552)Karthikeyan Singaravelan2021-08-291-5/+5
|
* Add retry mechanism with backoff (#1494)nbraun-amazon2021-08-181-19/+36
|
* All values within Redis URLs are url-unquoted via default.Andy McCurdy2020-08-151-105/+80
| | | | | | | | Prior versions of redis-py supported this by specifying the ``decode_components`` flag to the ``from_url`` functions. This is now done by default and cannot be disabled. Fixes #589
* Remove support for end-of-life Python 2.7 (#1318)Jon Dufresne2020-08-061-82/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove support for end-of-life Python 2.7 Python 2.7 is end of life. It is no longer receiving bug fixes, including for security issues. Python 2.7 went EOL on 2020-01-01. For additional details on support Python versions, see: Supported: https://devguide.python.org/#status-of-python-branches EOL: https://devguide.python.org/devcycle/#end-of-life-branches Removing support for EOL Pythons will reduce testing and maintenance resources while allowing the library to move towards a modern Python 3 style. Python 2.7 users can continue to use the previous version of redis-py. Was able to simplify the code: - Removed redis._compat module - Removed __future__ imports - Removed object from class definition (all classes are new style) - Removed long (Python 3 unified numeric types) - Removed deprecated __nonzero__ method - Use simpler Python 3 super() syntax - Use unified OSError exception - Use yield from syntax Co-authored-by: Andy McCurdy <andy@andymccurdy.com>
* Fix some documentation formattingJon Banafato2020-07-261-19/+20
| | | | | Fix a few broken links and class references, move a docstring, and fix a code block.
* Support for loading, unloading and listing Redis Modules (#1360)Roey Prat2020-07-131-0/+13
| | | | | | | | | | | * Support for loading, unloading and listing Redis Modules * minor fixes for flake * unit test for module list - only the empty use case * ModuleError should inherit from ResponseError rather than RedisError Co-authored-by: Vamsi Atluri <vamc19@gmail.com>
* SentinelConnectionPool plays better with threaded applications.Andy McCurdy2020-06-011-9/+40
| | | | | | | | | Prevent the pool from closing sockets on connections that are actively in use by other threads when the master address changes. Connections returned to the pool that are still connected to the old master will be disconnected gracefully. Fixes #1345
* Restore try/except in __del__ methodsAndy McCurdy2020-05-201-3/+12
| | | | Fixed #1339