Skip to content

Infinite hang/deadlock when processing desynchronized PE reads ("different read numbers of the pack") #694

@vaishnavigawde-01

Description

@vaishnavigawde-01

When running fastp in paired-end mode with multiple threads, if the input R1 and R2 files have a mismatching number of reads, the program issues a warning (different read numbers of the pack) but fails to exit or error out. Instead, the process hangs indefinitely, consuming CPU resources without making progress. This prevents automated pipelines from failing gracefully.

fastp hangs indefinitely when paired-end input files are out of sync. When a "pack" (internal processing block) contains a different number of reads for R1 vs R2, a warning is logged, but the worker threads appear to enter a deadlock waiting for the missing reads.

To Reproduce
Command used:

fastp --thread 16 -i R1_corrupted.fastq.gz -I R2_complete.fastq.gz -o out_R1.gz -O out_R2.gz --json report.json --html report.html

Expected behavior
fastp should either:
Throw a fatal error and exit with a non-zero status code when desynchronisation is detected.

Actual behavior
The program logs the following warning and then hangs forever:

WARNING: different read numbers of the 34658 pack
Read1 pack size: 1000
Read2 pack size: 991

Environment:

fastp version: 0.23.2

OS: Linux

Threads used: 16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions