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

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

Also, I don't think this is bug. Because we construct the ExecutionException 
with message instead of throwable.
{code}
jclass clazz = env->FindClass("java/util/concurrent/ExecutionException");
env->ThrowNew(clazz, future->failure().c_str());
{code}
And throwable.cause point to "this" default. 
[Throwable.java#L197|https://github.com/openjdk-mirror/jdk7u-jdk/blob/master/src/share/classes/java/lang/Throwable.java#L197]

> 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)

Reply via email to