samtools / htsjdk

A Java API for high-throughput sequencing data (HTS) formats.
http://samtools.github.io/htsjdk/
283 stars 242 forks source link

Fix race condition that arrises in SAMRecordDuplicateComparator #1516

Closed fleharty closed 3 years ago

fleharty commented 4 years ago

Description of the issue:

The getLibraryId function of SAMRecordDuplicateComparator.java can create race conditions when run multithreaded.

Your environment:

Steps to reproduce

Expected behaviour

getLibraryId should return the right value

Actual behaviour

Occasionally getLibraryId has the libraryId variable incremented by a separate thread that shouldn't have touched the value.

Picard SortSam

fleharty commented 3 years ago

Resolved by https://github.com/samtools/htsjdk/issues/1516