Skip to content

Fix writer drain deadlock#696

Open
KimYannn wants to merge 3 commits into
OpenGene:masterfrom
KimYannn:fix-writerthread-drain-deadlock
Open

Fix writer drain deadlock#696
KimYannn wants to merge 3 commits into
OpenGene:masterfrom
KimYannn:fix-writerthread-drain-deadlock

Conversation

@KimYannn
Copy link
Copy Markdown
Member

Summary

  • Fix writer-thread deadlock by scanning all per-worker output queues instead of blocking on one empty queue.
  • Make writer completion wait until every queue is producer-finished and empty, with an atomic completion flag to avoid completion races.
  • Add a high-thread regression script covering trailing-empty queue cases for SE/PE and optional writers.

Test plan

  • make -j$(sysctl -n hw.ncpu)
  • ./fastp test
  • ./fastp --version && ./fastp -i testdata/R1.fq -o /dev/null
  • bash scripts/test_writer_no_hang.sh

Fixes #695

💘 Generated with Crush

KimYannn and others added 2 commits May 18, 2026 22:21
Ensure writer threads keep scanning all output queues until every producer is finished and every queue is empty, preventing hangs and premature exit when some worker queues are empty.

💘 Generated with Crush

Co-Authored-By: Crush <crush@charm.land>
Cover high-thread writer queue cases where some worker output queues finish empty while others still need draining.

💘 Generated with Crush

Co-Authored-By: Crush <crush@charm.land>
@KimYannn KimYannn mentioned this pull request May 18, 2026
Write worker output queues in original pack order so repeated multi-threaded runs produce stable decompressed FASTQ content, and cover the behavior with an MD5 regression test.

💘 Generated with Crush

Co-Authored-By: Crush <crush@charm.land>
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.

Deadlock on 1.3.3

1 participant