Repository navigation
An item reached by several forEnv() calls at once is resolved once per caller - #1288
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Important
Promise sharing introduces a self-wait deadlock during current-env resolution. This needs addressing before merging.
Reviewed changes: Reviewed the concurrent item-resolution fix and its regression coverage.
- Shared resolution: Concurrent non-reset
ConfigItem.resolve()callers share one pending run, with cleanup after settlement. - Regression coverage: Two tests cover duplicate execution and warnings from parallel
forEnv()calls, accompanied by avarlockpatch entry.
gpt-6.1-sol | 𝕏
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: Reviewed the reentrant-resolution fix since the previous review.
- Preserved reentrant progress: Added async call-chain tracking so an item's own nested resolution bypasses promise sharing without blocking independent callers.
- Added deadlock coverage: Tested
forEnv()on both the current-env item and its value dependency. All 1,204 env-graph tests passed.
gpt-6.1-sol | 𝕏
…) calls With a schema error anywhere, finishLoad does not resolve the root decorators, so the current-env item is first resolved through forEnv(). Every forEnv item resolving in parallel called earlyResolve on it, each passed the isResolved check before any had finished, and each ran the item's resolver and appended its own validation warnings.
Sharing the in-flight promise also caught reentrant calls: with @required=forEnv(prod) on the @currentEnv item (or on an item it is built from), the item's metadata asks for the current env, which resolves that same item and then waited on its own run forever. A call made from inside the item's own run now runs the resolution body directly, as before this change. Calls from other items still share one run.
theoephraim
force-pushed
the
fix-concurrent-item-resolve
branch
from
November 13, 2026 00:47
d0450bf to
8f93283
Compare
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.

cause: with a schema error,
finishLoaddoesn't resolve the root decorators, soAPP_ENVis first resolved throughforEnv(). everyforEnvitem runs in parallel, each callsearlyResolveonAPP_ENV, and each gets past theisResolvedcheck before any of them has finished. each one runs the resolver and appends its own validation warnings.fix: concurrent
ConfigItem.resolve()calls share one in-flight promise.a call from inside the item's own resolution is the exception and goes straight through, as it did before. otherwise this hangs, which the first version of this PR did (caught in review):
context: found while prototyping a language server (#469), which resolves a schema while it still has errors. the CLI stops on schema errors before it resolves anything, so no CLI user sees this.
test:
concurrent-resolve.test.ts. the two sharing cases fail on main, and the two self-reference cases guard the hang above.