Flume
  1. Flume
  2. FLUME-2002

Flume RPC Client creates 2 threads per each log attempt if the remote flume agent goes down

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: v1.3.0, v1.3.1
    • Fix Version/s: v1.4.0
    • Component/s: Client SDK
    • Labels:
      None

      Description

      Steps to reproduce (use attached Maven project):

      1. Start your remote flume agent
      2. Run the Maven project and attach to it with the debugger in your favourite IDE (I use NetBeans)
      3. Kill your remote flume agent
      4. Rapidly press enter

      Each time you press Enter, 2 new threads show up. See the attached screenshot. Notice the panel on the left is littered with new threads. I was pressing Enter rapidly for 30 seconds.

      NOTE: This also happens if the remote flume agent hasn't been started at all.

      1. Screenshot.png
        180 kB
        Edward Sargisson
      2. zzzzzzzzzzzzzzzzzTest.tar.gz
        7 kB
        Edward Sargisson
      3. FLUME-2002-2.patch
        4 kB
        Mike Percy

        Issue Links

          Activity

          Hide
          Edward Sargisson added a comment -

          Attached screenshot and example project

          Show
          Edward Sargisson added a comment - Attached screenshot and example project
          Hide
          Edward Sargisson added a comment -

          Raised from a defect originally raised in the Apache log4j2 project.

          Ralph Goers in log4j2 projects says,
          "I have modified FlumeAvroManager to use the Flume RPCClient. Even when using that this behavior still occurs. Once I commit the changes I will be closing this issue as it doesn't seem to be an error in the FlumeAppender but in Flume itself. It looks like NettyAvroRpcClient may not be shutting down the threads properly. "

          Show
          Edward Sargisson added a comment - Raised from a defect originally raised in the Apache log4j2 project. Ralph Goers in log4j2 projects says, "I have modified FlumeAvroManager to use the Flume RPCClient. Even when using that this behavior still occurs. Once I commit the changes I will be closing this issue as it doesn't seem to be an error in the FlumeAppender but in Flume itself. It looks like NettyAvroRpcClient may not be shutting down the threads properly. "
          Hide
          Ralph Goers added a comment - - edited

          It looks to me like the connect method in NettyAvroRpcClient is creating a couple of thread pools before trying to open the connection. If a connection is thrown it doesn't clean them up.

          This error also occurs if the Flume agents are not available when the application is started.

          Show
          Ralph Goers added a comment - - edited It looks to me like the connect method in NettyAvroRpcClient is creating a couple of thread pools before trying to open the connection. If a connection is thrown it doesn't clean them up. This error also occurs if the Flume agents are not available when the application is started.
          Hide
          Mike Percy added a comment -

          This should fix the issue

          Show
          Mike Percy added a comment - This should fix the issue
          Hide
          Mike Percy added a comment -

          You guys were right, thanks very much for reporting this!

          Show
          Mike Percy added a comment - You guys were right, thanks very much for reporting this!
          Hide
          Hari Shreedharan added a comment -

          +1.

          Show
          Hari Shreedharan added a comment - +1.
          Hide
          Hari Shreedharan added a comment -

          Patch committed, rev: 2e1b7c23c4964b8860b876cc5c8c3642c4d74ab9. Thanks Mike!

          Show
          Hari Shreedharan added a comment - Patch committed, rev: 2e1b7c23c4964b8860b876cc5c8c3642c4d74ab9. Thanks Mike!
          Hide
          Hudson added a comment -

          Integrated in flume-trunk #403 (See https://builds.apache.org/job/flume-trunk/403/)
          FLUME-2002. Flume RPC Client creates 2 threads per each log attempt if the remote flume agent goes down. (Revision 2e1b7c23c4964b8860b876cc5c8c3642c4d74ab9)

          Result = SUCCESS
          hshreedharan : http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=2e1b7c23c4964b8860b876cc5c8c3642c4d74ab9
          Files :

          • flume-ng-sdk/src/main/java/org/apache/flume/api/NettyAvroRpcClient.java
          • flume-ng-sdk/src/test/java/org/apache/flume/api/TestNettyAvroRpcClient.java
          Show
          Hudson added a comment - Integrated in flume-trunk #403 (See https://builds.apache.org/job/flume-trunk/403/ ) FLUME-2002 . Flume RPC Client creates 2 threads per each log attempt if the remote flume agent goes down. (Revision 2e1b7c23c4964b8860b876cc5c8c3642c4d74ab9) Result = SUCCESS hshreedharan : http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=2e1b7c23c4964b8860b876cc5c8c3642c4d74ab9 Files : flume-ng-sdk/src/main/java/org/apache/flume/api/NettyAvroRpcClient.java flume-ng-sdk/src/test/java/org/apache/flume/api/TestNettyAvroRpcClient.java
          Hide
          Edward Sargisson added a comment -

          Verified - closing.

          Show
          Edward Sargisson added a comment - Verified - closing.

            People

            • Assignee:
              Mike Percy
              Reporter:
              Edward Sargisson
            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development