Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/7276#discussion_r34532967
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala
---
@@ -227,6 +255,8 @@ class ReceiverTracker(ssc: StreamingContext,
skipReceiverLaunch: Boolean = false
case DeregisterReceiver(streamId, message, error) =>
deregisterReceiver(streamId, message, error)
context.reply(true)
+ case ScheduleReceiver(streamId) =>
--- End diff --
Actually, we can merge the change you did in #6294, where
`ReceiverSupervisor.onReceiverStart()` (that is, `RegisterReceiver` message) is
called before the receiver is started, and the receiver is only started if
`RegisterReceiver` message returns `true`. This mechanism can be used by the
`ReceiverTracker` to prevent the receiver from starting on unwanted executors -
when `RegisterReceiver` is received by the tracker, it will return `!stopping
&& scheduleReceiver(receiverId).contains(host))`.
This will solve the race condition as well as check for location without
introducing additional messaging... isnt it?
---
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]