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

    https://github.com/apache/spark/pull/6205#discussion_r30480924
  
    --- Diff: core/src/main/scala/org/apache/spark/rpc/akka/AkkaRpcEnv.scala ---
    @@ -212,7 +211,7 @@ private[spark] class AkkaRpcEnv private[akka] (
     
       override def asyncSetupEndpointRefByURI(uri: String): 
Future[RpcEndpointRef] = {
         import actorSystem.dispatcher
    -    actorSystem.actorSelection(uri).resolveOne(defaultLookupTimeout).
    +    
actorSystem.actorSelection(uri).resolveOne(defaultLookupTimeout.duration).
    --- End diff --
    
    The timeout is a little trickier for Futures.  From what I understand, 
creating the future is non-blocking, so we can't just call `Await.result`.  If 
the Future isn't fulfilled within the timeout, its marked as failed, then 
sometime later if the future is acted upon, the TimeoutException is thrown.
    
    I think we might be able to use the `andThen` method described here: 
http://doc.akka.io/docs/akka/snapshot/scala/futures.html.  We would need to add 
a function to `RpcTimeout` that takes in a `Future[T]`, then applies `andThen` 
to it which checks if the future completed with failure, then returns a 
`Future[T]`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to