hachikuji commented on a change in pull request #9912:
URL: https://github.com/apache/kafka/pull/9912#discussion_r560342977



##########
File path: core/src/main/scala/kafka/server/RequestHandlerHelper.scala
##########
@@ -58,16 +57,68 @@ object RequestHandlerHelper {
   }
 }
 
+class UnthrottledRequestHandlerHelper(
+  requestChannel: RequestChannel,
+  logPrefix: String
+) extends Logging {
+  this.logIdent = logPrefix
 
+  def handleError(request: RequestChannel.Request, e: Throwable): Unit = {
+    error("Error when handling request: " +
+      s"clientId=${request.header.clientId}, " +
+      s"correlationId=${request.header.correlationId}, " +
+      s"api=${request.header.apiKey}, " +
+      s"version=${request.header.apiVersion}, " +
+      s"body=${request.body[AbstractRequest]}", e)
+    sendErrorOrCloseConnection(request, e, 0)

Review comment:
       The approach I took here was intended as a lighter touch. Many of the 
APIs exposed by `RequestHandlerHelper` set throttling expectations explicitly 
(e.g. `sendResponseExemptThrottle`). That makes it a little awkward to push 
down the throttling logic. If we only depended on the request quota, then I 
would be tempted to try, but we also depend on the controller mutation quota. I 
did consider changing the dependence from `QuotaManagers` to 
`ClientRequestQuotaManager` and `ControllerMutationQuotaManager`. Then we could 
pull out a trait for both of this. But all of this seemed like more work with 
little benefit.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to