8000
  • Fix sftp async methods not observing error conditions by Rob-Hague · Pull Request #1510 · sshnet/SSH.NET · GitHub
    [go: up one dir, main page]

    Skip to content

    Fix sftp async methods not observing error conditions#1510

    Merged
    Rob-Hague merged 2 commits intosshnet:developfrom
    Rob-Hague:async_errors
    Oct 8, 2024
    Merged

    Fix sftp async methods not observing error conditions#1510
    Rob-Hague merged 2 commits intosshnet:developfrom
    Rob-Hague:async_errors

    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.

    Easiest to view with whitespace off: https://github.com/sshnet/SSH.NET/pull/1510/files?w=1

    @Rob-Hague Rob-Hague merged commit fbedaab into sshnet:develop Oct 8, 2024
    @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

    0