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

    https://github.com/apache/spark/pull/10459#discussion_r48505487
  
    --- Diff: core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala ---
    @@ -61,9 +55,14 @@ class AkkaUtilsSuite extends SparkFunSuite with 
LocalSparkContext with ResetSyst
     
         val slaveRpcEnv = RpcEnv.create("spark-slave", hostname, 0, conf, 
securityManagerBad)
         val slaveTracker = new MapOutputTrackerWorker(conf)
    -    intercept[akka.actor.ActorNotFound] {
    +    try {
           slaveTracker.trackerEndpoint =
    -        slaveRpcEnv.setupEndpointRef("spark", rpcEnv.address, 
MapOutputTracker.ENDPOINT_NAME)
    +        slaveRpcEnv.setupEndpointRef(rpcEnv.address, 
MapOutputTracker.ENDPOINT_NAME)
    +    } catch {
    +      case e: RuntimeException =>
    +        assert(e.getMessage.contains("javax.security.sasl.SaslException"))
    +      case e: SparkException =>
    +        assert(e.getMessage.contains("Message is dropped because Outbox is 
stopped"))
    --- End diff --
    
    Adding this catch clause because there is a race condition in `Outbox` that 
may throw `SparkException` instead. Image the following execution order:
    
    Execution Order  | Thread1 | Thread2
    ------------- | ------------- | -------------
    1 | nettyEnv.createClient (Outbox.scala, will call channel.close in this 
method if authentication fails) | 
    2 | catch NonFatal(e) |
    3 |  | connectionTerminated (NettyRpcHandler)
    4 |  | nettyEnv.removeOutbox
    5 |  | outbox.stop
    6 |  | message.onFailure(new SparkException("Message is dropped because 
Outbox is stopped"))
    7 | Outbox.handleNetworkFailure |



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