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

    https://github.com/apache/spark/pull/6205#discussion_r31828705
  
    --- Diff: core/src/main/scala/org/apache/spark/rpc/akka/AkkaRpcEnv.scala ---
    @@ -214,8 +213,10 @@ private[spark] class AkkaRpcEnv private[akka] (
     
       override def asyncSetupEndpointRefByURI(uri: String): 
Future[RpcEndpointRef] = {
         import actorSystem.dispatcher
    -    actorSystem.actorSelection(uri).resolveOne(defaultLookupTimeout).
    -      map(new AkkaRpcEndpointRef(defaultAddress, _, conf))
    +    defaultLookupTimeout.addMessageIfTimeout(
    +      actorSystem.actorSelection(uri).resolveOne(_).
    +        map(new AkkaRpcEndpointRef(defaultAddress, _, conf))
    +    )
    --- End diff --
    
    yeah I think its better to be more explicit, its not clear what the first 
`_` is.  Also I think it would be a bit clearer in two statements, so you can 
add a comment explaining, eg.
    
    ```
    val future = 
actorSystem.actorSelection(uri).resolveOne(defaultLookupTimeout.duration)
      .map(new AkkaRpcEndpointRef(defaultAddress, _, conf))
    // this is just in case there is a timeout from creating the future in 
resolveOne, we want the
    // exception to indicate the conf that determines the timeout
    defaultLookupTimeout.addMessageIfTimeout(future)
    ```


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