Join GitHub today
Mjg/fix filehandle leak #5
On my Mac (OS X 10.9.5 Mavericks), the latest git version of CMAE was failing its tests in t/run.t at about Binary/Traditional/Storable Dorman, with 'Failed to connect to any memcached servers'.
Displaying the actual connect error (commit 9110fe9) revealed that this was due to running out of file handles, 'failed to connect to 127.0.0.1:10005 [Too many open files]'.
Eventually I tracked this down to servers getting reconnected during disconnect processing - in the event loop of the following test - by a call to _drain_queue(). The solution is to introduce a state _is_disconnecting and to test for this in _drain_queue(). (Commit c6e2257)
Tests now pass on my Mac, and a file handle leak has been closed.
All the best