Skip to content

Fix sftp async methods not observing error conditions #1510

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

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

Rob-Hague
Copy link
Collaborator

The async methods on SftpClient (as implemented in SftpSession) were only completing on receiving a response in the sftp layer, or via cancellation. They were not paying any attention to the ErrorOccured, SessionDisconnected or ChannelClosed events, which would result in an infinite wait when one of these occured.

This fix waits asynchronously on the wait handles using ThreadPool.RegisterWaitForSingleObject. It also adds missing plumbing of OperationTimeout.

closes #1497

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rob-Hague Rob-Hague merged commit fbedaab into sshnet:develop Oct 8, 2024
1 check passed
@Rob-Hague Rob-Hague deleted the async_errors branch October 8, 2024 06:49
@Rob-Hague
Copy link
Collaborator Author

Thanks

@dsuesstr
Copy link

Is there a release date or workaround for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite timeout on async UploadFile with OpenAsync/CopyToAsync
3 participants