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

    https://github.com/apache/spark/pull/2019#discussion_r16728263
  
    --- Diff: 
core/src/main/scala/org/apache/spark/network/ConnectionManager.scala ---
    @@ -368,32 +378,38 @@ private[spark] class ConnectionManager(
                 val key = selectedKeys.next
                 selectedKeys.remove()
                 try {
    -              if (key.isValid) {
    -                if (key.isAcceptable) {
    -                  acceptConnection(key)
    -                } else
    -                if (key.isConnectable) {
    -                  triggerConnect(key)
    -                } else
    -                if (key.isReadable) {
    -                  triggerRead(key)
    -                } else
    -                if (key.isWritable) {
    -                  triggerWrite(key)
    +              key.synchronized {
    +                val connection = connectionsByKey.getOrElse(key, null)
    +                if (key.channel.isInstanceOf[ServerSocketChannel] ||
    --- End diff --
    
    Same weird check for ServerSocketChannel.
    
    Also same issue with `key.synchronized` not really protecting against the 
underlying connection object being closed.


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