Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/4149#discussion_r23347464
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala
---
@@ -119,9 +118,17 @@ class ReceiverTracker(ssc: StreamingContext,
skipReceiverLaunch: Boolean = false
}
}
- /** Clean up metadata older than the given threshold time */
- def cleanupOldMetadata(cleanupThreshTime: Time) {
+ /** Clean up the data and metadata of old blocks and batches */
+ def cleanupOldBlocksAndBatches(cleanupThreshTime: Time) {
+ // Clean up old block and batch metadata
receivedBlockTracker.cleanupOldBatches(cleanupThreshTime,
waitForCompletion = false)
+
+ // Signal the receivers to delete old block data
+ if
(ssc.conf.getBoolean("spark.streaming.receiver.writeAheadLog.enable", false)) {
+ logInfo(s"Cleanup old received batch data: $cleanupThreshTime")
+ receiverInfo.values.flatMap { info => Option(info.actor) }
--- End diff --
I tried to dig around and understand why `ReceiverInfo`'s might have a null
actor reference. There seems to be only one case when this happens and it's
when an error is received. But in that case doesn't the error report itself
come from the actor (so you can have a reference to the actor via the sender?).
At a minimum, should we maybe indicate in `ReceiverInfo` that users should
defend against the possibility of the actor ref being null? And would it be
possible to avoid the possibility of a `null` reference alltogether (not for
this patch specifically, but in general).
---
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]