Jason918 commented on a change in pull request #13538:
URL: https://github.com/apache/pulsar/pull/13538#discussion_r790118611
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
##########
@@ -2477,6 +2478,7 @@ public void startSendOperation(Producer producer, int
msgSize, int numMessages)
producer.getTopic().isTopicPublishRateExceeded(numMessages, msgSize);
if (isPreciseTopicPublishRateExceeded) {
producer.getTopic().disableCnxAutoRead();
+ recordRateLimitMetrics(producers.values());
Review comment:
> Each `ServerCnx` contains multiple Producers (all Producers that share
this channel). I have traversed all the Producers here, and each Producer has
its corresponding Topic, so all Topics that share this connection will be +1.
Yes, that's why topic B will +1.
My scenario is that `startSendOperation` is only called in `ServerCnx1`.
`producers.values()` in Line 2481 only contains producers of Topic A and B
(They shares the same connection `ServerCnx1` ).
But `startSendOperation` is not called on `ServerCnx2`, so the rate limit
times of Topic C won't be +1, right?
And in fact `ServerCnx2` is still rate limitted due to this code path :
`producer.getTopic().disableCnxAutoRead();` -->
`producers.values().forEach(producer ->
producer.getCnx().disableCnxAutoRead());` (Topic A has producer in ServerCnx2)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]