You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "haosdent (JIRA)" <ji...@apache.org> on 2015/07/03 12:11:04 UTC

[jira] [Commented] (MESOS-2718) Future created by State.names() throws an Illegal ExecutionException

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

haosdent commented on MESOS-2718:
---------------------------------

[~matthias@mesosphere.io] Could you use getMessage? The ExecutionException has already contained the cause reason in message field.

> Future created by State.names() throws an Illegal ExecutionException
> --------------------------------------------------------------------
>
>                 Key: MESOS-2718
>                 URL: https://issues.apache.org/jira/browse/MESOS-2718
>             Project: Mesos
>          Issue Type: Bug
>          Components: java api
>    Affects Versions: 0.22.1
>         Environment: OSX, Mesos 0.22.1
>            Reporter: Matthias Veit
>
> During application startup, we call call org.apache.mesos.state.State.names().
> This will return a java Future. 
> Everything is fine in the success case.
> In the error case, the future can throw either an InterruptedException, ExecutionException or a RuntimeException.
> The ExecutionException indicates, that the future was not successful.
> This is the text from the javadoc: 
> Exception thrown when attempting to retrieve the result of a task that aborted by throwing an exception. This exception can be inspected using the Throwable.getCause() method. See here: https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutionException.html
> The ExecutionException thrown by mesos in the above method does not hold a reference to the root cause, but returns a reference to this as cause (ex == ex.getCause()). 
> ExecutionException really is a wrapper exception to indicate success or failure of the java future and should always have a root cause. 
> With the current implementation we can't distinguish between a Future error or an application error. Please provide always the exception cause.



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