Github user tdas commented on a diff in the pull request: https://github.com/apache/spark/pull/8340#discussion_r37675815 --- Diff: streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala --- @@ -244,24 +244,43 @@ class ReceiverTracker(ssc: StreamingContext, skipReceiverLaunch: Boolean = false } if (isTrackerStopping || isTrackerStopped) { - false - } else if (!scheduleReceiver(streamId).contains(hostPort)) { - // Refuse it since it's scheduled to a wrong executor - false + return false + } + + val scheduledExecutors = receiverTrackingInfos(streamId).scheduledExecutors + if (scheduledExecutors.nonEmpty) { + // This receiver is registering at the first time, it's scheduled by + // ReceiverSchedulingPolicy.scheduleReceivers. So use "scheduledExecutors" to check it. + if (!scheduledExecutors.get.contains(hostPort)) { --- End diff -- Same question as below, why handle the scheduling and rescheduling cases differently.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org