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



##########
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:
       Thanks for the explanation. The `handleError` duplication seems a bit 
ugly. Also, inheriting from concrete classes is generally not great. So, to me, 
the current approach is lighter touch, but doesn't feel right.




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