Belemetry: closing a circuit while BelemetryJsBridge starts throws ObjectDisposedException
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Abre src/Utilities/Belemetry/Bit.Belemetry/Interop/BelemetryJsBridge.cs y lee StartAsync junto con DisposeAsync: el bloqueo se adquiere al inicio de StartAsync, se mantiene durante import, start, attachDotNet y SynchronizeAsync, se libera en finally y se descarta al final de DisposeAsync. Elige una de las dos correcciones que propone el issue —dejar de descartar _startLock o proteger Release() con el flag _disposed— y mantén intacto el manejo de cancelación existente. Hecho significa que una página de Blazor Server que se cierra a mitad del inicio ya no registra ObjectDisposedException desde StartAsync.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- C#
- Estrellas
- 1.4k
- Forks
- 264
- Merge medio
- 8 h 5 min
- PR fusionados (30 d)
- 595
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bitfoundation/bitplatform
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
bitfoundation/bitplatform#15051 ·
Los mantenedores suelen responder en 1 día
-
bit Boilerplate and bit CLI move to bitfoundation/bitfabricPosiblemente ocupada @yasmoradi la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
bitfoundation/bitplatform#15454 ·
Los mantenedores suelen responder en 1 día
-
More text positions and per-text styling to the bar texts of BitResourceTimelinePosiblemente ocupada @msynk la tomó hace 1 día. Abiertoarea / BlazorUI
bitfoundation/bitplatform#15441 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Deprecated and obsolete SCSS features used in BlazorUI projectsPosiblemente ocupada @msynk la tomó hace 2 días. Abiertoarea / BlazorUI
bitfoundation/bitplatform#15433 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
`Bit.BlazorUI.Icons`: GitHub and WhatsApp brand glyphsPosiblemente ocupada @msynk la tomó hace 4 días. Abiertoarea / BlazorUI
bitfoundation/bitplatform#15400 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de bitfoundation/bitplatform
Issues similares
-
area-CodeGen-coreclr untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
dotnet/runtime#138181 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
needs-area-label
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
area:identity type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
bug 🐞
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
valkey-io/valkey-glide#7849 ·
Los mantenedores suelen responder en 1 día
-
area-Asset area-GameStudio area-Samples bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día