| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |/ |
|
| |
| |
| |
| |
| |
| | |
Since Connection.disconnect() now verifies that the current process owns
the connection before shutting the socket down we can safely readd
the destructor just to make sure things are really cleaned up
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Sometimes a process with an active connection to Redis forks and creates
child processes taht also want to talk to Redis. Prior to this change there
were a number of potential conflicts that could cause this to fail.
Retrieving a connection from the pool and releasing a connection back
to the pool check the current proceeses PID. If it's different than the
PID that created the pool, reset() is called to get a fresh set of connections
for the current process. However in doing so, pool.disconnect() was caused
which closes the file descriptors that the parent may still be using. Further
when the available_connections and in_use_connections lists are reset, all of
those connections inherited from the parent are GC'd and the connection's
`__del__` was called, which also closed the socket and file descriptor.
This change prevents pool.disconnect() from being called when a pid is changed.
It also removes the `__del__` destructor from connections. Neither of these
are necessary or practical. Child processes still reset() their copy of the
pool when first accessed causing their own connections to be created.
`ConnectionPool.disconnect()` now checks the current process ID
so that a child or parent can't disconnect the other's connections.
Additionally, `Connection.disconnect()` now checks the current process ID
and only calls `socket.shutdown()` if `disconnect()` is called by the same
process that created the connection. This allows for a child process that
inherited a connection to call `Connection.disconnect()` and not shutdown
the parent's copy of the socket.
Fixes #863
Fixes #784
Fixes #732
Fixes #1085
Fixes #504
|
| |\ \
| | |/
| |/| |
|
| | |
| | |
| | |
| | |
| | | |
Hiredisparser and Connection — do not close socket on disconnect.
Resolves #1085
|
|/ / |
|
| |
| |
| |
| |
| | |
Fixes #969
Fixes #961
|
|\ \
| | |
| | | |
1022: Fix retry logic for StricRedis and PubSub
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Add support for SNI connection to Redis-py
|
| | | | |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Fix ConnectionPool repr when using default values
|
| | |/ /
| |/| | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
GEOHASH response may contain None elements
|
| | | | | |
|
|\ \ \ \ \
| |/ / / / |
|
| | |_|/
| |/| | |
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
messages
Signed-off-by: Xabier Eizmendi <xeizmendi@gmail.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Lock.acquire() can now be provided a token. If provided, this value will be
used as the value stored in Redis to hold the lock.
Lock.owned() returns a boolean indicating whether the lock is owned by the
current instance.
|
|\ \ \
| | | |
| | | | |
Add `.reacquire()` method to Lock
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`Lock` class provides a method called `.extend()` to manage a TTL of the
acquired lock. However, the method allows only to extend a timeout of
existing lock by N seconds, there's no way you can reset a TTL to the
timeout value you passed to this lock. There could be multiple use cases
for such behaviour. For instance, one may want to use a lock to
implement active/passive behaviour where only one process owns a lock
and resets its TTL all over again until it dies. This commit adds a new
method called `.reacquire()` to reset a TTL of the acquired lock back to
the passed timeout value.
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
Both Python 2.7 & Python 3 have the types bytes. On Python 2.7, it is an
alias for the type str, same as what was previously defined in
_compat.py.
|
| | |
| | |
| | |
| | | |
Stream message now respect the decode_responses flag.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Redis 5.0.1 and beyond require that COUNT be specified as a positive
integer. Since we can't guess the maximum possible value (UULONG_MAX
can vary based on server architecture), force min/max/count to be
required arguments
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When incr=True and xx=True and an element is specified that doesn't exist
the Redis server returns None. redis-py now does this as well.
Fixes #1084
|
|\ \ \
| | | |
| | | | |
Re-fix the recently broken INFO parsing, see #1018
|
| | | |
| | | |
| | | |
| | | |
| | | | |
The value part of the info line may contains : in many cases,
most importantly an IPv6 slave address, may cause the parser to crash.
|
|\ \ \ \
| | | | |
| | | | | |
Add client kill with filter
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
changed skipme to a bool
use a list to accumulate filter options
|
| | | | |
| | | | |
| | | | |
| | | | | |
Signed-off-by: Theo Despoudis <thdespou@hotmail.com>
|
| | | | |
| | | | |
| | | | |
| | | | | |
Signed-off-by: Theo Despoudis <thdespou@hotmail.com>
|
| | | | |
| | | | |
| | | | |
| | | | | |
Signed-off-by: Theo Despoudis <thdespou@hotmail.com>
|
| | | | |
| | | | |
| | | | |
| | | | | |
Signed-off-by: Theo Despoudis <thdespou@hotmail.com>
|