Skip to content

Commit

Permalink
Merge branch '1.16' into 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed Jun 17, 2016
2 parents 33981bd + b3342c9 commit 7b5f7ef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions paramiko/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,12 @@ def connect(
def close(self):
"""
Close this SSHClient and its underlying `.Transport`.
.. warning::
Failure to do this may, in some situations, cause your Python
interpreter to hang at shutdown (often due to race conditions).
It's good practice to `close` your client objects anytime you're
done using them, instead of relying on garbage collection.
"""
if self._transport is None:
return
Expand Down
10 changes: 10 additions & 0 deletions sites/www/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,13 @@ However, **closed does not imply locked** - affected users can still post
comments on such tickets - and **we will always consider actual patch
submissions for these issues**, provided they can get +1s from similarly
affected users and are proven to not break existing functionality.

I'm having strange issues with my code hanging at shutdown!
===========================================================

Make sure you explicitly ``.close()`` your connection objects (usually
``SSHClient``) if you're having any sort of hang/freeze at shutdown time!

Doing so isn't strictly necessary 100% of the time, but it is almost always the
right solution if you run into the various corner cases that cause race
conditions, etc.

0 comments on commit 7b5f7ef

Please sign in to comment.