Repository navigation
fix: stop a stalled update check from holding an up-to-date install, and trace the fast path - #16902
Conversation
An install that cannot take the pre-runtime fast path spawns the daily update check alongside itself and awaited it before the "Done in" footer. On a registry that accepts the connection and never answers, the registry client's connect and read timeouts (a minute each) became the duration of an install that had nothing else to do, and nothing in the TRACE output said so. pnpm v11 never waits for its check. `update_notifier::settle` now waits at most UPDATE_CHECK_GRACE_PERIOD (one second) for a check that is still running, then aborts it and logs that at debug. Nothing is recorded in that case, so the next command checks again. A check that answered in time still reaches the terminal. Related to #16839. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The `pacquet::install` target printed nothing for an install that took the shortcut, so it could not say where a slow "Already up to date" run spent its time: the only line it could emit was the reason the fast path was skipped. `install_already_up_to_date` now returns the reason the shortcut was not taken instead of `None`, the CLI gate names its own reasons, both fast paths log when they are taken, and the phases that read the project tree or wait on something (config load, workspace project discovery, the repeat-install check, store registration, HTTP client construction, the store lock) run inside debug spans whose close events carry their duration. Related to #16839. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Extract the store lock, the traced verdict, project discovery, and the repeat-install check into helpers so `run.rs`, `RunExecution::run`, and `install_already_up_to_date` stay under the dylint function, file, and binding limits. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Move the traced project discovery out of `run_with_config`, which the span block had pushed past the dylint function limit. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 5
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16902 +/- ##
==========================================
+ Coverage 92.59% 92.61% +0.01%
==========================================
Files 1708 1708
Lines 221550 221682 +132
==========================================
+ Hits 205155 205302 +147
+ Misses 16395 16380 -15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Micro-Benchmark ResultsLinux |
Same-run regression checkHEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval. Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked and injected workspace scenarios compare current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.5575212945,
"stddev": 0.07428718903576612,
"median": 2.5488546129000005,
"user": 1.8344044199999998,
"system": 1.5882584599999998,
"min": 2.4686837489,
"max": 2.6681681009000005
},
{
"command": "pacquet@main",
"mean": 2.5705744135,
"stddev": 0.11467277096454313,
"median": 2.5264783354,
"user": 1.79693772,
"system": 1.68355356,
"min": 2.4664488839,
"max": 2.8166966009000003
},
{
"command": "pnpr@HEAD",
"mean": 1.4391626102,
"stddev": 0.12000294421629741,
"median": 1.4422588583999998,
"user": 1.38404402,
"system": 1.36108046,
"min": 1.2989483549,
"max": 1.6625036399
},
{
"command": "pnpr@main",
"mean": 1.543436533,
"stddev": 0.12907777252632213,
"median": 1.5719457149,
"user": 1.44198212,
"system": 1.37167336,
"min": 1.3298853729,
"max": 1.6936292848999999
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25844438750000004,
"stddev": 0.02584507408734439,
"median": 0.2509378576,
"user": 0.2957797,
"system": 0.6187460999999999,
"min": 0.2299532101,
"max": 0.3155866611
},
{
"command": "pacquet@main",
"mean": 0.2522652137,
"stddev": 0.0055005859293528435,
"median": 0.2511109131,
"user": 0.2858414999999999,
"system": 0.6260256,
"min": 0.2422657731,
"max": 0.2613170331
},
{
"command": "pnpr@HEAD",
"mean": 0.2690531994,
"stddev": 0.008147348165143226,
"median": 0.26783437860000003,
"user": 0.29756119999999997,
"system": 0.624385,
"min": 0.2581260911,
"max": 0.2849895981
},
{
"command": "pnpr@main",
"mean": 0.2792709936,
"stddev": 0.012033707263359422,
"median": 0.2771365736,
"user": 0.3150454,
"system": 0.6155008,
"min": 0.2597866641,
"max": 0.3009532001
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.012681261359814823,
"stddev": 0.0015329181088943118,
"median": 0.01239507342,
"user": 0.00722938574074074,
"system": 0.006726918703703704,
"min": 0.01014394342,
"max": 0.020125792420000004
},
{
"command": "pacquet@main",
"mean": 0.011997593650769226,
"stddev": 0.0016821662817139383,
"median": 0.01159707192,
"user": 0.006814998021978019,
"system": 0.006274567032967033,
"min": 0.00957279942,
"max": 0.021369963420000002
},
{
"command": "pnpr@HEAD",
"mean": 0.012628662925000003,
"stddev": 0.0011697909258966668,
"median": 0.01250691892,
"user": 0.007299855000000003,
"system": 0.006567639100000002,
"min": 0.01057819042,
"max": 0.016234170420000003
},
{
"command": "pnpr@main",
"mean": 0.012352246059484978,
"stddev": 0.002169821946648227,
"median": 0.01163219242,
"user": 0.0068705672103004265,
"system": 0.006593336137339056,
"min": 0.00918010042,
"max": 0.020587373420000003
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.0108509056775862,
"stddev": 0.0015222531786632015,
"median": 0.0105745486,
"user": 0.006329414310344824,
"system": 0.005439854827586209,
"min": 0.007981917100000001,
"max": 0.0157939801
},
{
"command": "pacquet@main",
"mean": 0.0101229671909091,
"stddev": 0.0010522634864127713,
"median": 0.010034080600000002,
"user": 0.006376804628099173,
"system": 0.004598076198347109,
"min": 0.007968222100000002,
"max": 0.012956572100000001
},
{
"command": "pnpr@HEAD",
"mean": 0.009350981173929962,
"stddev": 0.0010116856377413582,
"median": 0.009246485100000002,
"user": 0.005623412295719843,
"system": 0.00451615392996109,
"min": 0.007523296100000001,
"max": 0.012512758100000002
},
{
"command": "pnpr@main",
"mean": 0.009605421659701496,
"stddev": 0.0008256647097213424,
"median": 0.009505348100000002,
"user": 0.005738316716417911,
"system": 0.00470895,
"min": 0.007862644100000002,
"max": 0.0157810131
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.72108057504,
"stddev": 0.10909814158218437,
"median": 2.71640574214,
"user": 2.59139214,
"system": 2.0637727999999997,
"min": 2.5620183001399996,
"max": 2.8982541671399997
},
{
"command": "pacquet@main",
"mean": 2.75769831064,
"stddev": 0.06594766035449728,
"median": 2.7708728096399997,
"user": 2.74933484,
"system": 2.0993235,
"min": 2.64470716814,
"max": 2.8580954841399997
},
{
"command": "pnpr@HEAD",
"mean": 1.73428389774,
"stddev": 0.1133437924003414,
"median": 1.78377488264,
"user": 1.71633374,
"system": 1.7755987999999998,
"min": 1.52596268214,
"max": 1.83416827714
},
{
"command": "pnpr@main",
"mean": 1.71329940264,
"stddev": 0.13947162901494325,
"median": 1.7481032176400002,
"user": 1.75316914,
"system": 1.8276815999999996,
"min": 1.54460694314,
"max": 1.85950759414
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6138982773799999,
"stddev": 0.031314426582672604,
"median": 0.6198176686800001,
"user": 0.86162336,
"system": 1.02452422,
"min": 0.56318213568,
"max": 0.65311704968
},
{
"command": "pacquet@main",
"mean": 0.6366943382800001,
"stddev": 0.04822153674794892,
"median": 0.63862642118,
"user": 0.9520134600000001,
"system": 1.0158755199999998,
"min": 0.54690348668,
"max": 0.68982296068
},
{
"command": "pnpr@HEAD",
"mean": 0.3827127956800001,
"stddev": 0.023208725796531608,
"median": 0.38531765718,
"user": 0.35767545999999995,
"system": 0.75133412,
"min": 0.34276683868,
"max": 0.41766088568000004
},
{
"command": "pnpr@main",
"mean": 0.41869454838,
"stddev": 0.020015862797782395,
"median": 0.42118131818000004,
"user": 0.42417856,
"system": 0.81970882,
"min": 0.38866476868000005,
"max": 0.44546824468
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.72451742978,
"stddev": 0.04010120228734207,
"median": 1.7159690052799998,
"user": 1.19597944,
"system": 1.0400564799999998,
"min": 1.6659121457800001,
"max": 1.81990800978
},
{
"command": "pacquet@main",
"mean": 1.7802899648800001,
"stddev": 0.031776404693903575,
"median": 1.78254413028,
"user": 1.2718009399999999,
"system": 1.1616009799999998,
"min": 1.7280794347800001,
"max": 1.8309247797800001
},
{
"command": "pnpr@HEAD",
"mean": 0.33968500328,
"stddev": 0.012840410558269335,
"median": 0.33847635528000003,
"user": 0.32898694,
"system": 0.65221818,
"min": 0.32146844378,
"max": 0.36242231478000003
},
{
"command": "pnpr@main",
"mean": 0.33072179908000005,
"stddev": 0.0075763232802083256,
"median": 0.33138404928,
"user": 0.30343204,
"system": 0.66719588,
"min": 0.31786762378,
"max": 0.34450094478000004
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2739651836,
"stddev": 0.01448648354584919,
"median": 0.27515676180000004,
"user": 0.26252638000000006,
"system": 0.10512121999999999,
"min": 0.2530868858,
"max": 0.3023999108
},
{
"command": "pacquet@main",
"mean": 0.2650221044363636,
"stddev": 0.014270302780951172,
"median": 0.2632425738,
"user": 0.26108718909090906,
"system": 0.09363135636363636,
"min": 0.24549979480000003,
"max": 0.2948368048
},
{
"command": "pnpr@HEAD",
"mean": 0.10249614012142859,
"stddev": 0.0054933921617569825,
"median": 0.10152731980000002,
"user": 0.04227806571428571,
"system": 0.01841743428571429,
"min": 0.09453807380000001,
"max": 0.11702289080000002
},
{
"command": "pnpr@main",
"mean": 0.10659099383703706,
"stddev": 0.010314861033774108,
"median": 0.10344187480000001,
"user": 0.041128279999999996,
"system": 0.02271205333333333,
"min": 0.0914699828,
"max": 0.13212096480000002
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2628527989044444,
"stddev": 0.009377763815095162,
"median": 0.26101735046,
"user": 0.2842082244444445,
"system": 0.05029883555555555,
"min": 0.24685903946,
"max": 0.27658627646
},
{
"command": "pacquet@main",
"mean": 0.2617914203488889,
"stddev": 0.029929044466221827,
"median": 0.26314571346,
"user": 0.26601955777777775,
"system": 0.05111294666666667,
"min": 0.22527915246,
"max": 0.30802007146
},
{
"command": "pnpm@HEAD",
"mean": 4.64629892346,
"stddev": 0.6311819277146565,
"median": 4.4435093854600005,
"user": 7.128233002222221,
"system": 0.4143499466666667,
"min": 4.08362728146,
"max": 6.10845461346
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.24800441849666666,
"stddev": 0.018668128971133967,
"median": 0.24636567358,
"user": 0.21367059666666666,
"system": 0.08783074333333334,
"min": 0.22686427558,
"max": 0.28752987158000004
},
{
"command": "pacquet@main",
"mean": 0.25639196567090905,
"stddev": 0.01537535839024789,
"median": 0.25935458558,
"user": 0.21080436181818182,
"system": 0.09982034181818182,
"min": 0.23622486458,
"max": 0.29433042858
}
]
}Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.0970075121625,
"stddev": 0.006678531984234323,
"median": 0.09659043310000001,
"user": 0.036795884999999987,
"system": 0.06747951625,
"min": 0.08789334060000001,
"max": 0.11973339960000001
},
{
"command": "pacquet@main",
"mean": 0.09367552842758621,
"stddev": 0.00533272570238023,
"median": 0.0917877936,
"user": 0.035188122068965516,
"system": 0.0660749979310345,
"min": 0.08514008760000001,
"max": 0.1042191046
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.78601252422,
"stddev": 0.18197344230234339,
"median": 4.78705727492,
"user": 2.22298754,
"system": 2.1234101,
"min": 4.54436272092,
"max": 5.07744976592
},
{
"command": "pacquet@main",
"mean": 4.6824553378200005,
"stddev": 0.14047149289998176,
"median": 4.65341682942,
"user": 2.2471650399999996,
"system": 2.1995348,
"min": 4.56616812592,
"max": 5.03985166392
},
{
"command": "pnpr@HEAD",
"mean": 3.67727453902,
"stddev": 0.07519669037737726,
"median": 3.6705945729200002,
"user": 1.96317564,
"system": 1.8992952999999997,
"min": 3.56963378792,
"max": 3.82138703892
},
{
"command": "pnpr@main",
"mean": 3.6293485013200004,
"stddev": 0.06332264110002214,
"median": 3.6358063634200004,
"user": 1.7927419400000002,
"system": 1.9294998999999997,
"min": 3.54262317292,
"max": 3.7477892119200003
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.21354757623666668,
"stddev": 0.019905637306483065,
"median": 0.20820763782,
"user": 0.2549462533333333,
"system": 0.21271495666666665,
"min": 0.19047963532,
"max": 0.25434019832000004
},
{
"command": "pacquet@main",
"mean": 0.19530022908923078,
"stddev": 0.012939191573229461,
"median": 0.19559746532000002,
"user": 0.2335873046153846,
"system": 0.20015604,
"min": 0.17723610532,
"max": 0.21666684132000003
},
{
"command": "pnpr@HEAD",
"mean": 0.23802895613818184,
"stddev": 0.019966052992397773,
"median": 0.24072622132000002,
"user": 0.25418710181818177,
"system": 0.20729094909090906,
"min": 0.20128946332,
"max": 0.26566803532000005
},
{
"command": "pnpr@main",
"mean": 0.21098102755076925,
"stddev": 0.020012129598863355,
"median": 0.21028923532000002,
"user": 0.22495899692307691,
"system": 0.20873203999999998,
"min": 0.17417088732000002,
"max": 0.24896732932
}
]
}Scenario: Store only: unlocked direct deps, cold cache + hot storeStore-only install (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.1532012121400002,
"stddev": 0.021401240264039126,
"median": 1.15567890444,
"user": 0.56991952,
"system": 0.22707546,
"min": 1.12100598344,
"max": 1.1906064644399998
},
{
"command": "pacquet@main",
"mean": 1.25526741964,
"stddev": 0.08452252414284706,
"median": 1.25874899994,
"user": 0.74732502,
"system": 0.28447255999999993,
"min": 1.15170793344,
"max": 1.3677438364399999
}
]
} |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Summary by QodoBound stalled update checks and trace up-to-date installs
AI Description
Diagram
High-Level Assessment
Files changed (15)
|
Code Review by Qodo
1. The slowdown fix lacks before/after data
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
… failure An update check abandoned after the grace period now counts as the day's check, so a registry that keeps stalling costs the grace period once a day rather than on every command. A failed command still records nothing. The GVS build-marker gate of the pre-runtime fast path now reports a wanted lockfile it cannot read as such, rather than as a marker needing recovery. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Thanks, two of these hold and are fixed in 81df72c.
Written by an agent (Claude Code, claude-fable-5-1). |
|
Code review by qodo was updated up to the latest commit 81df72c |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The finished command gave a check still waiting on the registry a one-second grace period and then recorded the abandoned check as the day's. There is no reason to wait: pnpm v11 never does. The command now finishes when it is done; a check the registry has answered has already printed its notice and recorded itself, and one still waiting is aborted and records nothing, so the next command asks again. `settle` is synchronous and takes only the handle. The unit tests cover the aborted and the already-finished check, and the silent-registry end-to-end test asserts that nothing is recorded. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Follow-up to the review above: the grace period is gone entirely in fd5803d. The command never waits for the update check; one still unanswered when the command is done is aborted and not recorded, so the next command asks again, as pnpm v11 does. Finding 3 (a stalled registry costing a second per install) no longer applies. Written by an agent (Claude Code, claude-fable-5-1). |
|
Code review by qodo was updated up to the latest commit fd5803d |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
… check (#16913) Since the update check no longer holds the command (#16902), two suite tests that depended on the wait fail. The notice test installed an empty workspace, which is done in milliseconds, so the install finished before the registry answered the check. It now installs a dependency, as the add tests in the same module do, so the check's request, which is in flight before the install's first, is answered while the install still has work. The Rust test runner sets PNPM_CONFIG_CI=false, so a pnpm spawned without the shared command harness ran the daily check against the runner's un-isolated state directory. While the command awaited the check, the first such pnpm recorded it and every later one skipped it. Now an unanswered check is dropped unrecorded, so every bare pnpm asked its mock registry for pnpm's latest, and a test whose public mock forbids any request failed. The runner and the coverage workflow now set PNPM_CONFIG_UPDATE_NOTIFIER=false as well; the notifier suite turns the check back on itself.
Summary
Related to #16839 (a
pnpm installthat prints "Already up to date" after minutes on Windows, with nothing in theTRACEoutput).Two changes:
The update check no longer holds the command.
pnpm installandpnpm addstart the daily update check alongside the command and awaited it before printingDone in .... With a registry that accepts the connection but never answers (a firewall that drops packets, a proxy that stalls), that wait is the registry client's connect and read timeouts, a minute each, on an install that had nothing else to do. The command no longer waits for it at all: a check the registry has answered has already printed its notice and recorded itself, and one still running when the command is done is aborted and records nothing, so the next command asks again. That is what pnpm v11 does (checkForUpdates(config).catch(() => {})inmain.ts), so the stall is v12-only.This only reaches an install that did not take the pre-runtime fast path (a pnpmfile, a frozen lockfile,
workspacesinpackage.json, per-project lockfiles, config dependencies), because that fast path returns before the runtime exists. The reporter's install prints "Already up to date" with norepeat-install fast path skippedline, which is exactly the shape of an install that went through the engine, found nothing to do, and then waited on something silent.TRACE='pacquet::install=debug'now explains an up-to-date install. Before, the only line that target could print on this path was the reason the fast path was skipped, so an install that took the shortcut and was still slow printed nothing (which is what the reporter saw). Now it reports why the pre-runtime fast path was not taken (install_already_up_to_datereturns the reason instead ofNone, and the CLI gate names its own reasons), when either fast path was taken, when the update check was dropped unanswered, and the duration of the phases that read the project tree or wait on something: loading the config, discovering the workspace projects, the repeat-install check, the store registration, building the HTTP client, taking the store lock. The durations come fromtracingspans, which the prettyTRACElayer already prints on close.Whether (1) is the reporter's cause cannot be confirmed from here: the repeat install on a 35-project workspace takes 93 ms on this Windows 10 machine. (2) is what will tell. I will ask the reporter to rerun with the same
TRACEcommand once this ships.Verified locally:
cargo clippy --all-targetsfor both crates, thepnpm-package-managerrepeat-install and lockfile-recovery tests (156 passed), the notifier unit tests, and the pre-push hook's rustfmt, workspace clippy, cargo doc, and dylint. Not run locally: thepnpm-clisuite (update_notifier::,repeat_install::), because the test build was stopped twice by the host for low system memory; CI covers them.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
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-1).
🤖 Generated with Claude Code
Summary by CodeRabbit
pnpm installandpnpm addno longer wait for the daily update check to finish. If the check is still pending when the command completes, no notice is shown and the check is retried on a later run.