sshnet / sshnet/SSH.NET

PrivateKeyAuthenticationMethod.Authenticate can take up to 25000milliseconds

オープン
#403 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C#
スター
4.4k
フォーク
993
平均マージ
9日 21時間
マージ済み PR(30日)
1

説明

Hello,

I am facing a weird issue where connection to a server (SSH or SFTP) can sometimes take a very long time though the network condition are quite good. I have drilled down to Authenticate method of PrivateKeyAuthenticationMethod class and put some tracing around the first WaitOnHandle:

                //  Send public key authentication request
                session.SendMessage(message);

System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
sw.Start();
session.WaitOnHandle(_authenticationCompleted);
System.Diagnostics.Trace.WriteLine($"PK AUTH doing {keyFile.HostKey.Name} took {sw.ElapsedMilliseconds} milliseconds");

Here are some results:
PK AUTH doing ssh-rsa took 9108 milliseconds
PK AUTH doing ssh-rsa took 315 milliseconds
PK AUTH doing ssh-rsa took 262 milliseconds
PK AUTH doing ssh-rsa took 310 milliseconds
PK AUTH doing ssh-rsa took 271 milliseconds
PK AUTH doing ssh-rsa took 1126 milliseconds
PK AUTH doing ssh-rsa took 258 milliseconds
PK AUTH doing ssh-rsa took 322 milliseconds
PK AUTH doing ssh-rsa took 8649 milliseconds
PK AUTH doing ssh-rsa took 311 milliseconds
PK AUTH doing ssh-rsa took 2674 milliseconds
PK AUTH doing ssh-rsa took 317 milliseconds
PK AUTH doing ssh-rsa took 260 milliseconds
PK AUTH doing ssh-rsa took 280 milliseconds
PK AUTH doing ssh-rsa took 10827 milliseconds
PK AUTH doing ssh-rsa took 276 milliseconds
PK AUTH doing ssh-rsa took 254 milliseconds
PK AUTH doing ssh-rsa took 271 milliseconds

PK AUTH doing ssh-rsa took 265 milliseconds
PK AUTH doing ssh-rsa took 1694 milliseconds
PK AUTH doing ssh-rsa took 3949 milliseconds
PK AUTH doing ssh-rsa took 315 milliseconds
PK AUTH doing ssh-rsa took 267 milliseconds
PK AUTH doing ssh-rsa took 1021 milliseconds
PK AUTH doing ssh-rsa took 261 milliseconds
PK AUTH doing ssh-rsa took 318 milliseconds
PK AUTH doing ssh-rsa took 256 milliseconds
PK AUTH doing ssh-rsa took 310 milliseconds
PK AUTH doing ssh-rsa took 257 milliseconds
PK AUTH doing ssh-rsa took 321 milliseconds
PK AUTH doing ssh-rsa took 255 milliseconds
PK AUTH doing ssh-rsa took 2486 milliseconds
PK AUTH doing ssh-rsa took 251 milliseconds
PK AUTH doing ssh-rsa took 273 milliseconds
PK AUTH doing ssh-rsa took 252 milliseconds
PK AUTH doing ssh-rsa took 20895 milliseconds

This has been executed twice against 12 servers (physically different, but exactly the same from software perspective) in the same network conditions.
I can't figure out what could be the problem and I can't imagine why such authentication usually takes 300 milliseconds but cam raise up to 25000ms !?

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

PrivateKeyAuthenticationMethod.Authenticate から開始し、公開鍵認証要求の後にある最初の session.WaitOnHandle 呼び出しに焦点を当てます。報告されたサーバー間の変動するタイミングを再現し、同等のトレースを使って原因を切り分けます。断続的な遅延が説明され、検証済みの修正または明確な診断が文書化されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp
領域
networking
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。