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

    https://github.com/apache/spark/pull/9941#discussion_r45797576
  
    --- Diff: core/src/main/scala/org/apache/spark/rpc/netty/NettyRpcEnv.scala 
---
    @@ -368,13 +368,22 @@ private[netty] class NettyRpcEnv(
     
         @volatile private var error: Throwable = _
     
    -    def setError(e: Throwable): Unit = error = e
    +    def setError(e: Throwable): Unit = {
    +      error = e
    +      source.close()
    +    }
     
         override def read(dst: ByteBuffer): Int = {
    -      if (error != null) {
    -        throw error
    +      val result = if (error == null) {
    --- End diff --
    
    It's similar, but slightly different. Because of `source.close()` in L373, 
I'm giving preference to the error that caused the channel to be closed; the 
previous code would instead throw a `ChannelClosedException` or something.


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