A background pass holds the database file after a runtime drop

Aperta
#396 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@robinskil ci sta già lavorando.

Dal 17/8/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug rust

Problem

Drop a Runtime. Open the same beacon.db again. Beacon reports a lock error.

A background pass keeps an Arc<FileStatsService> across an await. The service holds the store, the
registry and the redb database. The database holds the file lock.

Drop for FileStatsService aborts the tasks (beacon-core/src/file_stats.rs:727). Drop runs only
after the last Arc goes. The task holds that Arc. The abort waits for the task, and the task
does not stop.

Both tasks have this shape: the timer at file_stats.rs:508, and the startup pass at
file_stats.rs:542.

Evidence

Set BEACON_FILE_STATS_ON_STARTUP=true. 4 of 7 tests in tables_store_lock_release fail. One test
uses an empty datasets folder, so the volume of work is not the cause.

Effect

A server process that exits does not see this. An embedded caller closes a database and opens the
file again. It does see this.

The defect blocks a default of BEACON_FILE_STATS_ON_STARTUP=true. See #394.

Proposal

  1. Add a cancellation token. The collector reads it between awaits.
  2. Add Runtime::shutdown(). It cancels the tasks, then joins them.
  3. Abort the tasks in Drop, for a caller that skips step 2.
Lingua principale
Rust
Stelle
16
Fork
4
Merge medio
19h 58m
PR unite (30g)
39

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

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 maris-development/beacon

Tutte le issue di maris-development/beacon

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.