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

Incorrect work with redis.PubSub object #20

@surabujin

Description

@surabujin

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions