Github user aledsage commented on the issue:

    https://github.com/apache/brooklyn-server/pull/329
  
    @ahgittin I've had a look at what is causing it...
    
    When it hangs (1 in 50 times for me, when run in Eclipse with 
`@Test(invocationCount=1000)`), the `start` thread is blocked by:
    
    ```
    "brooklyn-execmanager-DGVR7wxb-22" daemon prio=5 tid=0x00007fb4c4477800 
nid=0x1ea03 waiting on condition [0x000070000e233000]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at org.apache.brooklyn.util.time.Time.sleep(Time.java:353)
            at 
org.apache.brooklyn.entity.software.base.SoftwareProcessImpl.waitForEntityStart(SoftwareProcessImpl.java:568)
            at 
org.apache.brooklyn.entity.software.base.SoftwareProcessImpl.postDriverStart(SoftwareProcessImpl.java:277)
            at 
org.apache.brooklyn.entity.software.base.SoftwareProcessDriverLifecycleEffectorTasks.postStartCustom(SoftwareProcessDriverLifecycleEffectorTasks.java:173)
            at 
org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$PostStartTask.run(MachineLifecycleEffectorTasks.java:625)
            at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
            at 
org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:359)
            at 
org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:519)
            at java.util.concurrent.FutureTask.run(FutureTask.java:262)
            at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
            at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
            at java.lang.Thread.run(Thread.java:745)
    ```
    
    A better fix is therefore to change the setUp method to:
    
    ```
            entity = 
app.createAndManageChild(EntitySpec.create(EmptySoftwareProcess.class)
                    .configure(EmptySoftwareProcess.START_TIMEOUT, 
Duration.millis(100)));
    ```
    
    It worked (without hanging) 1000 times a row for me with this fix.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to