Belemetry: closing a circuit while BelemetryJsBridge starts throws ObjectDisposedException
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Mở src/Utilities/Belemetry/Bit.Belemetry/Interop/BelemetryJsBridge.cs và đọc StartAsync cùng với DisposeAsync: lock được lấy ở đầu StartAsync, được giữ xuyên suốt import, start, attachDotNet và SynchronizeAsync, được nhả trong finally, và được dispose ở cuối DisposeAsync. Chọn một trong hai cách sửa mà issue đề xuất — ngừng dispose _startLock, hoặc bảo vệ Release() bằng cờ _disposed — và giữ nguyên xử lý hủy hiện có. Hoàn tất nghĩa là một trang Blazor Server đóng giữa lúc khởi động sẽ không còn ghi log ObjectDisposedException từ StartAsync nữa.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When a Blazor Server circuit is disposed while BelemetryJsBridge.StartAsync is still awaiting its JS interop calls, the finally block calls _startLock.Release() on a SemaphoreSlim that DisposeAsync has already disposed:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Threading.SemaphoreSlim'.
at System.Threading.SemaphoreSlim.Release()
at Bit.Belemetry.BelemetryJsBridge.StartAsync()
at Bit.Belemetry.BelemetryInitializer.OnAfterRenderAsync(Boolean firstRender)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(...)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit '...'.
It is logged as an unhandled exception in the circuit. Nothing else breaks, since the circuit is going away anyway, but it shows up as an error every time a tab closes during startup.
Where: src/Utilities/Belemetry/Bit.Belemetry/Interop/BelemetryJsBridge.cs: StartAsync holds _startLock across import, start, attachDotNet and SynchronizeAsync; DisposeAsync ends with _startLock.Dispose().
Fix: don't dispose _startLock in DisposeAsync (a SemaphoreSlim that never had its AvailableWaitHandle read holds nothing that needs disposing), or have StartAsync's finally skip Release() once _disposed is set.
Repro: open a page with BelemetryInitializer on Blazor Server and close the tab while it starts (a slow network makes the window wide).
- Ngôn ngữ chính
- C#
- Star
- 1.4k
- Fork
- 264
- Merge trung bình
- 8 giờ 5 phút
- Pull request đã merge (30 ngày)
- 595
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bitfoundation/bitplatform
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
bitfoundation/bitplatform#15051 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bit Boilerplate and bit CLI move to bitfoundation/bitfabricCó thể đã có người làm @yasmoradi đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
bitfoundation/bitplatform#15454 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
More text positions and per-text styling to the bar texts of BitResourceTimelineCó thể đã có người làm @msynk đã nhận 1 ngày trước. Đang mởarea / BlazorUI
bitfoundation/bitplatform#15441 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Deprecated and obsolete SCSS features used in BlazorUI projectsCó thể đã có người làm @msynk đã nhận 2 ngày trước. Đang mởarea / BlazorUI
bitfoundation/bitplatform#15433 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`Bit.BlazorUI.Icons`: GitHub and WhatsApp brand glyphsCó thể đã có người làm @msynk đã nhận 4 ngày trước. Đang mởarea / BlazorUI
bitfoundation/bitplatform#15400 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của bitfoundation/bitplatform
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
dotnet-outdated/dotnet-outdated#871 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage/untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
unoplatform/uno#26676 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[问题] 导出文件时,提示后面还有1243390911步Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
jhaizhou-ops/S2Arm#2177 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-CodeGen-coreclr untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
dotnet/runtime#138181 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CO spearhead is too loudĐang mởS: Untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 2 ngày