Skip to content

Commit

Permalink
[fix][client] Release semaphore before discarding messages in batchMe…
Browse files Browse the repository at this point in the history
…ssageContainer (apache#17019)
  • Loading branch information
RobertIndie authored Aug 11, 2022
1 parent 5f5d53b commit 21dc668
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2030,9 +2030,9 @@ private void failPendingBatchMessages(PulsarClientException ex) {
}
final int numMessagesInBatch = batchMessageContainer.getNumMessagesInBatch();
final long currentBatchSize = batchMessageContainer.getCurrentBatchSize();
batchMessageContainer.discard(ex);
semaphoreRelease(numMessagesInBatch);
client.getMemoryLimitController().releaseMemory(currentBatchSize);
batchMessageContainer.discard(ex);
}

@Override
Expand Down

0 comments on commit 21dc668

Please sign in to comment.