leporo / tornado-redis

Asynchronous Redis client that works within Tornado IO loop.
667 stars 163 forks source link

Leaking file descriptors #13

Closed R1ckyG closed 11 years ago

R1ckyG commented 12 years ago

Hi, I've been using tornado-redis with tornado-2.3 and have noticed that when a Client object with an open connection leaves scope and is reclaimed by the garbage collector, the file descriptor for the socket object is not closed.

I think this is caused by a reference to a connection object that is saved in a tornado ExceptionStackContext that should have been removed. The reference in the ExceptionStackContext stops the garbage collector from reclaiming the IOStream connected to redis and closing the socket.

I've attached a link to code for the test server I use to recreate the bug. I've also attached a link to a graph showing the references to the IOStream object. To run the server you will need the objgraph module: http://mg.pov.lt/objgraph/ Server code: http://dl.dropbox.com/u/107369108/test_server.py

Reference Graph: http://dl.dropbox.com/u/107369108/tmpEQOP5_.png

Thanks!!!

tesh11 commented 11 years ago

Hi - I was wondering what you ended up discovering here. Thanks

gtzilla commented 11 years ago

Hi, I'm having a very similar issue. What was the resolution for this? I am using tornado 2.4

michaelhood commented 11 years ago

I also have this, on Tornado 2.3

R1ckyG commented 11 years ago

Unfortunately, I never found a solution for this and have since switched to node.js. Sorry I'm not more help but Good luck!!

R1ckyG commented 11 years ago

I never found a solution. Sorry I'm not more help but good luck.

michaelhood commented 11 years ago

thanks for the reply @R1ckyG