Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add configurable maximum number of attempts and wait time to download retries

Đang mở
#820 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
tooling

Hướng nghiên cứu

Start in src/LibraryManager/Cache/CacheService.cs, especially the download and cache-refresh paths linked in the issue, and trace how attempts and the 200ms backoff are supplied. Identify the existing configuration surface before deciding where the two settings belong. Done means configurable attempt and wait-time values with defaults of 5 and a longer backoff, covered by the relevant retry tests.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Is your feature request related to a problem? Please describe.

When downloading a package fails, LibMan can retry it, but it doesn't seem to do this when simply downloading a package anew. This causes sporadic build failures for us with the kenwheeler/slick@ecb6ea2 library references (and it seems only this one), LibMan failing with the following exception:

/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error : Microsoft.Web.LibraryManager.Contracts.ResourceDownloadException: Failed to download resource from "https://cdn.jsdelivr.net/gh/kenwheeler/slick@ecb6ea2/slick/slick.min.css" [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error :  ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found). [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at System.Net.Http.HttpClient.GetStreamAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at Microsoft.Web.LibraryManager.Cache.WebRequestHandler.GetStreamAsync(String url, CancellationToken cancellationToken) [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error :    --- End of inner exception stack trace --- [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at Microsoft.Web.LibraryManager.Cache.WebRequestHandler.GetStreamAsync(String url, CancellationToken cancellationToken) [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at Microsoft.Web.LibraryManager.Cache.CacheService.DownloadToFileAsync(String url, String fileName, Int32 attempts, CancellationToken cancellationToken) [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at Microsoft.Web.LibraryManager.Cache.CacheService.<>c__DisplayClass9_0.<<RefreshCacheAsync>g__DownloadFileIfNecessaryAsync|0>d.MoveNext() [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error : --- End of stack trace from previous location --- [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at Microsoft.Web.LibraryManager.Utilities.ParallelUtility.DoActionAndRelease[T](Func`2 act, T input, SemaphoreSlim s) [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at Microsoft.Web.LibraryManager.Utilities.ParallelUtility.ForEachAsync[T](Func`2 action, Int32 degreeOfParallelism, IEnumerable`1 items, CancellationToken cancellationToken) [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at Microsoft.Web.LibraryManager.Cache.CacheService.RefreshCacheAsync(IEnumerable`1 librariesCacheMetadata, ILogger logger, CancellationToken cancellationToken) [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
/home/runner/.nuget/packages/microsoft.web.librarymanager.build/3.0.71/build/Microsoft.Web.LibraryManager.Build.targets(35,9): error :    at Microsoft.Web.LibraryManager.Providers.BaseProvider.RefreshCacheAsync(ILibraryInstallationState state, ILibrary library, CancellationToken cancellationToken) [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
libman.json : error LIB010: Failed to download resource from "https://cdn.jsdelivr.net/gh/kenwheeler/slick@ecb6ea2/slick/slick.min.css" [/home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/src/Modules/Lombiq.UIKit/Lombiq.UIKit/Lombiq.UIKit.csproj]
Describe the solution you'd like

Ideally, we would not get such download failures in the first place. However, this seems to be noticeably frequent for kenwheeler/slick@ecb6ea2 for some reason. Only jsdelivr supports such digest expressions, so we can't try the others.

However, if this can't be solved somehow for good, it'd be great to have better retries:

  • Make the number of attempts configurable, and use a default of 5, like it is for cache refreshes.
  • The current backoff time between attempts is 200ms. This is too low for transient errors to reliably clear (even with 5 attempts it would be just 1s). Instead, make this configurable (we'd use something like 5s).
Describe alternatives you've considered

Having fallback providers, but that brings its own challenges.

Additional context

Nothing else to add.

Ngôn ngữ chính
C#
Star
486
Fork
91
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aspnet/LibraryManager

Tất cả issue của aspnet/LibraryManager

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.