Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

LayoutAreaHost disposal registry mutated while DisposeExistingAreas enumerates it, failing an Overview re-render

Open
#6,975 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start with src/MeshWeaver.Layout/Composition/LayoutAreaHost.cs, especially DisposeExistingAreas, RenderArea, and the disposal registry's RegisterForDisposal and teardown call sites; then review ContainerControl.cs and PR #5952, #5946, and issue #606 for lifecycle context. Trace whether disposal callbacks or concurrent renders mutate the registry during enumeration. Done means identifying the mutation path and adding a regression test that reproduces the failure.

Written by the indexing model from the issue text.

Description

bug sev:M

Observed

A render of the Overview layout area on the memex-cloud namespace failed with System.InvalidOperationException: Collection was modified; enumeration operation may not execute. thrown from List<T>.ForEach inside MeshWeaver.Layout.Composition.LayoutAreaHost.DisposeExistingAreas(EntityStore store, RenderingContext context) (src/MeshWeaver.Layout/Composition/LayoutAreaHost.cs:1664). Per the stack, this happened during LayoutAreaHost.RenderArea(RenderingContext, IObservable<UiControl?>, EntityStore) (LayoutAreaHost.cs:1959), reached through ContainerControl<T>.WithView/Render aggregation (ContainerControl.cs:199, :356) and a second RenderArea overload (LayoutAreaHost.cs:922). DisposeExistingAreas runs on a re-render, when previously rendered areas are torn down before the new pass — so the host's disposal registry was mutated while DisposeExistingAreas was enumerating it.

Where and when

One occurrence, ever, on one pod (memex-portal-deployment-684b7f8bbb-v6dg5), at a single instant (2026-10-18T20:26:48Z). A single burst, not a steady rate; no correlation with a roll or restart was read. Timing context worth knowing: the default node page (Overview/Data/Edit) was rebuilt by PR Systemorph/MeshWeaver#5952 ("the default node page is a template", merged 2026-10-02; pod rolls replace activations). That PR moved this area's node-content mirror from a per-render ReplaceDisposable under a synthetic key to NodePageProjections.MirrorContent, registered via host.RegisterForDisposal(context.Area, subscription) in the control's buildup — i.e. keys under the area name that DisposeExistingAreas/DisposeChildAreas reap by prefix. The pre-#5952 code carried an explicit warning that RegisterForDisposal re-registration per render was the #606 accumulation bug, and that teardown only removes keys starting with the area name.

Impact

One failed render of one hub's Overview area — the default node page for that viewer at that instant. Judged from the numbers (1 occurrence, 1 pod), this is not an outage; it is a defect signal on a primary rendering path. Whether the client recovered on a subsequent render is not established.

Not established

  • The cause. Nothing on the incident says which code mutated the list during the ForEach.
  • Whether the failing hub was serving the post-#5952 page shape (the pod's build/image date against the 2026-10-02 merge and its roll was not read).
  • Which node/viewer triggered the render — the fingerprinted sample masks the node path and the line is truncated before it.
  • Whether it still occurs, or whether other areas show the same failure.

Candidate causes and the reading that separates them

  1. Reentrant mutation from a dispose callback. A disposable registered under an area key, disposed inside DisposeExistingAreas' ForEach, synchronously triggers work that registers or removes an entry on the same list (e.g. a mirror/Bind subscription's teardown or a final emission causing a nested render or data update on the same host). Predicts: failure only during re-renders that tear down an already-rendered area; reproducible by racing a node edit with a re-render of the Overview area. Discriminating reading: instrument or review the register/remove call sites for the disposal registry inside dispose paths — does any callback reached from ForEach re-enter RegisterForDisposal or area teardown on the same host?
  2. Concurrent render mutating the registry. A second render pass (e.g. a nested embedded area, or a delivery on another scheduler) adds/removes entries while DisposeExistingAreas enumerates on the first thread. Predicts: recurrence spread across pods under load, and two interleaved render logs around the same instant. Discriminating reading: thread ids and surrounding render/teardown log lines for the same hub at the same timestamp; whether nested-area renders run concurrently on one LayoutAreaHost.
  3. Interaction with the #5952 registration model. MirrorContent/Template Bind register in the control buildup; if a buildup can run per emission rather than once per rendered area, a registration can land while a disposal pass is enumerating — the shape the pre-#5952 ReplaceDisposable guard (issue #606) was written against. Predicts: only on builds rolled after 2026-10-02, only on node-hub pages with bound content (Overview/Data/Edit/NodeContentForm). Discriminating reading: the pod's build/image timestamp, and whether the failing hub's page used the bound templates (a node hub with a configured content type on the current build).

Where to look

src/MeshWeaver.Layout/Composition/LayoutAreaHost.cs — DisposeExistingAreas (line 1664 per the stack) and the RenderArea overloads (lines 922, 1959); src/MeshWeaver.Layout/ContainerControl.cs lines 199 and 356; the area-keyed disposal registry (RegisterForDisposal and the key-prefix teardown it feeds). For the changed lifecycle around it: PR Systemorph/MeshWeaver#5952 (Hosting/Triage/pull-request/systemorph-meshweaver-5952 in this mesh), its part 1 #5946, and issue #606; area model documented at Doc/GUI/LayoutAreas.

Not a duplicate: no existing incident or issue carries this fingerprint; the other LayoutAreaHost "Rendering failed" incidents in Admin/_LogIncident are distinct shapes (ObjectDisposedException, TaskCanceledException, ArgumentException, TypeLoadException).


Evidence
Fingerprint b06b203fb4bf76c6
Category MeshWeaver.Layout.Composition.LayoutAreaHost
Severity Error
Exception System.InvalidOperationException
Top frame MeshWeaver.Layout.Composition.LayoutAreaHost.DisposeExistingAreas(EntityStore store, RenderingContext context)
Namespace memex-cloud
Pods memex-portal-deployment-684b7f8bbb-v6dg5
Occurrences 1
First seen 2026-10-18 20:26:48Z
Last seen 2026-10-18 20:26:48Z
Routing not determined — no configured route matches the category MeshWeaver.Layout.Composition.LayoutAreaHost. This repository is the configured fallback, not a finding about who owns the fault; the category names the LOGGER, which may not be the subject.
Recent log lines
2026-10-18 20:26:48Z memex-portal-deployment-684b7f8bbb-v6dg5 fail: MeshWeaver.Layout.Composition.LayoutAreaHost[0]
      Rendering failed for area Overview
      System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
         at System.Collections.Generic.List`1.ForEach(Action`1 action)
         at MeshWeaver.Layout.Composition.LayoutAreaHost.DisposeExistingAreas(EntityStore store, RenderingContext context) in /home/runner/work/MeshWeaver/MeshWeaver/src/MeshWeaver.Layout/Composition/LayoutAreaHost.cs:line 1664
         at MeshWeaver.Layout.Composition.LayoutAreaHost.RenderArea(RenderingContext context, IObservable`1 generator, EntityStore store) in /home/runner/work/MeshWeaver/MeshWeaver/src/MeshWeaver.Layout/Composition/LayoutAreaHost.cs:line 1959
         at MeshWeaver.Layout.ContainerControl`1.<>c__DisplayClass33_0.<WithView>b__0(LayoutAreaHost host, RenderingContext context, EntityStore store) in /home/runner/work/MeshWeaver/MeshWeaver/src/MeshWeaver.Layout/ContainerControl.cs:line 199
         at MeshWeaver.Layout.ContainerControl`1.<>c__DisplayClass51_0.<Render>b__0(EntityStoreAndUpdates acc, Renderer r) in /home/runner/work/MeshWeaver/MeshWeaver/src/MeshWeaver.Layout/ContainerControl.cs:line 356
         at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
         at MeshWeaver.Layout.Composition.LayoutAreaHost.RenderArea(RenderingContext context, Object view, EntityStore store) in /home/runner/work/MeshWeaver/MeshWeaver/src/MeshWeaver.Layout/Composition/LayoutAreaHost.cs:line 922
         at MeshWeaver.Layout.ContainerControl`1.<>c__DisplayClass51_0.<Render>b__0(EntityStoreAndUpdates acc, Renderer r) in /home/runner/work/MeshWeaver/MeshWeaver/src/MeshWeaver.Layout/ContainerControl.cs:line 356
         at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
         at MeshWeaver.Layout.Composition.LayoutAreaHost.RenderArea(RenderingContext context, Object view, Enti…[truncated]

Opened automatically from Admin/_LogIncident/b06b203fb4bf76c6. Recurrences are folded into this issue rather than opening new ones.
It also stands for the whole log site 96bbc97baba7b520: other fingerprints of this site fold in here as comments rather than opening tickets of their own.

Dominant language
C#
Stars
12
Forks
5
Avg merge
5h 55m
Merged PRs (30d)
968

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Systemorph/MeshWeaver

All issues in Systemorph/MeshWeaver

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.