Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Ordered loader keeps no handle to release a failed request from before a cursor reset

Aperta
#2,223 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Read packages/db/src/query/live/ordered-source-loader.ts, the acquisition release rules in ARCHITECTURE.md, and packages/db/tests/query/ordered-source-loader-state-oracle.test.ts. First add a failing named history with a page in flight, a truncate, a failed page request, and further truncates; track releases for that demand. Done means the witness establishes who owns the failed dead request’s lease and verifies each acquisition is released exactly once.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

A review of #2194 reported a possible lease leak in OrderedSourceLoader (packages/db/src/query/live/ordered-source-loader.ts). No test reproduces it yet.

A request that the loader issued before a cursor reset is dead after the reset. If a dead request succeeds, the loader records its lease in settledFiniteAcquisitions and later retires it. If a dead request fails, the failure handler returns before it records the lease in failedAcquisitions. Then the loader keeps no handle that can release the lease.

Expected

The loader or the truncate replay releases each acquisition exactly once (ARCHITECTURE.md, acquisition release rules).

Possible result

The subscription keeps the failed demand for replay, and the replay acquires it again. Nothing releases that demand until the subscription ends, so each later truncate replays it again. This causes more provider load and a leaked lease.

Next step

Before a change, add a witness that fails. The request-authority oracle in packages/db/tests/query/ordered-source-loader-state-oracle.test.ts does not judge requests issued before a truncate, because the replay owns them. A witness must decide which component owns a failed dead request's lease. It can be a named history: a page in flight, a truncate, a failure of the page, and then more truncates. It counts the releases for that demand.

This issue was written by Isaac.

Lingua principale
TypeScript
Stelle
4k
Fork
277
Merge medio
17h 40m
PR unite (30g)
223

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TanStack/db

Tutte le issue di TanStack/db

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.