libgit2 / libgit2/libgit2sharp

No error message is provided when there is a Network Failure

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

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

主要言語
C#
スター
3.5k
フォーク
925
PR マージ指標
30日以内にマージされた PR はありません

説明

Reproduction steps

Use libgit2sharp in a bad network place

Expected behavior

Throw an exception that explicitly mentions network failure

Probably it's a good idea to handle situations where wifi signal is not strong or network failure. We could also handle this gracefully.

Actual behavior

Throws LibGit2Sharp.LibGit2SharpException saying

No error message has been provided by the native library

Stack trace,

Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> LibGit2Sharp.LibGit2SharpException: No error message has been provided by the native library
   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
   at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result)
   at LibGit2Sharp.Core.Proxy.git_remote_fetch(RemoteHandle remote, IEnumerable`1 refSpecs, GitFetchOptions fetchOptions, String logMessage)
   at LibGit2Sharp.Commands.Fetch(Repository repository, String remote, IEnumerable`1 refspecs, FetchOptions options, String logMessage)
   at LibGit2Sharp.Commands.Pull(Repository repository, Signature merger, PullOptions options)
   at GitUtil.Program.Main(String repoPath, String action, String filePath) in D:\git_ws\GitUtil\Program.cs:line 84
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
Version of LibGit2Sharp (release number or SHA1)

0.27.0-preview-0158 and earlier

Operating system(s) tested; .NET runtime tested

Win 10, .Net SDK 6.0.101

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

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

はじめの一歩

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

調査の方向性

Core.Ensure.HandleError から開始し、Proxy.git_remote_fetch、Commands.Fetch、Commands.Pull を通るエラーパスを追跡します。issue に記載されたネットワーク不良時の fetch を再現し、ネイティブエラーがどのように表面化されるかを調査します。完了の条件は、ネットワーク障害によって、ネイティブライブラリの空のメッセージではなく、明示的で有用なネットワーク関連メッセージを含む例外が発生することです。

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

評価

技術スタック
csharp, git
領域
networking
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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