You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/03/13 14:42:44 UTC

[GitHub] [spark] attilapiros commented on a change in pull request #24079: [SPARK-27145][Minor]Close store in the SQLAppStatusListenerSuite after test

attilapiros commented on a change in pull request #24079: [SPARK-27145][Minor]Close store  in the SQLAppStatusListenerSuite after test
URL: https://github.com/apache/spark/pull/24079#discussion_r265162114
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListenerSuite.scala
 ##########
 @@ -589,6 +602,7 @@ class SQLAppStatusListenerSuite extends SparkFunSuite with SharedSQLContext with
       time))
     assert(statusStore.executionsCount === 2)
     assert(statusStore.execution(2) === None)
+    store.close()
 
 Review comment:
   I would prefer closing the old `kvstore` right before the line:
   ```
       val store = new ElementTrackingStore(new InMemoryStore, conf)
   ```
   
   And modify the line to:
   ```
       kvstore = new ElementTrackingStore(new InMemoryStore, conf)
   ```
   
   I know it is not a big leak but if the test fails meanwhile (because of assertion) there would no `close` called. 
   On the other hand a `try` . and `finally` is can be saved this way.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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