Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
codelipenghui committed Feb 16, 2020
1 parent 7bbc7a2 commit 917f29b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1684,11 +1684,15 @@ public boolean isWritable() {
private void startSendOperation(Producer producer, int msgSize) {
messagePublishBufferSize += msgSize;
boolean isPublishRateExceeded = producer.getTopic().isPublishRateExceeded();
if (++pendingSendRequest == MaxPendingSendRequests || isPublishRateExceeded || getBrokerService().isMessagePublishBufferThreshold()) {
if (++pendingSendRequest == MaxPendingSendRequests || isPublishRateExceeded) {
// When the quota of pending send requests is reached, stop reading from socket to cause backpressure on
// client connection, possibly shared between multiple producers
ctx.channel().config().setAutoRead(false);
autoReadDisabledRateLimiting = isPublishRateExceeded;

}
if (getBrokerService().isMessagePublishBufferThreshold()) {
ctx.channel().config().setAutoRead(false);
autoReadDisabledPublishBufferLimiting = true;
}
}
Expand Down

0 comments on commit 917f29b

Please sign in to comment.