| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
Fixes #1191
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
| |
Users can now specify --redis-url when running the test suite to choose a specific server.
|
| |
|
|
|
|
|
|
|
| |
AuthenticationError is now a subclass of ConnectionError, which means
the connection will be shut down and cleaned up.
Fixes #923
|
| |
|
|
|
|
|
| |
Pass encoding_errors setting to hiredis (>=1.0.0).
Fixes #1161
|
| |
|
|
|
|
|
|
|
| |
this change allows users to call client.execute_command('info') or
client.execute_command('INFO') and get the same parsed result.
Fixes #1168
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
|\ |
|
| |\
| | |
| | | |
Fix for https://github.com/andymccurdy/redis-py/issues/1135
|
| | |
| | |
| | | |
Fix for https://github.com/andymccurdy/redis-py/issues/1135
|
|\ \ \
| |/ /
|/| | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \
| | | |
| | | | |
Connection Reading Socket Error Enhancement
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
added "host":"port"
to Exception message for easy debug
Change-Id: Ifaa3bef0c8daf3dd2c60b143746b75a26c182a88
|
|\ \ \
| | | |
| | | | |
miss positional argument in README example
|
|/ / /
| | |
| | | |
raise TypeError.
|
| | | |
|
|\ \ \
| |_|/
|/| | |
Unregister socket from ready_poller
|
| | | |
|
|/ /
| |
| |
| |
| | |
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.
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| | |
Do not leave connections in invalid state
|
| | |
|
|\ \
| | |
| | | |
Use IPPROTO_TCP constant instead of SOL_TCP constant
|
| |/ |
|
|\ \
| | |
| | | |
Fix github pull template typo
|
| |/ |
|