-
Notifications
You must be signed in to change notification settings - Fork 243
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
Race conditions accessing CRAM's reference data through ReferenceSource #1643
Labels
Comments
vruano
added a commit
that referenced
this issue
Jan 11, 2023
…t might be trying to solve an non-existent issue. Chaned WeakReference to SoftReference to make cache more persistent in memory. Addresses issue #1643.
3 tasks
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of the issue:
Problem spotted in GATK due to smelly use and no use of synchronized in CRAM ReferenceSource:
broadinstitute/gatk#8139
.../cram/.../ReferenceSource.java has a mixture of synchronized and non-synchronzed access to its cache member fields that results in a race condition when accessing it in parallel by at least one tool in GATK.
This class already contain synchronized modifier which implies that is supposed to support multi-thread access.
Your environment:
Current master:9f0e80f5bf
Not relevant
Not relevant
Steps to reproduce
See original post. No concrete test input data provided but the problem becomes clear when inspecting the code.
Expected behaviour
Either
(a) this class is made multithread safe or
(b) it clearly stated that is not multi-thread safe and the multithread elements (e.g. synchronized modifiers) are removed.
Actual behaviour
At least there is one way to cause race conditions in multi-thread use of this class. There could be more, so code should be review for other possible issues.
The text was updated successfully, but these errors were encountered: