sshnet / sshnet/SSH.NET

SSHException Channel was closed intermittent behavior

未关闭
#511 10 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C#
星标
4.4k
派生
993
平均合并
9 天 21 小时
30 天内合并 PR
1

描述

We are connecting to a client SFTP and prior to this week had nothing but successful transactions.
We are now experiencing intermittent exceptions. We are calling this functionality from an Azure function, and the files are streamed from Azure storage, but i don't believe that has any impact on the issue.
I have tried both synchronous and asynchronous methods and had success locally, and on majority of live test cases, but when it fails, I don't have an idea of what the problem may be. Any thoughts would be much appreciated.

My code is below:

sftpClient.Connect();
var uploadPath = $"{sftpFolder}/{fileName}";
sftpClient.UploadFile(stream, uploadPath);
sftpClient.Disconnect();

Alternatively, I tried instead:

sftpClient.Connect();
var uploadPath = $"{sftpFolder}/{fileName}";
var returnVal = sftpClient.BeginUploadFile(stream, uploadPath, new AsyncCallback(x => FileTransferred(x, log, fileName, uploadPath)));

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从已报告的 Connect()、UploadFile() 和 BeginUploadFile() 调用开始,将 Azure Function 中的间歇性失败与本地运行成功的情况进行比较。记录 SSHException 的完整上下文以及连接或传输条件;完成标准是确定一个可复现的原因,并记录或验证针对间歇性通道关闭的修复方案。

由索引模型根据 Issue 内容生成。

评估

技术栈
azure, csharp
领域
cloud, networking
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。