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

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

GitHub user xiaotao183 opened a pull request:

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

    KAFKA-4129: Processor throw exception when getting channel remote address 
after closing the channel

    Get channel remote address before calling ```channel.close```

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

    $ git pull https://github.com/xiaotao183/kafka KAFKA-4129

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

    https://github.com/apache/kafka/pull/1826.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 #1826
    
----
commit 3d4a4b01789c46ac940caba6be35f73c3db715fa
Author: Tao Xiao <xiaotao...@gmail.com>
Date:   2016-09-06T13:12:35Z

    get channel remote address before calling channel.close

----


> Processor throw exception when getting channel remote address after closing 
> the channel
> ---------------------------------------------------------------------------------------
>
>                 Key: KAFKA-4129
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4129
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.10.0.1
>            Reporter: TAO XIAO
>            Assignee: TAO XIAO
>
> In Processor {{configureNewConnections()}} catch block, it explicitly closes 
> {{channel}} before calling {{channel.getRemoteAddress}} which results in 
> {{ClosedChannelException}} being thrown. This is due to Java implementation 
> that no remote address can be returned after the channel is closed
> {code}
>         case NonFatal(e) =>
>          // need to close the channel here to avoid a socket leak.
>          close(channel)
>          error(s"Processor $id closed connection from 
> ${channel.getRemoteAddress}", e)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to