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

ASF GitHub Bot commented on KAFKA-5976:
---------------------------------------

GitHub user huxihx opened a pull request:

    https://github.com/apache/kafka/pull/3961

    KAFKA-5976: RequestChannel.sendResponse should record correct size for 
NetworkSend.

    When TRACE logging is enabled, RequestChannel.sendResponse records 
incorrect size for `Send` due to the fact that `response.responseSend` is of 
scala.Option type.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/huxihx/kafka KAFKA-5976

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/3961.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3961
    
----
commit 210f8470f7da48da3c67b763e28c5855c6010e65
Author: huxihx <huxi...@hotmail.com>
Date:   2017-09-26T09:09:43Z

    KAFKA-5976: RequestChannel.sendResponse should record correct size for 
NetworkSend.
    
    When TRACE logging is enabled, RequestChannel.sendResponse records 
incorrect size for `Send` due to the fact that `response.responseSend` is of 
scala.Option type.

----


> RequestChannel.sendReponse records incorrect size for NetworkSend with TRACE 
> logging
> ------------------------------------------------------------------------------------
>
>                 Key: KAFKA-5976
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5976
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.11.0.1
>            Reporter: huxihx
>            Assignee: huxihx
>
> In RequestChannel.scala, RequestChannel.sendResponse records incorrect size 
> for `NetworkSend` when trace logging is enabled, as shown below:
> {code:title=RequestChannel.scala|borderStyle=solid}
> def sendResponse(response: RequestChannel.Response) {
>     if (isTraceEnabled) {
>       val requestHeader = response.request.header
>       trace(s"Sending ${requestHeader.apiKey} response to client 
> ${requestHeader.clientId} of " + s"${response.responseSend.size} bytes.")
>     }
> {code}
> `responseSend` is of `scala.Option` type so it should be 
> `response.responseSend.get.size`. 
> No need to check if they are none here.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to