Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
codelipenghui committed Feb 18, 2020
1 parent 9fe2a10 commit 814371c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class BatchMessageIndexAckTest extends ProducerConsumerBase {
@BeforeMethod
@Override
protected void setup() throws Exception {
conf.setAcknowledgmentAtBatchIndexLevelEnabled(true);
super.internalSetup();
super.producerBaseSetup();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ private void doCumulativeAck(MessageIdImpl msgId, BitSetRecyclable bitSet) {
BitSetRecyclable lastBitSet = this.lastCumulativeAckSet;
if (msgId.compareTo(lastCumlativeAck) > 0) {
if (LAST_CUMULATIVE_ACK_UPDATER.compareAndSet(this, lastCumlativeAck, msgId) && LAST_CUMULATIVE_ACK_SET_UPDATER.compareAndSet(this, lastBitSet, bitSet)) {
lastBitSet.recycle();
if (lastBitSet != null) {
lastBitSet.recycle();
}
// Successfully updated the last cumulative ack. Next flush iteration will send this to broker.
cumulativeAckFlushRequired = true;
return;
Expand Down

0 comments on commit 814371c

Please sign in to comment.