If you create more than one instances of pyssh,Ssh in the same process, then the process hangs when you close() any of them.
The problem is that each instance registers a signal handler to handle SIGCHLD, so each of them sees the signal, and each of them calls a blocking os.waitpid() on the pid its own SSH process. When the first SIGCHLD arrives, all the instances call a blocking os.waitpid(), even those which do not expect their SSH subprocess to exit.
The solution is to use a nonblocking os.waitpid() call.
Log in to post a comment.