dnishimura commented on a change in pull request #1213: [WIP] SAMZA-2305:
Stream processor should ensure previous container is stopped during a rebalance
URL: https://github.com/apache/samza/pull/1213#discussion_r343751217
##########
File path:
samza-core/src/main/scala/org/apache/samza/system/SystemProducers.scala
##########
@@ -35,16 +35,26 @@ class SystemProducers(
*/
dropSerializationError: Boolean = false) extends Logging {
+ /**
+ * Denotes if the SystemConsumers have started. The flag is useful in the
event of shutting down since interrupt
+ * on Samza Container will shutdown components and container currently
doesn't track what components have started
+ * successfully.
+ */
+ private var started = false
+
def start {
debug("Starting producers.")
producers.values.foreach(_.start)
+ started = true
}
def stop {
- debug("Stopping producers.")
+ if (started) {
+ debug("Stopping producers.")
- producers.values.foreach(_.stop)
+ producers.values.foreach(_.stop)
+ }
}
Review comment:
Similar to the previous question: Should you set the `started` flag to
`false` at the end of `stop`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services