Github user zsxwing commented on a diff in the pull request:
https://github.com/apache/spark/pull/4467#discussion_r29697767
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala
---
@@ -247,9 +310,12 @@ class ReceiverTracker(ssc: StreamingContext,
skipReceiverLaunch: Boolean = false
if (graceful) {
val pollTime = 100
+ var elapsedTime = 0
+ def done: Boolean = { receiverInfo.isEmpty && !running }
logInfo("Waiting for receiver job to terminate gracefully")
- while (receiverInfo.nonEmpty || running) {
+ while(!done && elapsedTime < TIMEOUT) {
--- End diff --
The `Timeout` logic will change the `stopGracefully` semantics. The
`stopGracefully` semantics should be `if ssc.stop(..., stopGracefully = true)
returns normally, no data loss will happen`. But after your change, if
`ssc.stop(..., stopGracefully = true)` returns normally, the user won't know if
everything goes smooth. There is no signal here to help the user understand
what happens internally.
I vote for keeping the original codes unchanged.
---
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]