summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2016-06-17 14:42:24 -0700
committerJeff Forcier <jeff@bitprophet.org>2016-06-17 14:42:24 -0700
commit73110f8ef827e97044d7cc73447798e5da3075eb (patch)
treeb7b9b4a6e98e8451487c4acad9572f2c1c17b541
parent3a13b43a0d15b9af10a8106574d91397d18faa07 (diff)
parent7b5f7ef63e91e714457dfa40d9b71864228aff2c (diff)
downloadparamiko-73110f8ef827e97044d7cc73447798e5da3075eb.tar.gz
Merge branch '1.17' into 2.0
-rw-r--r--paramiko/client.py6
-rw-r--r--sites/www/faq.rst10
2 files changed, 16 insertions, 0 deletions
diff --git a/paramiko/client.py b/paramiko/client.py
index e3d3780e..ebf21b08 100644
--- a/paramiko/client.py
+++ b/paramiko/client.py
@@ -382,6 +382,12 @@ class SSHClient (ClosingContextManager):
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
diff --git a/sites/www/faq.rst b/sites/www/faq.rst
index a5d9b383..74b7501e 100644
--- a/sites/www/faq.rst
+++ b/sites/www/faq.rst
@@ -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.