Skip to content

fix: use mem::forget to avoid fjall Drop deadlock (#86)#87

Open
mwiewior wants to merge 1 commit into
masterfrom
fix/fjall-drop-deadlock-86
Open

fix: use mem::forget to avoid fjall Drop deadlock (#86)#87
mwiewior wants to merge 1 commit into
masterfrom
fix/fjall-drop-deadlock-86

Conversation

@mwiewior
Copy link
Copy Markdown
Contributor

@mwiewior mwiewior commented Apr 3, 2026

Summary

Root cause

fjall 3.1.x DatabaseInner::drop() sends Close messages on a bounded(1000) flume channel in a spin loop. When background workers are still in long-running compact() (which doesn't check stop_signal), the channel fills up and send() blocks permanently → deadlock.

Why this is safe

Both code paths call persist() + major_compact() before the forget — all data is on disk and fully compacted. The Drop only needs to join worker threads, but it deadlocks trying. mem::forget is safe Rust and the standard workaround for broken Drop implementations.

Test plan

  • cargo clippy -- -D warnings passes
  • Full Ensembl VEP 115 cache build completes without hanging

🤖 Generated with Claude Code

…ds (#86)

fjall 3.1.x DatabaseInner::drop() deadlocks when background worker
threads are still compacting — the bounded(1000) flume channel fills up
and send(Close) blocks permanently. After persist + major_compact all
data is safely on disk, so skipping Drop via mem::forget is safe.

Applies to both build_variation_fjall_from_parquet() and build_sift_fjall().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fjall Database::drop() deadlocks after cache build on large data

1 participant