ErDmKo / asyncmc

Async Memcached client for Tornado
MIT License
15 stars 7 forks source link

Bug in pool.py, Connection class #1

Open gianpaolo-lopresti opened 9 years ago

gianpaolo-lopresti commented 9 years ago

Hi, the method Connection.send_cmd_all() (pool.py) calls host.mark_dead(msg) on a socket.error: but the Host class doesn't implement such method, so the AttributeError is raised.

I have written this method in the Host class (host.py):

def mark_dead(self, msg):
    logging.error(msg)
    self.close_socket()

I don't know if this could be a solution, but it seems to work.

ErDmKo commented 9 years ago

@gianpaolo-lopresti thanks for your feedback. I will try to make test to repeat it. I have some idea when it can happen.

gianpaolo-lopresti commented 9 years ago

@ErDmKo a sample use case is to have continuous calls to the memcache service (i used a for loop with a sleep() at the end to simulate a production environment), while the memcache deamon is restarted.

ErDmKo commented 9 years ago

@gianpaolo-lopresti thank again Now i add new commit https://github.com/ErDmKo/asyncmc/commit/5f2856662305989529562ec7c29e070cf004be3c and up version in pypi. Than next time i will do try to reconnect than case after "DEAD_RETRY" seconds.

gianpaolo-lopresti commented 9 years ago

Thanks a lot @ErDmKo !! Bye!