chia7712 opened a new pull request, #13279:
URL: https://github.com/apache/kafka/pull/13279

   https://issues.apache.org/jira/browse/KAFKA-14295
   
   The broker topic metric FetchMessageConversionsPerSec doesn't get recorded 
on a fetch message conversion.
   The bug is that we pass in a callback that expects a MultiRecordsSend in 
KafkaApis:
   ```scala
   def updateConversionStats(send: Send): Unit = {
     send match {
       case send: MultiRecordsSend if send.recordConversionStats != null =>
         send.recordConversionStats.asScala.toMap.foreach {
           case (tp, stats) => updateRecordConversionStats(request, tp, stats)
         }
       case _ =>
     }
   } 
   ```
   But we call this callback with a NetworkSend in the SocketServer:
   ```scala
   selector.completedSends.forEach { send =>
     try {
       val response = inflightResponses.remove(send.destinationId).getOrElse {
         throw new IllegalStateException(s"Send for ${send.destinationId} 
completed, but not in `inflightResponses`")
       }
       updateRequestMetrics(response)
   
       // Invoke send completion callback
       response.onComplete.foreach(onComplete => onComplete(send))
   ```
   Note that Selector.completedSends returns a collection of NetworkSend
   
   
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to