Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
SFTPClient.stat freeze on concurrent invocation #718
When trying to invoke
#!/usr/bin/python3 HOSTNAME = # replace with your own USERNAME = # replace with your own KEY_FILENAME = # replace with your own from threading import Thread from paramiko import SSHClient, AutoAddPolicy ssh = SSHClient() ssh.set_missing_host_key_policy(AutoAddPolicy()) ssh.connect(hostname=HOSTNAME, username=USERNAME, key_filename=KEY_FILENAME) sftp = ssh.open_sftp() def print_root_stat(caption): print(caption, '\t', 'stat:', sftp.stat('/')) print_root_stat('Main thread') threads = [Thread(group=None, target=print_root_stat, args=('Thread %s' % i,), daemon=False) for i in range(10)] for thread in threads: thread.start()
When I run this I get:
And that's it(it's always different threads that manage to run).
Does Paramiko's SFTP even supposed to support concurrency? Looking at the code it seems like it should, but I didn't see no such promise in the docs...