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

    https://github.com/apache/spark/pull/3868#discussion_r23706702
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala
 ---
    @@ -223,22 +224,33 @@ class ReceiverTracker(ssc: StreamingContext, 
skipReceiverLaunch: Boolean = false
           thread.start()
         }
     
    -    def stop() {
    +    def stop(graceful: Boolean) {
           // Send the stop signal to all the receivers
           stopReceivers()
     
           // Wait for the Spark job that runs the receivers to be over
           // That is, for the receivers to quit gracefully.
    +
           thread.join(10000)
     
           // Check if all the receivers have been deregistered or not
    +      def done = { receiverInfo.isEmpty && terminated }
    +
    +      if (graceful) {
    +        while (!done) {
    +          Thread.sleep(100)
    +        }
    +      }
    +
           if (!receiverInfo.isEmpty) {
    -        logWarning("All of the receivers have not deregistered, " + 
receiverInfo)
    +        logWarning(s"All of the receivers have not deregistered, 
${receiverInfo}")
           } else {
             logInfo("All of the receivers have deregistered successfully")
           }
         }
     
    +
    --- End diff --
    
    Why the extra lines.


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