[ 
https://issues.apache.org/jira/browse/QPID-6684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14663325#comment-14663325
 ] 

ASF subversion and git services commented on QPID-6684:
-------------------------------------------------------

Commit 1694857 from [~k-wall] in branch 'java/trunk'
[ https://svn.apache.org/r1694857 ]

QPID-6684: [Java Broker] Ensure asynchronous state change exceptions are passed 
back to caller

* Guarded case 1 - attainState returns a Future containing an exception
* Guarded case 2 - the recursive call to doAttainState returned a future 
contain a non-RuntimeException
* Refactored to use Futures.allAsList (rather than ChildCounter)
* Added supporting unit test

> 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