Belemetry: closing a circuit while BelemetryJsBridge starts throws ObjectDisposedException
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
src/Utilities/Belemetry/Bit.Belemetry/Interop/BelemetryJsBridge.cs を開き、StartAsync を DisposeAsync と併せて読んでください。ロックは StartAsync の先頭で取得され、import、start、attachDotNet、SynchronizeAsync の間保持され、finally で解放され、DisposeAsync の最後で破棄されます。issue が提案する 2 つの修正のうち 1 つを選んでください — _startLock の破棄をやめる、または Release() を _disposed フラグでガードする — そして既存のキャンセル処理をそのまま維持してください。完了とは、起動途中で閉じる Blazor Server ページが StartAsync から ObjectDisposedException をログに出さなくなることを意味します。
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- C#
- スター
- 1.4k
- フォーク
- 264
- 平均マージ
- 8時間 5分
- マージ済み PR(30日)
- 595
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bitfoundation/bitplatform のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
bitfoundation/bitplatform#15051 ·
メンテナーはふだん 1 日以内に返信
-
bit Boilerplate and bit CLI move to bitfoundation/bitfabric対応中かも @yasmoradi が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
bitfoundation/bitplatform#15454 ·
メンテナーはふだん 1 日以内に返信
-
More text positions and per-text styling to the bar texts of BitResourceTimeline対応中かも @msynk が 1 日前に担当しました。 オープンarea / BlazorUI
bitfoundation/bitplatform#15441 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Deprecated and obsolete SCSS features used in BlazorUI projects対応中かも @msynk が 2 日前に担当しました。 オープンarea / BlazorUI
bitfoundation/bitplatform#15433 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
`Bit.BlazorUI.Icons`: GitHub and WhatsApp brand glyphs対応中かも @msynk が 4 日前に担当しました。 オープンarea / BlazorUI
bitfoundation/bitplatform#15400 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
bitfoundation/bitplatform の issue をすべて見る
似ている issue
-
area-CodeGen-coreclr untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
dotnet/runtime#138181 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
needs-area-label
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
area:identity type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
valkey-io/valkey-glide#7849 ·
メンテナーはふだん 1 日以内に返信
-
area-Asset area-GameStudio area-Samples bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信