Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix threaded sam_read1 after EOF. #1856

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Commits on Oct 31, 2024

  1. Fix threaded sam_read1 after EOF.

    The SAM sam_dispatcher_read decodes blocks of SAM records into blocks
    of BAM records.  As this is (hopefully) reading ahead of the sam_read1
    consumer code, when it hits EOF it adds a final NULL block as a
    sentinel.  This works well and it forces sam_read1 to return EOF too.
    
    However, if we ignore that and call sam_read1 again, it's consumed our
    sentinel block and it gets stuck waiting for the next block of BAM
    records.  We now cache the EOF status and check first.
    
    Note this doesn't impact on iterators as they work at a different
    level already and it's the iterator itself which tracks EOF.
    
    Fixes samtools#1855
    jkbonfield committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    18e4e1f View commit details
    Browse the repository at this point in the history