Skip to content

Conversation

@jasongin
Copy link
Member

Fixes: #447

When multiple worker threads (or main + worker) attempt to resolve the same dependency assembly, loads failed after the first one. The bug was caused by a duplicate-key exception trying to update the internal dictionary that tracks loaded assemblies:

_loadedAssembliesByPath.Add(assemblyFilePath, assembly);

The fix skips loading the requested assembly if it is already in that dictionary, and also switches to ConcurrentDictionary in case multiple threads access it simultaneously.

@jasongin jasongin merged commit 437b69f into main Jun 26, 2025
15 of 16 checks passed
@jasongin jasongin deleted the dev/jasongin/worker-assembly-load branch June 26, 2025 01:17
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.

Node workers + Microsoft assembly loading failure

3 participants