Skip to content
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

close Client sockets if connection fails #4074

Merged
merged 2 commits into from
Sep 3, 2013
Merged

Conversation

minrk
Copy link
Member

@minrk minrk commented Aug 20, 2013

avoids runaway FDs in cases of frequent client failure.

also cleanup Client.close a little bit, allowing setting linger on sockets at shutdown time,
which is helpful for preventing FD growth on connection failure.

Should be considered for backport to 1.1.

allows setting `linger` on sockets at shutdown time.
avoids runaway FDs in cases of frequent client failure.

try:
self._connect(sshserver, ssh_kwargs, timeout)
except:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you just use finally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it shouldn't happen if an exception isn't raised.

@florian-wagner
Copy link

The error Too many open files (signaler.cpp:330) did not occur anymore with this patch. Thank you!

minrk added a commit that referenced this pull request Sep 3, 2013
close Client sockets if connection fails

also cleanup Client.close a little bit, allowing setting linger on sockets at shutdown time,
which is helpful for preventing FD growth on connection failure.

Should be considered for backport to 1.1.
@minrk minrk merged commit 5b5f56d into ipython:master Sep 3, 2013
@minrk minrk deleted the close-on-fail branch September 3, 2013 22:58
minrk added a commit that referenced this pull request Sep 4, 2013
avoids runaway FDs in cases of frequent client failure.

also cleanup Client.close a little bit, allowing setting `linger` on sockets at shutdown time,
which is helpful for preventing FD growth on connection failure.

Should be considered for backport to 1.1.
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
close Client sockets if connection fails

also cleanup Client.close a little bit, allowing setting linger on sockets at shutdown time,
which is helpful for preventing FD growth on connection failure.

Should be considered for backport to 1.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants