Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

txredis client hangs up after "multi" command fail #58

Open
aim110 opened this issue Feb 22, 2014 · 1 comment
Open

txredis client hangs up after "multi" command fail #58

aim110 opened this issue Feb 22, 2014 · 1 comment

Comments

@aim110
Copy link

aim110 commented Feb 22, 2014

Hi,

you can launch that code:

from twisted.internet import reactor, defer
import time
from txredisapi import ConnectionPool as Redis

class A(object):
    def __init__(self, db):
        self.db = db

    @defer.inlineCallbacks
    def do(self):
        print 'hello'
        try:
            pipe = yield self.db.multi()
            t = int(time.time())
            val = None
            if pipe:
                yield pipe.set('b', t)
                yield pipe.get('b')
                val = yield pipe.commit()
                print val
        except Exception as e:
            print e

        reactor.callLater(1.0, self.do)

@defer.inlineCallbacks
def main():
    db = yield Redis(dbid=1, poolsize=2)
    print "connected: %s" % db

    a = A(db)
    reactor.callLater(1.0, a.do)

main()
reactor.run()

and restart redis server to reproduce issue

I did a fix for that: 8e04e65

@aim110 aim110 closed this as completed Feb 22, 2014
@aim110 aim110 reopened this Feb 24, 2014
@fiorix
Copy link
Collaborator

fiorix commented Feb 24, 2014

Pull requests are welcome, thanks!

On Feb 24, 2014, at 5:11 AM, IVan notifications@github.com wrote:

Reopened #58.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants