Skip to content

Fix duplicate module IDs in error events - #395

Open
niemyjski wants to merge 11 commits into
mainfrom
feature/fix-duplicate-module-ids
Open

niemyjski wants to merge 11 commits into
mainfrom
feature/fix-duplicate-module-ids

Conversation

@niemyjski

@niemyjski niemyjski commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Loading the same DLL twice could give both modules one ID and leave nested frames unresolved. Each error now assigns its own module IDs and matches frames to the assembly instance that produced them. Repeated loads can reuse file metadata at any module position.

All six CI checks passed on 2bdfbeb. Locally, 159 error-plugin and serializer tests passed with 12 existing skips. Windows .NET 10 and .NET Framework results

With 1,536 distinct modules, warm conversion took 3.71 ms versus 1.68 ms on main. The cache holds 1,024 file paths. As on main, simultaneous submissions of the same exception instance can still produce multiple events.

Verification and implementation details

Module and cache ownership

An ID is the module’s one-based position in the current error. The root error builds the assembly list once and shares it with inner errors, stack frames and Framework target methods. Filtered frames keep the existing -1 sentinel. The assembly references go out of scope after conversion. Frame mapping

The shared cache stores read-only strings, timestamps and the manifest module version ID. A matching path and version ID skip version-attribute reflection and timestamp I/O. Every module position can use a cache hit or a free slot. Once full, the cache allows FIFO eviction only for the first 1,024 emitted positions so one large capture cannot evict its entire working set. Cache writes and eviction share a lock. Each event receives a new module and data dictionary. Metadata reader · Event module construction

If a DLL repeats a version attribute, the SDK uses the first value reflection returns for that kind. The display version still prefers informational, then file, then assembly identity. A malformed module is isolated so other modules and frames can still be captured. Version readers

Local synthetic verification

  • Loaded 128 newly emitted DLLs into 12 contexts, warmed the cache, changed only their timestamps, and round-tripped an error through the SDK plugin and JSON serializer. The preceding PR revision reread 517 of the 1,536 fixture records. This revision reread zero. All fixture IDs were distinct and all 32 fixture frames resolved. The committed one-slot regression exercises cache admission and hits with eviction disabled. Regression
  • Generated 1,280 modules across 40 collectible contexts. All 40 unloaded with 320 mutated, JSON-checked events still alive and 3,960 additional captures during load and unload. The cache peaked at 1,024 entries and its eviction queue matched its keys. Eight concurrent errors with malformed inner metadata retained their healthy outer frame. Test events stayed local.
  • Windows passed 305 SDK tests on .NET 10 and 293 on .NET Framework 4.7.2, with 17 existing skips on each. Eight synchronized callers sharing one synthetic exception produced eight events, all with unique module IDs.

Warm conversion and retained memory

Emitted modules Main Previous PR This revision
256 distinct 0.306 ms 0.208 ms 0.198 ms
768 distinct 0.912 ms 0.647 ms 0.567 ms
1,536 distinct 1.682 ms 3.581 ms 3.706 ms
1,536 repeated loads of 128 files, plus 6 harness modules — 2.998 ms 1.278 ms

Release on macOS arm64 and .NET 10.0.14. Each cell is the median of five fresh processes per revision, with rotated order, 150 warm-ups and seven timed batches of 200 local conversions. Each process generated its own DLLs.

A diagnostic build measured which managed objects became collectible after releasing the cache, once the fixture load context had unloaded. Median exclusive retention across five fresh processes was 515,000 bytes for 768 entries and 660,408 bytes for 1,024 entries. With 1,536 modules emitted it retained 1,024 entries and 660,160 bytes. Path lengths, metadata and runtime storage affect these totals.

dotnet test test/Exceptionless.Tests/Exceptionless.Tests.csproj -c Release --filter 'FullyQualifiedName~Exceptionless.Tests.Plugins.ErrorPluginTests|FullyQualifiedName~Exceptionless.Tests.Serializer'

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T18:12:51.662523Z 2bdfbeb New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0f76250858

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@niemyjski niemyjski self-assigned this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant