[ 
https://issues.apache.org/jira/browse/KAFKA-13166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17583117#comment-17583117
 ] 

Jason Gustafson commented on KAFKA-13166:
-----------------------------------------

I am going to resolve this jira. There were two issues that we have fixed:
 * [https://github.com/apache/kafka/pull/12403]: This patch fixes error 
handling in `ControllerApis` so that we catch errors which occur during 
serialization and sending of the response. Prior to this, any error occurred 
during this phase would be silently ignored and the connection would be left 
hanging.
 * [https://github.com/apache/kafka/pull/12538:] This patch fixes a bug during 
kraft shutdown which can cause a response to be sent after the controller's 
socket server has been shutdown. When this occurs, we get an exception trace 
which matches that in the description above.

> EOFException when Controller handles unknown API
> ------------------------------------------------
>
>                 Key: KAFKA-13166
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13166
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: David Arthur
>            Assignee: David Arthur
>            Priority: Minor
>             Fix For: 3.3.0, 3.4.0
>
>
> When ControllerApis handles an unsupported RPC, it silently drops the request 
> due to an unhandled exception. 
> The following stack trace was manually printed since this exception was 
> suppressed on the controller. 
> {code}
> java.util.NoSuchElementException: key not found: UpdateFeatures
>       at scala.collection.MapOps.default(Map.scala:274)
>       at scala.collection.MapOps.default$(Map.scala:273)
>       at scala.collection.AbstractMap.default(Map.scala:405)
>       at scala.collection.mutable.HashMap.apply(HashMap.scala:425)
>       at kafka.network.RequestChannel$Metrics.apply(RequestChannel.scala:74)
>       at 
> kafka.network.RequestChannel.$anonfun$updateErrorMetrics$1(RequestChannel.scala:458)
>       at 
> kafka.network.RequestChannel.$anonfun$updateErrorMetrics$1$adapted(RequestChannel.scala:457)
>       at 
> kafka.utils.Implicits$MapExtensionMethods$.$anonfun$forKeyValue$1(Implicits.scala:62)
>       at 
> scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.foreachEntry(JavaCollectionWrappers.scala:359)
>       at 
> scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.foreachEntry$(JavaCollectionWrappers.scala:355)
>       at 
> scala.collection.convert.JavaCollectionWrappers$AbstractJMapWrapper.foreachEntry(JavaCollectionWrappers.scala:309)
>       at 
> kafka.network.RequestChannel.updateErrorMetrics(RequestChannel.scala:457)
>       at kafka.network.RequestChannel.sendResponse(RequestChannel.scala:388)
>       at 
> kafka.server.RequestHandlerHelper.sendErrorOrCloseConnection(RequestHandlerHelper.scala:93)
>       at 
> kafka.server.RequestHandlerHelper.sendErrorResponseMaybeThrottle(RequestHandlerHelper.scala:121)
>       at 
> kafka.server.RequestHandlerHelper.handleError(RequestHandlerHelper.scala:78)
>       at kafka.server.ControllerApis.handle(ControllerApis.scala:116)
>       at 
> kafka.server.ControllerApis.$anonfun$handleEnvelopeRequest$1(ControllerApis.scala:125)
>       at 
> kafka.server.ControllerApis.$anonfun$handleEnvelopeRequest$1$adapted(ControllerApis.scala:125)
>       at 
> kafka.server.EnvelopeUtils$.handleEnvelopeRequest(EnvelopeUtils.scala:65)
>       at 
> kafka.server.ControllerApis.handleEnvelopeRequest(ControllerApis.scala:125)
>       at kafka.server.ControllerApis.handle(ControllerApis.scala:103)
>       at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:75)
>       at java.lang.Thread.run(Thread.java:748)
> {code}
> This is due to a bug in the metrics code in RequestChannel.
> The result is that the request fails, but no indication is given that it was 
> due to an unsupported API on either the broker, controller, or client.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to