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

    https://github.com/apache/spark/pull/6380#discussion_r34868938
  
    --- Diff: 
streaming/src/test/scala/org/apache/spark/streaming/StreamingListenerSuite.scala
 ---
    @@ -140,6 +141,37 @@ class StreamingListenerSuite extends TestSuiteBase 
with Matchers {
         }
         true
       }
    +
    +  test("registering listeners via spark.streaming.extraListeners") {
    +    // Test for success with zero-argument constructor and sparkConf 
constructor
    +    val conf = new SparkConf().setMaster("local").setAppName("test")
    +      .set("spark.streaming.extraListeners",
    +        classOf[StreamingListenerThatAcceptsSparkConf].getName + "," +
    +        classOf[ReceiverInfoCollector].getName)
    +    val scc = new StreamingContext(conf, Seconds(1))
    --- End diff --
    
    This can lead to a leak in the StreamingContext and underlying 
SparkContext. Please put the whole in 
    
    ```
    var ssc: StremaingContext = null
    try {
      ssc = new StreamingContext...
    
    } finally {
       if (ssc != null) {
         ssc.stop()
       }
    }
    
    ```


---
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]

Reply via email to