gap CLI: DB's ~90 s static analysis is silent past the daemon wait, so every DB daemon check falls back cold
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript, typescript
- Bereich
- cli, performance
Rechercherichtung
Start with check.mjs, analysis.mjs, and daemon.mjs to trace how analysis blocks the daemon heartbeat and triggers the cold fallback; compare the two proposed approaches. Build the issue’s required oracle-first end-to-end history using a test-only pause point to hold analysis past the CLI wait. Done when the daemon check is served with unchanged reuse and no “runs cold” note, and the witness fails on main.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
On TanStack DB's packages/db, the gap CLI's static analysis phase takes about 90 s, and the daemon sends nothing during it. #131 made the CLI check cold when a daemon has sent nothing for 60 s (WAIT_MS, daemon.mjs). So on DB the daemon never serves a check: the CLI always falls back cold (v21.2 R39), and the daemon default (R13) saves nothing there.
Measurement
Arca pool, Linux, 8 vCPU. DB at 21c52a07, --package packages/db --source src/query/subset-dedupe.ts. Phase durations come from the CLI's progress lines (pool tag do-dbphase). Each row is one run.
| CLI | warm contexts | find test files | static analysis |
|---|---|---|---|
| main | 1.1 s | 17 ms | 91.2 s |
| main | 0.7 s | 21 ms | 88.9 s |
| #133 head | 0.8 s | 17 ms | 91.4 s |
| #133 head | 0.8 s | 17 ms | 91.6 s |
- The time is the same on main and on #133, so #133 did not cause it.
- The DB daemon bench for #133 had to raise the CLI's wait with the test-only knob
ORACLE_GAPS_TEST_WAIT_MSfor the daemon to serve any check.
Cause
checkIn(check.mjs) callsanalyze(analysis.mjs) synchronously on every check.analyzeinstruments the sources and then callsts.createProgramover the sources and the files thatownsnames. On DB, that means the type checker reads a large part of the package.- While it runs, the event loop is blocked, so the daemon cannot send its beat.
- daemon.mjs's
sendalready names this case: "a phase with no running copy (a session's start, a warm-up, the analysis) that runs longer than the bound". - The analysis runs in each check, not once per session. So this probably affects every daemon check on DB, not only the first. This is not measured separately.
Proposed fix (choose one)
- A beat around the analysis. The daemon sends a beat at each phase boundary, and also from inside the analysis between its steps: after each source is instrumented, and before and after
createProgram. This is small. ButcreateProgramalone can still run past 60 s on a big package, so it does not close the case by itself. - Analysis off the main thread. Run
analyzein a worker thread, so the daemon's event loop stays free to send beats on its normal schedule. This closes the case for any package size. It also lets a later change keep thets.Programbetween checks (oldProgram), which would make rechecks cheaper.
Either fix needs a witness that is oracle-first (P9): a constructed e2e history whose analysis phase is held past the CLI's wait at a test-only pause point (R57, never by time), and whose daemon check must still be served (unchanged reuse, no runs cold note). It must fail on main.
Authority
- R13 / M-30: the daemon is the default.
- R39: a cold fallback is not a failure, but it must stay the exception.
- Raised in the review of #131 and measured during #133.
This issue was written by Isaac.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 5
- Forks
- 1
- Ø Merge
- 11 Std. 18 Min.
- Gemergte PRs (30 T.)
- 66
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TanStack/oracles
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in TanStack/oracles
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
swc-project/swc-next-issues#532 ·
-
domain/checkout Platform(Default) priority/low testing/acceptance
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug confirmed css v6
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
check:passed logos:edit
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 1 Tag