summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* yes, we still support python 2.7ping-health-checksAndy McCurdy2019-07-261-2/+2
|
* PING/PONG health checksAndy McCurdy2019-07-265-28/+275
| | | | | | | | | | | | | | | | | | | | | | The `Redis` class and the `ConnectionPool` class now support the "health_check_interval=N" option. By default N=0, which turns off health checks. `N` should be an integer, and when greater than 0, ensures that a health check is performed just before command execution anytime the underlying connection has been idle for more than N seconds. A health check is a full PING/PONG round trip to the Redis server. If a health check encounters a ConnectionError or TimeoutError, the connection is disconnected and reconnected and the health check is retried exactly once. Any error during the retry is raised to the caller. Health check retries are not governed by any other options such as `retry_on_timeout`. In systems where idle times are common, these health checks are the intended way to reconnect to the Redis server without harming any user data. When this option is enabled for PubSub connections, calling `get_message()` or `listen()` will send a health check anytime a message has not been read on the PubSub connection for `health_check_interval` seconds. Users should call `get_message()` or `listen()` at least every `health_check_interval` seconds in order to keep the connection open.
* Ability to create a client that uses a single connectionAndy McCurdy2019-07-235-56/+110
| | | | | | | | | | | | | This has multiple uses: * Single connection clients will not be considered threadsafe. This means certain settings could temporarily be adjusted. For example, a context manager could temporarily modify the encoding behavior for a set of commands. * We can introduce more thorough health checks that only happen when a connection is handed out from the connection pool. * Workloads that issue many commands to Redis should be slightly faster. Prior to this change, the client must retrieve a connection from the pool for each command.
* Fix typo in README and CHANGELOG (#1133)Jani Korhonen2019-07-182-2/+2
|
* Updates README.rst with svg badge (#1182)Nikita Sobolev2019-07-171-1/+1
|
* Handle removed claimed messages without an exceptionThomas Daskalakis2019-07-173-1/+34
| | | | Fixes #1191
* Use nonblocking sockets instead of selectors for healthy connectionsAndy McCurdy2019-07-098-373/+128
| | | | | | | This replaces the work in 3.2.0 to use nonblocking sockets instead of selectors. Selectors proved to be problematic for some environments including eventlet and gevent. Nonblocking sockets should be available in all environments.
* Add READONLY and READWRITE commandsTheo Despoudis2019-07-093-2/+24
|
* Code coverage in travis, and codecov.io badge. (#1180)Roey Prat2019-06-252-1/+6
|
* Add redis_url cmdline argument for tests (#1170)Grygorii Iermolenko2019-06-061-31/+46
| | | Users can now specify --redis-url when running the test suite to choose a specific server.
* changelogAndy McCurdy2019-06-031-0/+4
|
* All authentication-related errors now raise AuthenticationErrorAndy McCurdy2019-06-033-4/+21
| | | | | | | AuthenticationError is now a subclass of ConnectionError, which means the connection will be shut down and cleaned up. Fixes #923
* changelogAndy McCurdy2019-05-291-0/+3
|
* Pass encoding_errors setting to hiredis (>=1.0.0) (#1162)Brian Candler2019-05-292-0/+18
| | | | | Pass encoding_errors setting to hiredis (>=1.0.0). Fixes #1161
* changelogAndy McCurdy2019-05-281-0/+3
|
* case insensitive response callbacks.Andy McCurdy2019-05-282-1/+32
| | | | | | | this change allows users to call client.execute_command('info') or client.execute_command('INFO') and get the same parsed result. Fixes #1168
* changelogAndy McCurdy2019-05-281-0/+2
|
* remove Token class in favor of bytestringremove_tokenAndy McCurdy2019-05-283-126/+89
| | | | | | | The Token class was needed when supporting Python 2.6. Now that we've dropped support for 2.6, we don't need it anymore. Fixes #1066
* cleanup MONITOR docsAndy McCurdy2019-05-282-7/+9
|
* fix py2 compatmonitorAndy McCurdy2019-05-261-2/+3
|
* add tests for encoding issues and fix bugs foundAndy McCurdy2019-05-262-6/+13
|
* monitor command now has full command text. test suite improvedAndy McCurdy2019-05-262-8/+41
|
* Merge branch 'master' into monitorAndy McCurdy2019-05-261-2/+4
|\
| * Merge pull request #1152 from aachurin/masterAndy McCurdy2019-04-291-2/+4
| |\ | | | | | | Fix for https://github.com/andymccurdy/redis-py/issues/1135
| | * Update client.pyaachurin2019-03-161-2/+4
| | | | | | | | | Fix for https://github.com/andymccurdy/redis-py/issues/1135
* | | Merge branch 'pr/1033' into monitorAndy McCurdy2019-04-253-0/+71
|\ \ \ | |/ / |/| |
| * | Added support for the monitor command.Doug Kisabaka2019-02-253-0/+71
| | |
* | | changelogAndy McCurdy2019-04-191-0/+2
| | |
* | | Fix PubSubWorkerThread race conditionAndy McCurdy2019-04-181-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolves a race condition found in the PubSubWorkerThread. Prior to this change is was possible to receive the server's resonse to an unsubscribe message prior to the channel/pattern being added to the pending_unsubscribe set. This also improves PubSubWorkerThread.stop so that the run function is stopped immediately after the next iteration. fixes #1150
* | | Merge pull request #1159 from Vic020/fix_connection_reading_socket_errorAndy McCurdy2019-04-161-36/+31
|\ \ \ | | | | | | | | Connection Reading Socket Error Enhancement
| * | | Merged the error process of "reading socket error" in two Parser class and ↵vic0202019-04-111-36/+31
|/ / / | | | | | | | | | | | | | | | | | | | | | added "host":"port" to Exception message for easy debug Change-Id: Ifaa3bef0c8daf3dd2c60b143746b75a26c182a88
* | | Merge pull request #1156 from horizon365/masterAndy McCurdy2019-03-251-1/+1
|\ \ \ | | | | | | | | miss positional argument in README example
| * | | miss positional argument: 'message'horizon3652019-03-251-1/+1
|/ / / | | | | | | raise TypeError.
* | | make sure the selector is instantiated prior to cleaning it upAndy McCurdy2019-03-182-2/+6
| | |
* | | Merge pull request #1153 from bmerry/unregister-ready-pollerAndy McCurdy2019-03-182-1/+3
|\ \ \ | |_|/ |/| | Unregister socket from ready_poller
| * | Close the selector on disconnectBruce Merry2019-03-181-0/+2
| | |
| * | Unregister socket from ready_pollerBruce Merry2019-03-181-1/+1
|/ / | | | | | | | | It looks like there was a typo in PollSelector.close that made it unregister from the read_poller twice instead of once from each poller.
* | 3.2.13.2.1Andy McCurdy2019-03-152-1/+3
| |
* | remove unneccessary checkpid from SentinelConnectionPoolsentinel_pool_fixAndy McCurdy2019-03-141-12/+0
|/
* actual 3.2.03.2.0Andy McCurdy2019-02-171-1/+1
|
* 3.2.0Andy McCurdy2019-02-171-1/+14
|
* test all selectors via pytest parameterizationhealty_connectionsAndy McCurdy2019-02-113-68/+151
|
* python2 compatAndy McCurdy2019-02-041-1/+1
|
* attempt to provide only healthy connections from the poolAndy McCurdy2019-02-044-21/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adds redis.selector, a module that provides the best selector strategy available on the current platform. A redis.selector polls a socket to provide two pieces of functionality: 1. Check whether data can be read from the socket. Prior versions of redis-py provided this behavior with just select.select(). select() has lots of limitations, most notably a limit of ~1024 file descriptors. Now that better selectors are available, this should make can_read() faster and able to accomodate more clients. See #1115 and #486 2. Check whether a socket is ready for a command to be sent. This doubles as a health check. It ensures that the socket is available for writing, has no data to read and has no known errors. Anytime a socket is disconnected or hung up, data is available to be read, typically zero bytes. ConnectionPool.get_connection has been modified to ensure that connections it returns are connected and are ready for a command to be sent. If get_connection encounters a case where a socket isn't ready for a command the connection is reconnected and checked again. TODO: more tests for this stuff. implement EPoll and KQueue selectors. Fixes #1115 Fixes #486
* Merge pull request #1129 from Chronial/feature/fix-exceptAndy McCurdy2019-02-011-4/+4
|\ | | | | Do not leave connections in invalid state
| * Do not leave connections in invalid stateChronial2019-01-301-4/+4
| |
* | Merge pull request #1130 from Junnplus/socket-patchAndy McCurdy2019-02-011-1/+1
|\ \ | | | | | | Use IPPROTO_TCP constant instead of SOL_TCP constant
| * | use IPPROTO_TCP constant instead of SOL_TCP constantjunnplus2019-01-311-1/+1
| |/
* | Merge pull request #1131 from Junnplus/fix-typoAndy McCurdy2019-02-011-1/+1
|\ \ | | | | | | Fix github pull template typo
| * | fix typojunnplus2019-01-311-1/+1
| |/