Add a built-in detection or safeguard for infinite or excessive render loops in Blazor (particularly for Blazor Server). #59875
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Answered
Resolved because the question asked by the original author has been answered.
question
Status: Resolved
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
We're running into some challenges with rerendering loops. We have a rather complex use-case that we're building in Blazor SSR. Because the complexity, we've seen that some code paths could lead to infinite render loops because a StateHasChanged triggers itself via various ways (could be via other components)
We'd like a built-in detection or safeguard for infinite or excessive render loops in Blazor (particularly for Blazor Server)
In Blazor Server all connected clients can be affected by a single resource-usage spike on the server. Catching these problematic patterns early can save significant time in debugging and costly crashes in production environments. We've seen this happen multiple times over the months
Describe the solution you'd like
Proposal:
Additional context
Once we are running into a scenario where all server resources are being depleted by a render loop, we usually take a memory dump. Upon inspecting the memory dump we see objects like
RenderTreeDiff
andRenderTreeFrame
. These lists can build up to multiple gigabytes memoryExample:
Problem Context:
The text was updated successfully, but these errors were encountered: