leporo / tornado-redis

Asynchronous Redis client that works within Tornado IO loop.
666 stars 162 forks source link

Bug in ConnectionProxy #27

Closed sharik closed 11 years ago

sharik commented 11 years ago

I've found bug with ConnectionProxy when all created_connection >= max_connections and wait_for_available option is True

File "env/lib/python2.7/site-packages/tornado/gen.py", line 367, in run 
  self.yield_point.start(self)
File "env/lib/python2.7/site-packages/tornado/gen.py", line 241, in start
  self.func(*self.args, **self.kwargs)
File "env/lib/python2.7/site-packages/tornado/gen.py", line 120, in wrapper
  runner.run()
File "env/lib/python2.7/site-packages/tornado/gen.py", line 345, in run
  yielded = self.gen.send(next)
File " env/lib/python2.7/site-packages/tornadoredis/client.py", line 1146, in execute
  self.connection.info.get('db', None) != self.selected_db):
AttributeError: 'ConnectionProxy' object has no attribute 'info'

I can add "self.info = {'db': 0}" attribute to ConnectionProxy but I don't fully understand process of connection releasing and how wait_until_ready function works.

leporo commented 11 years ago

Thank you. It's easy to reproduce the bug using your report.

leporo commented 11 years ago

Thank you. This bug has been fixed in most recent version of tornado-redis. Please check does this change solve the issue in your case?