Kafka
  1. Kafka
  2. KAFKA-4129

Processor throw exception when getting channel remote address after closing the channel

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.0.1
    • Fix Version/s: 0.10.1.0
    • Component/s: core
    • Labels:
      None

      Description

      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

              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)
      

        Issue Links

          Activity

          Hide
          ASF GitHub Bot added a comment -

          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 <xiaotao183@gmail.com>
          Date: 2016-09-06T13:12:35Z

          get channel remote address before calling channel.close


          Show
          ASF GitHub Bot added a comment - 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 <xiaotao183@gmail.com> Date: 2016-09-06T13:12:35Z get channel remote address before calling channel.close
          Hide
          Ismael Juma added a comment -

          Issue resolved by pull request 1826
          https://github.com/apache/kafka/pull/1826

          Show
          Ismael Juma added a comment - Issue resolved by pull request 1826 https://github.com/apache/kafka/pull/1826
          Hide
          ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

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

          Show
          ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/kafka/pull/1826

            People

            • Assignee:
              TAO XIAO
              Reporter:
              TAO XIAO
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development