Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe resolver tracks peer await edges across traversal calls, detects cross-call cycles, and resolves affected dependency paths. Rust and TypeScript regression tests cover pruned and hoisted peer-provider cycles, with a patch changeset for pnpm and the resolver package. ChangesPeer cycle resolution
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant resolvePeers
participant resolvePeersOfChildren
participant calculateDepPath
participant pathsByNodeIdPromises
resolvePeers->>resolvePeersOfChildren: share cycle-tracking state
resolvePeersOfChildren->>calculateDepPath: calculate peer dep paths
calculateDepPath->>pathsByNodeIdPromises: record pending await edges
resolvePeers->>resolvePeers: detect cross-call cycles
resolvePeers->>pathsByNodeIdPromises: resolve cycle paths
Assessment against linked issues
Possibly related PRs
Suggested labels: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoFix peer dep-path deadlocks by breaking cross-pass await cycles
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1. Comment describes past deadlock
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
Micro-Benchmark ResultsLinux |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12927 +/- ##
=======================================
Coverage 85.45% 85.45%
=======================================
Files 474 474
Lines 74561 74561
=======================================
+ Hits 63714 63716 +2
+ Misses 10847 10845 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Benchmark Results
Run 29131718681 · 10 runs per scenario · triggered by @zkochan |
…passes The dep path of a package with peer dependencies is computed after the dep paths of its peers, and peer cycles are broken by collapsing the suffix to name@version. That cycle detection only sees the children of a single resolvePeersOfChildren call, and since hoisted peer providers stopped being walked in the root context (commit fecfe83), a peer cycle between a project's own dependency and a hoisted provider - or a provider resolved at its true tree position - spans two calls, so the dep path calculations awaited each other's promise forever and pnpm install hung, e.g. with [email protected]. Record which dep path promise each calculation awaits (borrowing the cache owner's edges for peers-cache hits) and, after the traversal, resolve every promise on a remaining await cycle to name@version - the same collapse in-call cycle detection applies. Installs that resolved before are untouched: the breaker only fires on await graphs that could never settle. pacquet's synchronous walker already detects these cycles globally and needs no code change; mirrored tests in both stacks pin the same dep paths, and the electron-builder repro now produces byte-identical lockfiles across the two implementations. Fixes #12921 Co-Authored-By: Claude Fable 5 <[email protected]>
|
Code review by qodo was updated up to the latest commit edb50d2 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.087596549020001,
"stddev": 0.15042443732361643,
"median": 4.0957265971200005,
"user": 3.8821610399999997,
"system": 3.3910047,
"min": 3.84161512462,
"max": 4.32488354962,
"times": [
4.19797220562,
4.32488354962,
4.04017091662,
4.031039879620001,
4.13323804862,
4.10169279562,
3.84161512462,
4.238271135620001,
3.87732143562,
4.08976039862
]
},
{
"command": "pacquet@main",
"mean": 4.073753952820001,
"stddev": 0.12181172175088471,
"median": 4.03294945712,
"user": 3.86278104,
"system": 3.400240299999999,
"min": 3.93564846962,
"max": 4.2940302176200005,
"times": [
4.191476633620001,
4.03764597162,
4.2283881796200005,
4.2940302176200005,
4.02825294262,
3.93564846962,
3.96312149562,
3.99350253062,
3.9955955036199997,
4.06987758362
]
},
{
"command": "pnpr@HEAD",
"mean": 2.21696933082,
"stddev": 0.1353207713902677,
"median": 2.2489462096199997,
"user": 2.76480674,
"system": 2.9406299999999996,
"min": 1.99601774262,
"max": 2.40568997262,
"times": [
2.40568997262,
2.2677830586199996,
1.99601774262,
2.1001789716199997,
2.3542074436199996,
2.24910405762,
2.33966968862,
2.14118603362,
2.24878836162,
2.06706797762
]
},
{
"command": "pnpr@main",
"mean": 2.14836242142,
"stddev": 0.11133834350221815,
"median": 2.15326283962,
"user": 2.75044934,
"system": 2.9324688999999995,
"min": 1.9924898206200001,
"max": 2.3323326076199997,
"times": [
2.18217575062,
2.3323326076199997,
2.03272505562,
2.1984946266199996,
2.1243499286199996,
2.1040008006199997,
2.28756839762,
2.0365999686199996,
1.9924898206200001,
2.19288725762
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.66537285286,
"stddev": 0.009779385061293862,
"median": 0.6655426763600001,
"user": 0.3911108200000001,
"system": 1.33326986,
"min": 0.6478571228600001,
"max": 0.6781822698600001,
"times": [
0.66439645486,
0.67321331886,
0.6559408518600001,
0.6592813228600001,
0.6666888978600001,
0.6603840628600001,
0.6700467168600001,
0.6781822698600001,
0.6478571228600001,
0.67773750986
]
},
{
"command": "pacquet@main",
"mean": 0.67669343786,
"stddev": 0.06657229169845558,
"median": 0.65117591086,
"user": 0.38532352,
"system": 1.3392332599999999,
"min": 0.6393257788600001,
"max": 0.85779590386,
"times": [
0.6516344728600001,
0.64503915986,
0.64624428986,
0.6470244848600001,
0.65071734886,
0.6393257788600001,
0.6572470098600001,
0.85779590386,
0.7086536718600001,
0.6632522578600001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.7096793802600001,
"stddev": 0.017484533289625532,
"median": 0.70874042536,
"user": 0.40085061999999994,
"system": 1.3713090600000002,
"min": 0.6887428898600001,
"max": 0.74460043586,
"times": [
0.69998176286,
0.6887428898600001,
0.7128880698600001,
0.72660145586,
0.70907822286,
0.69013508186,
0.74460043586,
0.7207197628600001,
0.69564349286,
0.7084026278600001
]
},
{
"command": "pnpr@main",
"mean": 0.72074300706,
"stddev": 0.048362087446246635,
"median": 0.7116080923600001,
"user": 0.40017552,
"system": 1.3716034599999998,
"min": 0.68981020686,
"max": 0.8519112398600001,
"times": [
0.69074834886,
0.71837318386,
0.7048430008600001,
0.72124466486,
0.72472453386,
0.68981020686,
0.69321728386,
0.7226766438600001,
0.8519112398600001,
0.6898809638600001
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.269403645540001,
"stddev": 0.03724113553815596,
"median": 4.2645043654400006,
"user": 3.8420495199999998,
"system": 3.3259269199999997,
"min": 4.21207693544,
"max": 4.33061420344,
"times": [
4.32578085544,
4.27591248544,
4.25546874344,
4.25988600344,
4.26912272744,
4.2576602134399995,
4.21207693544,
4.27940768544,
4.33061420344,
4.22810660244
]
},
{
"command": "pacquet@main",
"mean": 4.286475916239999,
"stddev": 0.04911525367072736,
"median": 4.281647168939999,
"user": 3.8445148199999997,
"system": 3.31064122,
"min": 4.214322731439999,
"max": 4.39217338744,
"times": [
4.2800042204399995,
4.25668329844,
4.291261320439999,
4.214322731439999,
4.299559341439999,
4.28329011744,
4.27640616544,
4.39217338744,
4.330783214439999,
4.24027536544
]
},
{
"command": "pnpr@HEAD",
"mean": 2.1642876911399997,
"stddev": 0.11180186798735738,
"median": 2.12703795794,
"user": 2.5740595199999996,
"system": 2.8548162199999996,
"min": 2.0445956724400003,
"max": 2.3793663894400003,
"times": [
2.3793663894400003,
2.12413474444,
2.11999665744,
2.0544539964400004,
2.24547770744,
2.0445956724400003,
2.31467544744,
2.12994117144,
2.1380426094400002,
2.0921925154400003
]
},
{
"command": "pnpr@main",
"mean": 2.1631377784400003,
"stddev": 0.11800482251635784,
"median": 2.1565955909400003,
"user": 2.56427792,
"system": 2.8399040199999996,
"min": 1.99950451444,
"max": 2.3557341324400003,
"times": [
2.2130827014400003,
2.10428661644,
2.3557341324400003,
2.31954715044,
1.99950451444,
2.07518491244,
2.03594786744,
2.1099189264400002,
2.21489870744,
2.2032722554400004
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.3980166431800003,
"stddev": 0.016227439877742188,
"median": 1.40081689788,
"user": 1.3421503000000001,
"system": 1.71770876,
"min": 1.3692218813800001,
"max": 1.4256402483800001,
"times": [
1.39408214838,
1.38685310138,
1.4023711283800002,
1.40164407238,
1.4152468023800002,
1.38148637438,
1.4256402483800001,
1.39998972338,
1.3692218813800001,
1.40363095138
]
},
{
"command": "pacquet@main",
"mean": 1.42352474098,
"stddev": 0.046058913894797264,
"median": 1.4191359243800001,
"user": 1.3393441,
"system": 1.7695483600000004,
"min": 1.3722731353800002,
"max": 1.53193298238,
"times": [
1.3722731353800002,
1.53193298238,
1.4415630693800001,
1.4219213963800001,
1.4133555503800002,
1.4163504523800001,
1.42484236338,
1.38989468038,
1.37406204238,
1.44905173738
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6879912225800001,
"stddev": 0.05025094331661332,
"median": 0.6759349288800001,
"user": 0.34637290000000004,
"system": 1.28520586,
"min": 0.65630065338,
"max": 0.82933515838,
"times": [
0.6729902223800001,
0.6775115163800001,
0.66260721138,
0.82933515838,
0.67519284138,
0.67667701638,
0.66952768538,
0.67930268138,
0.68046723938,
0.65630065338
]
},
{
"command": "pnpr@main",
"mean": 0.67158373198,
"stddev": 0.012968547102834616,
"median": 0.67083116588,
"user": 0.3346862,
"system": 1.29409536,
"min": 0.65507847638,
"max": 0.7022841493800001,
"times": [
0.67091942938,
0.6599131593800001,
0.68145943738,
0.65507847638,
0.67159491438,
0.66416093838,
0.7022841493800001,
0.6686877973800001,
0.67074290238,
0.67099611538
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.14831757982,
"stddev": 0.06534447002694702,
"median": 3.13757951732,
"user": 1.8287088399999998,
"system": 2.0303002,
"min": 3.08383729782,
"max": 3.31807903282,
"times": [
3.13089867782,
3.13685853882,
3.10086264682,
3.10211955282,
3.08383729782,
3.14825418782,
3.15310383482,
3.1383004958200003,
3.31807903282,
3.17086153282
]
},
{
"command": "pacquet@main",
"mean": 3.19751572912,
"stddev": 0.031192512825143626,
"median": 3.19674528482,
"user": 1.8591214399999996,
"system": 2.0786018,
"min": 3.15448572682,
"max": 3.24579840082,
"times": [
3.23115957282,
3.22723017082,
3.20098554482,
3.19250502482,
3.15448572682,
3.17416338782,
3.15931995382,
3.21060499282,
3.24579840082,
3.17890451582
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6726359952200001,
"stddev": 0.0054412366304333985,
"median": 0.6714755923200001,
"user": 0.34518304000000005,
"system": 1.271722,
"min": 0.6672877688200001,
"max": 0.68409476282,
"times": [
0.6685798098200001,
0.6760539438200001,
0.66773293182,
0.68409476282,
0.6768795668200001,
0.66894003982,
0.6743663578200001,
0.6672877688200001,
0.6684136258200001,
0.6740111448200001
]
},
{
"command": "pnpr@main",
"mean": 0.67397233222,
"stddev": 0.026641330733031304,
"median": 0.6680355948200001,
"user": 0.34283133999999993,
"system": 1.2789886000000004,
"min": 0.64816738382,
"max": 0.7437146808200001,
"times": [
0.6577849828200001,
0.64816738382,
0.6754600818200001,
0.6824196488200001,
0.66827309982,
0.65810233382,
0.6677980898200001,
0.7437146808200001,
0.6776754838200001,
0.6603275368200001
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6558576274200001,
"stddev": 0.007129882177683561,
"median": 0.65632884452,
"user": 0.6126677,
"system": 0.15342135999999998,
"min": 0.64506501902,
"max": 0.6663595800200001,
"times": [
0.6620156500200001,
0.6620895290200001,
0.65957975502,
0.65251833002,
0.64889687902,
0.64506501902,
0.66036240702,
0.6663595800200001,
0.6486111910200001,
0.65307793402
]
},
{
"command": "pacquet@main",
"mean": 0.65588681762,
"stddev": 0.00682307193302192,
"median": 0.65584492002,
"user": 0.6167014,
"system": 0.15017735999999998,
"min": 0.64185181902,
"max": 0.66848630202,
"times": [
0.64185181902,
0.65478872802,
0.6591531270200001,
0.66848630202,
0.6514793520200001,
0.65690111202,
0.66058419802,
0.6574000720200001,
0.6537413910200001,
0.65448207502
]
},
{
"command": "pnpr@HEAD",
"mean": 0.11226795533999999,
"stddev": 0.0005352366676887523,
"median": 0.11229963402000001,
"user": 0.028619379999999993,
"system": 0.021536239999999998,
"min": 0.11014882802000002,
"max": 0.11334191802000002,
"times": [
0.11014882802000002,
0.11236325702000001,
0.11194522202000001,
0.11223196402000002,
0.11284761102000002,
0.11192215202000001,
0.11224841802000002,
0.11229963402000001,
0.11236363802000002,
0.11224373102000001,
0.11217817402000001,
0.11222202002000001,
0.11254236502000002,
0.11254355202000002,
0.11200013202000002,
0.11211698902000002,
0.11251257302000002,
0.11236890602000002,
0.11230626402000002,
0.11240789302000001,
0.11212544702000002,
0.11229424502000002,
0.11232828602000001,
0.11334191802000002,
0.11279566402000002
]
},
{
"command": "pnpr@main",
"mean": 0.11232879547833334,
"stddev": 0.0003515503600512628,
"median": 0.11236729352000002,
"user": 0.02841275833333334,
"system": 0.02163571,
"min": 0.11136335502000001,
"max": 0.11302561202000001,
"times": [
0.11136335502000001,
0.11239711702000002,
0.11211560302000001,
0.11240191402000001,
0.11216566702000001,
0.11258150802000001,
0.11237305202000002,
0.11192278902000001,
0.11274994702000002,
0.11224441302000002,
0.11302561202000001,
0.11199400402000001,
0.11236153502000001,
0.11226089202000002,
0.11261861302000001,
0.11209698602000001,
0.11212199702000002,
0.11244902302000001,
0.11254410902000002,
0.11283684002000001,
0.11185194502000001,
0.11235122002000002,
0.11254604102000001,
0.11251690902000001
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 6.913344263400001,
"stddev": 0.12464101341436151,
"median": 6.8917305736,
"user": 4.1763832,
"system": 3.6554537799999998,
"min": 6.7285616701,
"max": 7.1546174471,
"times": [
6.8798124571,
6.9323496081,
6.9084998501,
7.0848782581,
6.7285616701,
6.8963295521,
6.8611972511,
6.8871315951000005,
7.1546174471,
6.8000649451
]
},
{
"command": "pacquet@main",
"mean": 6.913906572499999,
"stddev": 0.1335755852121497,
"median": 6.9185282736,
"user": 4.1664156,
"system": 3.66518648,
"min": 6.7622787791,
"max": 7.2035698681,
"times": [
6.9371714641,
6.9601504931000004,
6.8111919891,
6.7799494741,
6.8118331751,
6.7622787791,
7.2035698681,
6.8998850831,
7.0125104171,
6.9605249821
]
},
{
"command": "pnpr@HEAD",
"mean": 4.9556658493,
"stddev": 0.11303701993267942,
"median": 4.9539304021,
"user": 2.85737,
"system": 3.1463928799999996,
"min": 4.8257505361,
"max": 5.1704063951,
"times": [
4.9733291711000005,
4.9070076331,
4.8536228281,
4.9624669651,
5.1704063951,
4.9542265681,
4.9536342361,
5.1156802521,
4.8405339081,
4.8257505361
]
},
{
"command": "pnpr@main",
"mean": 4.872215778999999,
"stddev": 0.05512754095054939,
"median": 4.893523285600001,
"user": 2.8453836999999997,
"system": 3.1281055799999997,
"min": 4.7801216091,
"max": 4.9318624961,
"times": [
4.8973580471,
4.9318624961,
4.7801216091,
4.914411003100001,
4.8896885241,
4.8534746771,
4.9154797431,
4.8372483461,
4.9155613701,
4.7869519741
]
}
]
} |
|
| Branch | pr/12927 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 2,164.29 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 672.64 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 687.99 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 112.27 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 2,216.97 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 4,955.67 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 709.68 ms |
|
Sorry! This is related to my last PR. After it released it fixed poisoning in the root, but not in workspaces above root with transitive peers that resolved first. This might only half fix it, too, or at least it might only fix the problem it caused. I am going to branch off from here and check. But you might wait to merge this for a moment. |
|
@zkochan I have opened a PR into this branch with a fix of the original fix that cause the regression in this branch PR addresses. I see why my original PR caused this, but my fix of the fix is not exactly related to the targeted portion. I can pull it out into it's own PR into main if you want. Again, I am very sorry for cause Electron problems. This reminds me of the time I worked at AOL and broke everyone's homescreen world wide by pasting a control character into the CMS. |
|
I moved the PR to be against main as the fix doesn't affect this code either way. |
Summary
Fixes #12921 —
pnpm installdeadlocked on 11.11.0 (e.g. with[email protected]) after #12847 split the root peer-resolution pass into tworesolvePeersOfChildrencalls. Cycle detection only sees the children of a single call, so a peer cycle spanning a project's own dependencies and hoisted peer providers (or a provider resolved at its true tree position) was invisible, and the dep-path deferreds awaited each other forever.The fix records the actual await edges between dep-path calculations — including waits that go through a
peersCachehit, which borrow the cache owner's edges — and, after the traversal and before the finishing promises are awaited, breaks any remaining await cycle by resolving each member's dep-path promise toname@version, the same collapse in-call cycle detection applies. Installs that resolved before are untouched: the breaker only fires on await graphs that could never settle on their own.pacquet's synchronous walker already performs global cycle detection and needs no code change; mirrored Rust tests pin the same dep paths for both scenarios. Verified end-to-end: the
[email protected]repro from the issue now installs in ~6s with the fixed bundle, and the TypeScript CLI and pacquet produce byte-identical lockfiles for it.Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.(pacquet needs no code change — its global cycle detection already handles
these shapes; mirrored tests added to prove parity.)
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-fable-5).
Summary by CodeRabbit
pnpm installcould hang indefinitely due to circular peer-dependency resolution.