Skip to content

Commit

Permalink
Fix synchronization in LocalCheckpointTracker#contains (#38755)
Browse files Browse the repository at this point in the history
We are accessing the `CountedBitSet` in `LocalCheckpointTracker#contains`
without proper synchronization.

Relates #33871
  • Loading branch information
dnhatn committed Feb 12, 2019
1 parent 225ebb6 commit eca5404
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ public boolean contains(final long seqNo) {
return true;
}
final long bitSetKey = getBitSetKey(seqNo);
final CountedBitSet bitSet;
final int bitSetOffset = seqNoToBitSetOffset(seqNo);
synchronized (this) {
bitSet = processedSeqNo.get(bitSetKey);
final CountedBitSet bitSet = processedSeqNo.get(bitSetKey);
return bitSet != null && bitSet.get(bitSetOffset);
}
return bitSet != null && bitSet.get(seqNoToBitSetOffset(seqNo));
}

/**
Expand Down

0 comments on commit eca5404

Please sign in to comment.