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 broken main branch caused by wrong getBitSet method #177

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/BatchMessageAcker.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ class BatchMessageAcker {
return prevBatchCumulativelyAcked_.compare_exchange_strong(expectedValue, true);
}

const BitSet& getBitSet() const noexcept { return bitSet_; }
virtual const BitSet& getBitSet() const noexcept {
static BitSet emptyBitSet;
return emptyBitSet;
}

private:
// When a batched message is acknowledged cumulatively, the previous message id will be acknowledged
Expand Down Expand Up @@ -80,6 +83,8 @@ class BatchMessageAckerImpl : public BatchMessageAcker {
return bitSet_.isEmpty();
}

const BitSet& getBitSet() const noexcept override { return bitSet_; }

private:
BitSet bitSet_;
mutable std::mutex mutex_;
Expand Down