Skip to content
This repository has been archived by the owner on Jan 10, 2019. It is now read-only.

Incorrect work with redis.PubSub object #20

Open
surabujin opened this issue May 15, 2014 · 0 comments
Open

Incorrect work with redis.PubSub object #20

surabujin opened this issue May 15, 2014 · 0 comments

Comments

@surabujin
Copy link

Take simple example:

import sys
import time

import thoonk


def main():
    client = thoonk.Thoonk(listen=True)

    # got exception in ThoonkListener thread
    time.sleep(5)

    print 'Normal exit'


if __name__ == '__main__':
    sys.exit(main())

Output:

$ python thoonk-fail.py 
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/share/devel/WSA/_env_/local/lib/python2.7/site-packages/thoonk/pubsub.py", line 311, in run
    for event in self._pubsub.listen():
  File "/usr/share/devel/WSA/_env_/local/lib/python2.7/site-packages/redis/client.py", line 1871, in listen
    r = self.parse_response()
  File "/usr/share/devel/WSA/_env_/local/lib/python2.7/site-packages/redis/client.py", line 1815, in parse_response
    response = self.connection.read_response()
AttributeError: 'NoneType' object has no attribute 'read_response'

Normal exit

redis monitor:

1400150988.156461 [0 127.0.0.1:46306] "SUBSCRIBE" "listenerclose_f65d5e305b3941a5a7504a85042666e6" "newfeed" "delfeed" "conffeed"
1400150988.156690 [0 127.0.0.1:46307] "SMEMBERS" "feeds"
1400150988.156954 [0 127.0.0.1:46306] "UNSUBSCRIBE"
$ redis-server --version
Redis server v=2.8.9 sha=00000000:0 malloc=jemalloc-3.2.0 bits=64 build=4b22cefc161c6bbf

PS Is project alive?

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

No branches or pull requests

1 participant