| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
added "host":"port"
to Exception message for easy debug
Change-Id: Ifaa3bef0c8daf3dd2c60b143746b75a26c182a88
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ \
| | |
| | | |
Add support for SNI connection to Redis-py
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| |_|/
|/| | |
Fix ConnectionPool repr when using default values
|
| | | |
|
| |/
|/|
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Without this using `unix_socket_path` will fail:
AttributeError: 'UnixDomainSocketConnection' object has no attribute '_buffer_cutoff'
Fixes #1067
|
|\ \
| | |
| | | |
Enforce ssl_cert_reqs='required' by default
|
| |/ |
|
|\ \
| | |
| | | |
Improve performence of transactions / pipeline requests which involve large chunks of data.
|
| | |
| | |
| | |
| | | |
chunks of data.
|
| | |
| | |
| | |
| | |
| | | |
on python2.7, repr() on a long produces '123L', which is clearly not what
we want
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
All input sent to Redis is coerced into bytes. This includes key names and
values. Prior to this change, redis-py made an effort to cooerce all input
into strings by calling str() (Python 3) or unicode() (Python 2). While this
works for a handful of types like ints, longs and floats, it fails for other
types like bools ('True' or 'False'), None ('None') and many user defined
types.
Starting with redis-py version 3.0, sending input of any other type is
considered an error an a DataError exception will be raised.
Fixes #471
Fixes #472
Fixes #321
Fixes #190
|
| | |
| | |
| | |
| | | |
Remove workaround for handling unicode with older Pythons.
|
| | |
| | |
| | |
| | | |
Available on all supported Python versions.
|
| | | |
|
|/ /
| |
| |
| | |
All supported Python versions support the with statement.
|
|\ \
| | |
| | | |
Fix parsing max_connections URL query string parameter
|
| |/
| |
| |
| |
| | |
Previously ConnectionPool.from_url kept it as a string, causing a 'ValueError:
"max_connections" must be a positive integer'.
|
| | |
|
|/ |
|
| |
|
|
|
|
| |
this simplifies multiple places that needs to encode and decode values
|
| |
|
| |
|
|\
| |
| | |
Link to redis:// & rediss:// scheme IANA registrations in docs
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
The Token class now contains a cache of tokens, and each token stores its encoded value.
In Python 3 this prevents encoding the Token commands (get, set, incr, etc...) repeatly.
There is also a smaller performance improvement by creating fewer objects.
A very basic benchmark script was also added.
|
| |
| |
| |
| | |
Ref #738
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Previously if a value for socket_timeout was supplied as part fo the URL an error would be raised when a socket was created with an invalid type, this change fixes that by parsing `socket_timeout`, `socket_connect_timeout` to float values.
In addition the boolean values `socket_keepalive` and `retry_on_timeout` are parsed to bool types taking into account the usage of True/False, Yes/No strings.
|
| |
| |
| |
| | |
fixes #675
|
| |
| |
| |
| | |
fixes #641
|
| | |
|