fix(runtime-core): dedupe concurrent Module.init() calls#4380
Merged
ScriptedAlchemy merged 5 commits intomainfrom Feb 8, 2026
Merged
fix(runtime-core): dedupe concurrent Module.init() calls#4380ScriptedAlchemy merged 5 commits intomainfrom
ScriptedAlchemy merged 5 commits intomainfrom
Conversation
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
🦋 Changeset detectedLatest commit: 0bfd992 The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
Bundle Size Report2 package(s) changed, 34 unchanged.
Total dist: 4.95 MB (+1.1 kB (+0.0%)) |
2heal1
approved these changes
Feb 8, 2026
…0-4bc1 # Conflicts: # .github/workflows/actionlint.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses the issue of
Module.init()being called multiple times concurrently, which could lead to redundant or problematic re-initialization of remote modules.The changes introduce a mechanism to deduplicate concurrent
Module.init()calls by utilizing a shared in-flight promise. This ensures that the remote module's initialization logic (includinginitContainerandbeforeInitContainerhooks) is executed only once, even wheninit()is invoked simultaneously. Proper cleanup ofinitingandinitPromiseis also ensured after the initialization completes.A new regression test has been added to verify this behavior, asserting that concurrent
init()calls result in a single execution of the underlying initialization logic and leave the module in a stable, initialized state.Related Issue
#4330
Types of changes
Checklist