[ https://issues.apache.org/jira/browse/SPARK-36798?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17417094#comment-17417094 ]
Apache Spark commented on SPARK-36798: -------------------------------------- User 'BOOTMGR' has created a pull request for this issue: https://github.com/apache/spark/pull/34039 > When SparkContext is stopped, metrics system should be flushed after > listeners have finished processing > ------------------------------------------------------------------------------------------------------- > > Key: SPARK-36798 > URL: https://issues.apache.org/jira/browse/SPARK-36798 > Project: Spark > Issue Type: Bug > Components: Structured Streaming > Affects Versions: 2.3.2 > Reporter: Harsh Panchal > Priority: Minor > > In current implementation, when {{SparkContext.stop()}} is called, > {{metricsSystem.report()}} is called before {{listenerBus.stop()}}. In this > case, if some listener is producing some metrics, they would never reach sink. > Background: > We have some ingestion jobs in Spark Structured Streaming. To monitor them, > collect some metrics like number of input rows, trigger time etc. from > {{QueryProgressEvent}} received via {{StreamingQueryListener}}. These metrics > are then pushed to DB by custom sinks registered in {{MetricsSystem}}. We > noticed that these metrics are lost occasionally for last batch. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org