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

ASF GitHub Bot commented on TINKERPOP-1671:
-------------------------------------------

Github user tolbertam commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/605#discussion_r113846423
  
    --- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteConnection.java
 ---
    @@ -67,7 +67,11 @@
             // default implementation for backward compatibility to 3.2.4 - 
this method will probably just become
             // the new submit() in 3.3.x when the deprecation is removed
             final CompletableFuture<RemoteTraversal<?, E>> promise = new 
CompletableFuture<>();
    -        promise.complete(submit(bytecode));
    +        try {
    +            promise.complete(submit(bytecode));
    +        } catch (Exception t) {
    --- End diff --
    
    Chose to limit to `Exception` types instead of `Throwable` since 
`RuntimeException`/`Error` are probably acceptable to be thrown on calling 
thread since they are unexpected and likely not caused by the traversal failing.


> Default method for RemoteConnection.submitAsync throws exception from submit 
> on calling thread instead of failing the future
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-1671
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1671
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.2.4
>            Reporter: Andy Tolbert
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> If a {{RemoteConnection}} implementation does not provide override 
> {{submitAsync}}, the default method is used which simply wraps {{submit}} in 
> a future.  
> One downside of this is that if an exception is thrown by {{submit}}, an 
> exception is thrown on the calling thread instead of failing the future.
> Failing the future would be more preferable for consistencies sake, otherwise 
> client code would need to consider that an exception could be thrown on the 
> calling thread or that the future may fail.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to