New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mjg/fix filehandle leak #5

Merged
merged 4 commits into from Jul 30, 2015

Conversation

Projects
None yet
2 participants
@mjg17
Contributor

mjg17 commented Jul 30, 2015

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.

(Commits 0412e97 and 2592075 are not necessary to fix this, but were part of my debugging and seem correct and appropriate to keep.)

All the best
Michael

@lestrrat

This comment has been minimized.

Show comment
Hide comment
@lestrrat

lestrrat Jul 30, 2015

Collaborator

Thanks!

Collaborator

lestrrat commented Jul 30, 2015

Thanks!

lestrrat added a commit that referenced this pull request Jul 30, 2015

@lestrrat lestrrat merged commit bf776f6 into lestrrat-p5:master Jul 30, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

lestrrat added a commit that referenced this pull request Jul 30, 2015

Checking in changes prior to tagging of version 0.00023.
Changelog diff is:

diff --git a/Changes b/Changes
index 7e03fcd..5b4d1c3 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,9 @@ Changes

 {{$NEXT}}

+0.00023 2015-07-30T23:51:22Z
+    * Avoid reconnnecting when already disconnecting (PR #5)
+
 0.00022 2013-10-04T03:39:14Z
     * Add new serializers (JSON, MessagePack)
     * Update layout by switching to Minilla
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment