Skip to content

Commit

Permalink
[improve][broker] Optimize high CPU usage when consuming from topics …
Browse files Browse the repository at this point in the history
…with ongoing txn (apache#23189)
  • Loading branch information
coderzc authored Aug 20, 2024
1 parent acc463f commit 94e1341
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ public void asyncReadEntriesWithSkipOrWait(int maxEntries, long maxSizeBytes, Re

int numberOfEntriesToRead = applyMaxSizeCap(maxEntries, maxSizeBytes);

if (hasMoreEntries()) {
if (hasMoreEntries() && maxPosition.compareTo(readPosition) >= 0) {
// If we have available entries, we can read them immediately
if (log.isDebugEnabled()) {
log.debug("[{}] [{}] Read entries immediately", ledger.getName(), name);
Expand Down

0 comments on commit 94e1341

Please sign in to comment.