poorbarcode commented on code in PR #24423:
URL: https://github.com/apache/pulsar/pull/24423#discussion_r2356546796
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:
##########
@@ -437,11 +449,37 @@ public void channelInactive(ChannelHandlerContext ctx)
throws Exception {
}
}
+ protected void checkRateLimit(BaseCommand cmd) {
+ if (cmd.getType() == BaseCommand.Type.PONG && cmd.getType() ==
BaseCommand.Type.PING) {
+ return;
+ }
+ if (requestRateLimiter.acquire(1) == 0 && !pausedDueToRateLimitation) {
+ log.warn("[{}] Reached rate limitation", this);
+ // Stop receiving requests.
+ pausedDueToRateLimitation = true;
+ ctx.channel().config().setAutoRead(false);
Review Comment:
> Optimally each PR should keep the project in releasable state. That's why
I don't think it's acceptable to break the rate limiting in this PR and then
fix it in another.
Yes, after the current PR, there is no bug. Which is releaable, it is just a
state that a PIP is in progress, but every function is fine.
BTW, when you pushed [the part-1 of
PIP-379](https://github.com/apache/pulsar/pull/23352), you left bugs there and
just created issues to trace them, which is not releasable
- https://github.com/apache/pulsar/pull/23352#discussion_r1792098771
- https://github.com/apache/pulsar/pull/23352#discussion_r1792099326
> Is it hard to follow this advice?
I had said that I would push a separate PR to do it.
--
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]