Skip to content

Commit a574d70

Browse files
committed
Fix an issue that enableConcurrent may be set to true after Inbox is stopped
Because `Inbox.stop()` may run before processing `OnStart`, it's possible that `enableConcurrent` will be set to `true` after Inbox is stopped in the previous codes. This is not a correct behavior. This commit just added a check before setting `enableConcurrent` to `true` to fix this issue.
1 parent 77f08f6 commit a574d70

File tree

1 file changed

+3
-1
lines changed
  • core/src/main/scala/org/apache/spark/rpc/netty

1 file changed

+3
-1
lines changed

core/src/main/scala/org/apache/spark/rpc/netty/Inbox.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ private[netty] class Inbox(
129129
endpoint.onStart()
130130
if (!endpoint.isInstanceOf[ThreadSafeRpcEndpoint]) {
131131
inbox.synchronized {
132-
enableConcurrent = true
132+
if (!stopped) {
133+
enableConcurrent = true
134+
}
133135
}
134136
}
135137
}

0 commit comments

Comments
 (0)