deldotdr / txredis Goto Github PK
View Code? Open in Web Editor NEWA Redis client library for Twisted Python
License: Other
A Redis client library for Twisted Python
License: Other
Hi!
I see exception 'object of type 'int' has no len()' when I use zrangebyscore with withscores set to True. Redis returns emptymultibulk which is "*0\r\n" when there is no results and post_process fail. Thank you.
Adopt version scheme to reflect supported version of Redis server.
make sure all pre-2.0 unittests pass against the 2.0 server
There is a problem where, after a txredis.client.RedisClient
has successfully sent a QUIT
command to the Redis server, the server properly tears down the connection, and Twisted properly calls txredis.client.RedisClient.connectionLost
, which calls txredis.RedisClient.failRequests
, the later of which propagates the twisted.internet.error.ConnectionLost
to all requests in its internal queue (txredis.RedisClient._request_queue
), without seemingly bothering to check if these requests have already succeeded. This causes the deferred transactions in the internal queue to assume that their overarching RedisClient
has a half-terminated TCP connection, causing thousands of errbacks to get propagated for no good reason.
Technically, the ConnectionLost
is not really an error, it's just a signal sent from Twisted that the other end tore down the connection. This is precisely what is supposed to happen when you send QUIT
, so this is somewhat a design flaw in txredis
.
For a piece of software I develop at work, I have fixed this issue by subclassing RedisClient
and overriding the connectionLost
method as follows:
class MyRedisClient(txredis.client.RedisClient):
def connectionLost(self, reason):
trapped = reason.trap(ConnectionLost)
if trapped:
log.msg(
("Trap prevented ConnectionLost from propagating to "
"`RedisClient.failRequests()`. All's well."))
else:
super(MyRedisClient, self).connectionLost(reason)
If desired, I can gladly either fork or provide git patches, if you think that this issue merits fixing.
Thanks for creating txredis
!
Bug fixes....
Review.
Commands:
Hi
I found that auth method was missed in RedisSubscriber threfore I can't authenticate on server through it.
Commands:
Currently in txRedis
we use a mix of the old and new protocols. Redis 2.2 has moved to using the new protocol exclusively, so we should move to that accordingly.
Pass through doc strings, fill in missing and enhance any incomplete ones.
When trying to run the examples, all off them fail with:
Traceback (most recent call last):
File "demo.py", line 5, in
from txredis.protocol import Redis
ImportError: cannot import name Redis
Do assume to decode as unicode. If the value of a key is SET with a str type, GET key should return a str type, not a unicode type.
Line 133 of test_txredis.py
The version in the cheeseshop is one year old, and does not handle zsets for instance .. (and doesn't use multi bulk protocol). so not at all making use of all cool redis 2.0 features ..
could you please update it ??
(this is just in order to comfortably use pip install txredis .. but using the git is also doable with pip so this is totally not critical )
Commands:
ther is no more possibility to know the patern that's concerned by the message.
and code may be break by the update
Maybe 2 possibility:
Personnaly i put same code as before
txredis 2.4 installed on python3.4 over easy_install3
after starting crossbar router, this error came up.
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/autobahn/wamp/protocol.py", line 842, in onMessage
on_reply = txaio.as_future(endpoint.fn, _invoke_args, *_invoke_kwargs)
File "/usr/local/lib/python3.4/dist-packages/txaio/tx.py", line 408, in as_future
return maybeDeferred(fun, _args, *_kwargs)
File "/usr/local/lib/python3.4/dist-packages/twisted/internet/defer.py", line 150, in maybeDeferred
result = f(_args, *_kw)
File "/usr/local/lib/python3.4/dist-packages/crossbar/worker/router.py", line 643, in start_router_component
create_component = _appsession_loader(config)
--- ---
File "/usr/local/lib/python3.4/dist-packages/crossbar/worker/init.py", line 58, in _appsession_loader
module = importlib.import_module(module_name)
File "/usr/lib/python3.4/importlib/init.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 2254, in _gcd_import
File "", line 2237, in _find_and_load
File "", line 2226, in _find_and_load_unlocked
File "", line 1200, in _load_unlocked
File "", line 1129, in _exec
File "", line 1471, in exec_module
File "", line 321, in _call_with_frames_removed
File "/home/www/work/dc/example/crossbar/components/main.py", line 7, in
from helpers.util import success
File "/home/www/work/dc/example/backend/crossbar/helpers/util.py", line 6, in
from txredis.client import RedisClient
File "/usr/local/lib/python3.4/dist-packages/txredis-2.4-py3.4.egg/txredis/init.py", line 39, in
builtins.ImportError: No module named 'exceptions'
Currently the test for adding LIMIT argument is broken, it should allow having no offset at all.
Commands:
Commands:
Included in rlotun's branch:
SUBSTR
and APPEND
commandsWhen I load my server with ~100 req/sec I see wrong callbacks called in 'self._request_queue.popleft().callback(reply)'. It's a multithreading script. I've spent one week trying to fix it with no success. Any suggestions?
Update:
Ooops, win32com threads was not working as I expected, sorry for wrong issue.
Commands:
Mathieu has provided pupsub implementation. recently followed up with protocol bug fix.
Finish review and merge branch.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.