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

    https://github.com/apache/spark/pull/3912#discussion_r22570265
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/receiver/ReceiverSupervisorImpl.scala
 ---
    @@ -73,14 +73,16 @@ private[streaming] class ReceiverSupervisorImpl(
     
       /** Timeout for Akka actor messages */
       private val askTimeout = AkkaUtils.askTimeout(env.conf)
    +  private var numRegisterAttemps = -1
     
       /** Akka actor for receiving messages from the ReceiverTracker in the 
driver */
       private val actor = env.actorSystem.actorOf(
         Props(new Actor {
           override def preStart() {
    -        logInfo("Registered receiver " + streamId)
    -        val msg = RegisterReceiver(
    -          streamId, receiver.getClass.getSimpleName, 
Utils.localHostName(), self)
    +        numRegisterAttemps += 1
    +        logInfo("Register receiver " + streamId + " before it starts ")
    +        val msg = RegisterReceiver(streamId, 
receiver.getClass.getSimpleName,
    --- End diff --
    
    A simple question, maybe not relevant to this PR, whye we need to have two 
`RegisterReceiver` messages, one in Akka preStart, another in 
`onReceiverStart()`, I'm not sure is there any specific purpose?


---
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

Reply via email to