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

    https://github.com/apache/spark/pull/7250#discussion_r34321222
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala ---
    @@ -581,6 +579,9 @@ class StreamingContext private[streaming] (
           case INITIALIZED =>
             startSite.set(DStream.getCreationSite())
             sparkContext.setCallSite(startSite.get)
    +        // Registering Streaming Metrics at the start of the 
StreamingContext
    +        assert(env.metricsSystem != null)
    +        env.metricsSystem.registerSource(streamingSource)
             StreamingContext.ACTIVATION_LOCK.synchronized {
    --- End diff --
    
    This is still a little flawed. there is a case where two StreamingContext 
can be created, but only one should successfully start. So if one is already 
started (source registered), the second streaming context.start() should fail. 
But currently it will fail due to 
`StreamingContext.assertNoOtherContextIsActive()` but it will attempt to 
register the source nonetheless. This is bad. So the registering of the source 
should be done only after that line.
    
    I think it should just before `uiTab.foreach(_.attachI())` line 601
    
    Apologies for changing this so many times. 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to