Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/2019#discussion_r16728124
--- Diff:
core/src/main/scala/org/apache/spark/network/ConnectionManager.scala ---
@@ -334,17 +338,23 @@ private[spark] class ConnectionManager(
while (allKeys.hasNext) {
val key = allKeys.next()
try {
- if (! key.isValid) {
- logInfo("Key not valid ? " + key)
- throw new CancelledKeyException()
+ key.synchronized {
+ val connection = connectionsByKey.getOrElse(key, null)
+ if (key.channel.isInstanceOf[ServerSocketChannel] ||
+ connection != null && !connection.isClosed) {
+ if (!key.isValid) {
--- End diff --
Merge with previous condition? Also, check looks weird (why check for
ServerSocketChannel?).
---
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]