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

[SUPPORT] - Exception in prefetch thread after closing connection #2379

Open
QIvan opened this issue Apr 4, 2024 · 0 comments
Open

[SUPPORT] - Exception in prefetch thread after closing connection #2379

QIvan opened this issue Apr 4, 2024 · 0 comments
Labels

Comments

@QIvan
Copy link

QIvan commented Apr 4, 2024

Are you using paramiko as a client or server?

Client

What feature(s) aren't working right?

SFTP

What version(s) of paramiko are you using?

3.4.0

What version(s) of Python are you using?

3.11.8

What operating system and version are you using?

Linux 5.4.269-1.el8.elrepo.x86_64 x86_64 GNU/Linux

If you're connecting as a client, which SSH server are you connecting to?

openssh

If you're using paramiko as part of another tool, which tool/version?

No response

What are you trying to do with paramiko?

hi! Thanks a lot for the library, it's very handy
I was experimenting with prefetch, and I got very good results compared to the default .get(file) version, but when I deployed my code to the production, I noticed this weird exception in my logs:

2024-04-04 18:50:21,817 INFO luigi-interface.dps.get_logger segments_download file download is complete
    self.run()
  File "/usr/local/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/app/.venv/lib/python3.10/site-packages/paramiko/sftp_file.py", line 561, in _prefetch_thread
    num = self.sftp._async_request(
  File "/app/.venv/lib/python3.10/site-packages/paramiko/sftp_client.py", line 881, in _async_request
    self._send_packet(t, msg)
  File "/app/.venv/lib/python3.10/site-packages/paramiko/sftp.py", line 209, in _send_packet

This happens when I closed the connection to the sftp server. My guess is there is a separate thread for the prefetch mechanism, and it's not closed even after I called the paramiko.sftp_client.SFTPClient.close method. Is there a way how I can wait for such a tread to finish?

How are you trying to do it, and what's happening instead?

You may find my code here https://stackoverflow.com/a/78275652/2406992

Anything else?

Thank you in advance!

@QIvan QIvan added the Support label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant