summaryrefslogtreecommitdiff
path: root/tests/test_connection_pool.py
Commit message (Collapse)AuthorAgeFilesLines
* test all selectors via pytest parameterizationhealty_connectionsAndy McCurdy2019-02-111-48/+0
|
* attempt to provide only healthy connections from the poolAndy McCurdy2019-02-041-5/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Connection URLs must have a valid scheme.Andy McCurdy2019-01-271-0/+4
| | | | | Fixes #969 Fixes #961
* remove legacy Redis classAndy McCurdy2018-11-131-1/+1
| | | | | | | | | | | | | | | | | | | redis-py maintained backwards compatibility by keeping the old "Redis" class around for quite some time. While no doubt a convenience for folks who relied on it, the presence of both Redis and StrictRedis causes a number of support issues and general confusion. With 3.0, we're breaking a few things to make redis-py better going forward. This change removes the old Redis class. We also renamed the StrictRedis class to Redis and aliased StrictRedis to Redis. For people that have been using StrictRedis, this should not change anything. You can continue doing things as you are. People still using the legacy Redis class will need to update the argument order for the SETEX, LREM and ZADD commands. Additionally, the return values for TTL and PTTL now return the integer values -1 when a key exists but has no expire time and -2 when a key does not exist. Previously these cases returned a None value in the Redis class.
* Remove from __future__ import with_statementJon Dufresne2018-11-031-1/+0
| | | | All supported Python versions support the with statement.
* Fix parsing max_connections URL query string parameterMichał Masłowski2018-05-231-1/+2
| | | | | Previously ConnectionPool.from_url kept it as a string, causing a 'ValueError: "max_connections" must be a positive integer'.
* PEP8 fixesTim Savage2016-03-291-3/+11
|
* Extend ConnectionPool.to_url to parse querystring arguments to correct type.Tim Savage2016-03-291-1/+38
| | | | | 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.
* Handle percent-encoded URLs in parsing codePaul Keene2015-02-091-0/+45
|
* consistent naming, #446Andy McCurdy2014-05-141-3/+5
|
* allow cert_reqs to be a string and convert it to the appropriate SSL constant.Andy McCurdy2014-05-131-0/+26
|
* Cleaned up URL parsing code, now returns ConnectionPool instances.Andy McCurdy2014-05-111-187/+191
| | | | | | | StrictRedis.from_url() now creations a connection pool instance and passes that as the connection_pool argument to the client class. Cleaned up the test suite for URL parsing and BlockingConnectionPool tests
* Merge branch 'pr/436'Andy McCurdy2014-05-111-0/+145
|\ | | | | | | | | Conflicts: tests/test_connection_pool.py
| * pep8 fixeswil paredes2014-02-091-12/+12
| |
| * add from_url() classmethod to ConnectionPool and BlockingConnectionPool, add ↵wil paredes2014-02-091-0/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ability to parse UNIX domain socket URLs * add redis.connection.parse_url() * moved code from StrictRedis.from_url() to here * add ability to parse UNIX domain socket URLs * return keyword args to pass to StrictRedis.__init__() * StrictRedis.from_url() - call parse_url() to get keyword args * add classmethod from_url() to ConnectionPool and BlockingConnectionPool * get keyword args from parse_url() * touch up keyword args from StrictRedis format for connection pool * tests/test_connection_pool.py * add from_url() tests for ConnectionPool and BlockingConnectionPool * add from_url() tests for a single Redis client object
* | SentinelManagedConnections to master servers disconnect on READONLY errors.Andy McCurdy2014-05-061-0/+6
| | | | | | | | | | Any attempt to reconnect will force all connections in that pool to update their connections to the new master. Fixes #435
* | better error handling with hiredis. fully fixes #456Andy McCurdy2014-04-211-15/+14
| |
* | mostly fixes #456. there's still an issue w/ hiredis and multi-bulk repliesAndy McCurdy2014-04-101-0/+31
| |
* | DEBUG LOADING was released in 2.8.8, so skip test with earlier versionsAndy McCurdy2014-03-311-2/+1
| |
* | make sure we know the order of expected subscribe/unsubscribe messagesAndy McCurdy2014-03-291-3/+0
| |
* | make sure hiredis parser raises connection errorsAndy McCurdy2014-03-101-1/+18
|/
* Move repr to Connection and UnixDomainConnection. Add repr support to Redis, ↵Mark Roberts2013-11-051-7/+52
| | | | ConnectionPool, and BlockingConnectionPool
* Add support for showing db connection info via reprMark Roberts2013-11-011-0/+6
|
* Errors during auth or DB select now close the socketAndy McCurdy2013-09-081-0/+17
| | | | Fixes #368
* python 2.5 compatandy2013-06-051-0/+1
|
* connection pool testsandy2013-06-041-0/+107