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

    https://github.com/apache/spark/pull/7276#discussion_r35282624
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala
 ---
    @@ -189,13 +238,21 @@ 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
         } else {
    -      // "stopReceivers" won't happen at the same time because both 
"registerReceiver" and are
    -      // called in the event loop. So here we can assume "stopReceivers" 
has not yet been called. If
    -      // "stopReceivers" is called later, it should be able to see this 
receiver.
    -      receiverInfo(streamId) = ReceiverInfo(
    -        streamId, s"${typ}-${streamId}", receiverEndpoint, true, host)
    -      
listenerBus.post(StreamingListenerReceiverStarted(receiverInfo(streamId)))
    +      val name = s"${typ}-${streamId}"
    +      val receiverInfo = ReceiverInfo(streamId, name, true, hostPort)
    +      receiverTrackingInfos.put(streamId,
    +        ReceiverTrackingInfo(
    +          streamId,
    +          ReceiverState.ACTIVE,
    +          scheduledLocations = None,
    +          runningLocation = Some(hostPort),
    +          name = Some(name),
    +          endpoint = Some(receiverEndpoint)))
    +      listenerBus.post(StreamingListenerReceiverStarted(receiverInfo))
    --- End diff --
    
    Right. Fixed 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]

Reply via email to