Keith Wall created QPID-6684:
--------------------------------

             Summary: Asynchronous state change exceptions not passed back to 
caller
                 Key: QPID-6684
                 URL: https://issues.apache.org/jira/browse/QPID-6684
             Project: Qpid
          Issue Type: Bug
          Components: Java Broker
            Reporter: Keith Wall
            Assignee: Keith Wall
             Fix For: qpid-java-6.0


A defect in the following part of the ACO#doAttainState means that an 
asynchronous exception occurring in a state change method is lost and not 
propagated back via the future returned to the caller.

{code:java} 
       final SettableFuture<Void> returnVal = SettableFuture.create();
        final ChildCounter counter = new ChildCounter(new Runnable()
        {
            @Override
            public void run()
            {
                try
                {
### If future returned by attainState contains an exception, it is lost.  
returnVal future completes normally regardless..
                    attainState().addListener(new Runnable()
                    {
                        @Override
                        public void run()
                        {
                            returnVal.set(null);
                        }
                    }, getTaskExecutor().getExecutor());
                }
                catch(RuntimeException e)
                {
                    try
                    {
                        exceptionHandler.handleException(e, 
AbstractConfiguredObject.this);
                        returnVal.set(null);
                    }
                    catch(Throwable t)
                    {
                        returnVal.setException(t);
                    }
                }
            }
        });
{code} 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to