earl / beanstalkc

A simple beanstalkd client library for Python
Apache License 2.0
458 stars 115 forks source link

Connection.close() should send quit before disconnecting #8

Closed robotadam closed 14 years ago

robotadam commented 14 years ago

I noticed while doing some somewhat artificial load testing that Connection.close() closes the socket without sending quit, which results in the socket remaining open for a short while in TIME_WAIT. I made a changeset that sends quit first to ensure the socket is closed.

http://github.com/robotadam/beanstalkc

earl commented 14 years ago

Thanks, I pushed a fix as c9802345c525070a12dec16a0107caa884525a52. It does not use SocketError.wrap as in your suggestion, as we don't really care if sending the quit fails.

robotadam commented 14 years ago

Makes sense; I wasn't sure how thorough you cared to be on the error handling. Thanks for the quick commit.