[jboss-jira] [JBoss JIRA] (WFLY-9721) AsyncInvocationTask.get() throws CancellationException

Denis Shklyaev (JIRA) issues at jboss.org
Tue Jan 23 03:06:00 EST 2018


Denis Shklyaev created WFLY-9721:
------------------------------------

             Summary: AsyncInvocationTask.get() throws CancellationException
                 Key: WFLY-9721
                 URL: https://issues.jboss.org/browse/WFLY-9721
             Project: WildFly
          Issue Type: Bug
          Components: EJB
    Affects Versions: 11.0.0.Final
            Reporter: Denis Shklyaev
            Priority: Optional


AsyncInvocationTask.get() on cancelled task in Wildfly 11 throws CancellationException via EjbLogger, but the behavior is not declared in method signature:

{{    public synchronized Object get() throws InterruptedException, ExecutionException {
        for (;;) switch (status) {
            case ST_RUNNING: wait(); break;
            *case ST_CANCELLED: throw EjbLogger.ROOT_LOGGER.taskWasCancelled();*
            case ST_FAILED: throw new ExecutionException(failed);
            case ST_DONE: return result;
            default: throw Assert.impossibleSwitchCase(status);
        }
    }
}}

Wildfly 10.01.0 code is different:

{{    public synchronized Object get() throws InterruptedException, ExecutionException {
        while (!isDone()) {
            wait();
        }
        if (failed != null) {
            throw new ExecutionException(failed);
        }
        return result;
    } 
}}
It throws InterruptedException instead as declared.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list