Flume
  1. Flume
  2. FLUME-1854

Application class can deadlock if stopped immediately after start

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: v1.4.0
    • Component/s: None
    • Labels:
      None

      Description

      Only appears to affect shutting down the agent when it's still being started.

      "agent-shutdown-hook" prio=10 tid=0x00000000460b7800 nid=0x5c41 waiting on condition [0x0000000042484000]
         java.lang.Thread.State: TIMED_WAITING (parking)
              at sun.misc.Unsafe.park(Native Method)
              - parking to wait for  <0x00000000f9ec4a08> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
              at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196)
              at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)
              at java.util.concurrent.ThreadPoolExecutor.awaitTermination(ThreadPoolExecutor.java:1253)
              at java.util.concurrent.Executors$DelegatedExecutorService.awaitTermination(Executors.java:597)
              at org.apache.flume.node.PollingPropertiesFileConfigurationProvider.stop(PollingPropertiesFileConfigurationProvider.java:87)
              at org.apache.flume.lifecycle.LifecycleSupervisor.stop(LifecycleSupervisor.java:106)
              - locked <0x00000000f9ed2258> (a org.apache.flume.lifecycle.LifecycleSupervisor)
              at org.apache.flume.node.Application.stop(Application.java:92)
              at org.apache.flume.node.Application$1.run(Application.java:302)
      
      
      "conf-file-poller-0" prio=10 tid=0x000000004610a000 nid=0x5c2b waiting for monitor entry [0x0000000042180000]
         java.lang.Thread.State: BLOCKED (on object monitor)
              at org.apache.flume.lifecycle.LifecycleSupervisor.supervise(LifecycleSupervisor.java:125)
              - waiting to lock <0x00000000f9ed2258> (a org.apache.flume.lifecycle.LifecycleSupervisor)
              at org.apache.flume.node.Application.startAllComponents(Application.java:146)
              at org.apache.flume.node.Application.handleConfigurationEvent(Application.java:88)
              - locked <0x00000000f9eccc88> (a org.apache.flume.node.Application)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:68)
              at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
              - locked <0x00000000f9ee5fa0> (a com.google.common.eventbus.SynchronizedEventHandler)
              at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
              at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
              at com.google.common.eventbus.EventBus.post(EventBus.java:264)
              at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:140)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
              at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
              at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:662)
      

        Issue Links

          Activity

          Mike Percy made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Fix Version/s v1.4.0 [ 12323372 ]
          Resolution Fixed [ 1 ]
          Hide
          Hudson added a comment -

          Integrated in flume-trunk #356 (See https://builds.apache.org/job/flume-trunk/356/)
          FLUME-1854: Application class can deadlock if stopped immediately after start (Revision d45af178e6f71bea4484fbb0e94d6449f88e0b86)

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

          • flume-ng-node/src/main/java/org/apache/flume/node/Application.java
          • flume-ng-node/src/test/java/org/apache/flume/node/TestApplication.java
          Show
          Hudson added a comment - Integrated in flume-trunk #356 (See https://builds.apache.org/job/flume-trunk/356/ ) FLUME-1854 : Application class can deadlock if stopped immediately after start (Revision d45af178e6f71bea4484fbb0e94d6449f88e0b86) Result = SUCCESS harishreedharan : http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=d45af178e6f71bea4484fbb0e94d6449f88e0b86 Files : flume-ng-node/src/main/java/org/apache/flume/node/Application.java flume-ng-node/src/test/java/org/apache/flume/node/TestApplication.java
          Brock Noland made changes -
          Attachment FLUME-1854-0.patch [ 12566368 ]
          Hide
          Brock Noland added a comment -

          Attached

          Show
          Brock Noland added a comment - Attached
          Brock Noland made changes -
          Summary Backport FLUME-1854 - Application class can deadlock if stopped immediately after start Application class can deadlock if stopped immediately after start
          Brock Noland made changes -
          Summary Application class can deadlock if stopped immediately after start Backport FLUME-1854 - Application class can deadlock if stopped immediately after start
          Brock Noland made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Brock Noland made changes -
          Field Original Value New Value
          Remote Link This issue links to "Review Board (Web Link)" [ 11972 ]
          Hide
          Brock Noland added a comment -

          Application.handleConfigurationEvent is synchronized so that it cannot be called by multiple threads. stop/start should also be synchronized so they cannot be called during startup or handling of a configuration event.

          Show
          Brock Noland added a comment - Application.handleConfigurationEvent is synchronized so that it cannot be called by multiple threads. stop/start should also be synchronized so they cannot be called during startup or handling of a configuration event.
          Brock Noland created issue -

            People

            • Assignee:
              Brock Noland
              Reporter:
              Brock Noland
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development