You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by cloud-fan <gi...@git.apache.org> on 2018/06/09 00:13:56 UTC

[GitHub] spark pull request #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerialize...

GitHub user cloud-fan opened a pull request:

    https://github.com/apache/spark/pull/21518

    [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

    ## What changes were proposed in this pull request?
    
    `UnsafeRowSerializerSuite` calls `UnsafeProjection.create` which accesses `SQLConf.get`, while the current active SparkSession may already be stopped, and we may hit exception like this
    
    ```
    sbt.ForkMain$ForkError: java.lang.IllegalStateException: LiveListenerBus is stopped.
    	at org.apache.spark.scheduler.LiveListenerBus.addToQueue(LiveListenerBus.scala:97)
    	at org.apache.spark.scheduler.LiveListenerBus.addToStatusQueue(LiveListenerBus.scala:80)
    	at org.apache.spark.sql.internal.SharedState.<init>(SharedState.scala:93)
    	at org.apache.spark.sql.SparkSession$$anonfun$sharedState$1.apply(SparkSession.scala:120)
    	at org.apache.spark.sql.SparkSession$$anonfun$sharedState$1.apply(SparkSession.scala:120)
    	at scala.Option.getOrElse(Option.scala:121)
    	at org.apache.spark.sql.SparkSession.sharedState$lzycompute(SparkSession.scala:120)
    	at org.apache.spark.sql.SparkSession.sharedState(SparkSession.scala:119)
    	at org.apache.spark.sql.internal.BaseSessionStateBuilder.build(BaseSessionStateBuilder.scala:286)
    	at org.apache.spark.sql.test.TestSparkSession.sessionState$lzycompute(TestSQLContext.scala:42)
    	at org.apache.spark.sql.test.TestSparkSession.sessionState(TestSQLContext.scala:41)
    	at org.apache.spark.sql.SparkSession$$anonfun$1$$anonfun$apply$1.apply(SparkSession.scala:95)
    	at org.apache.spark.sql.SparkSession$$anonfun$1$$anonfun$apply$1.apply(SparkSession.scala:95)
    	at scala.Option.map(Option.scala:146)
    	at org.apache.spark.sql.SparkSession$$anonfun$1.apply(SparkSession.scala:95)
    	at org.apache.spark.sql.SparkSession$$anonfun$1.apply(SparkSession.scala:94)
    	at org.apache.spark.sql.internal.SQLConf$.get(SQLConf.scala:126)
    	at org.apache.spark.sql.catalyst.expressions.CodeGeneratorWithInterpretedFallback.createObject(CodeGeneratorWithInterpretedFallback.scala:54)
    	at org.apache.spark.sql.catalyst.expressions.UnsafeProjection$.create(Projection.scala:157)
    	at org.apache.spark.sql.catalyst.expressions.UnsafeProjection$.create(Projection.scala:150)
    	at org.apache.spark.sql.execution.UnsafeRowSerializerSuite.org$apache$spark$sql$execution$UnsafeRowSerializerSuite$$unsafeRowConverter(UnsafeRowSerializerSuite.scala:54)
    	at org.apache.spark.sql.execution.UnsafeRowSerializerSuite.org$apache$spark$sql$execution$UnsafeRowSerializerSuite$$toUnsafeRow(UnsafeRowSerializerSuite.scala:49)
    	at org.apache.spark.sql.execution.UnsafeRowSerializerSuite$$anonfun$2.apply(UnsafeRowSerializerSuite.scala:63)
    	at org.apache.spark.sql.execution.UnsafeRowSerializerSuite$$anonfun$2.apply(UnsafeRowSerializerSuite.scala:60)
    ...
    ```
    
    
    ## How was this patch tested?
    
    N/A


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cloud-fan/spark test

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/21518.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #21518
    
----
commit 3f59ca2ebafae592be354fa75f28dfea63d2e568
Author: Wenchen Fan <we...@...>
Date:   2018-06-09T00:09:44Z

    flaky test

----


---

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


[GitHub] spark pull request #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerialize...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21518#discussion_r194497168
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeRowSerializerSuite.scala ---
    @@ -45,6 +44,14 @@ class ClosableByteArrayInputStream(buf: Array[Byte]) extends ByteArrayInputStrea
     
     class UnsafeRowSerializerSuite extends SparkFunSuite with LocalSparkContext {
     
    +  override def beforeAll() {
    +    super.beforeAll()
    +    // This test suite calls `UnsafeProjection.create` which accesses `SQLConf.get`, we should make
    +    // sure active session is cleaned so that `SQLConf.get` won't refer to a stopped session.
    +    SparkSession.clearActiveSession()
    +    SparkSession.clearDefaultSession()
    --- End diff --
    
    the problem is that, `LocalSparkContext` is in core module not SQL, so we can't access `SparkSession` there.
    
    Maybe we should use `LocalSparkSession` for this test suite.
    



---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    Merged build finished. Test PASSed.


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    Merged build finished. Test PASSed.


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    **[Test build #91591 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/91591/testReport)** for PR 21518 at commit [`3f59ca2`](https://github.com/apache/spark/commit/3f59ca2ebafae592be354fa75f28dfea63d2e568).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/91670/
    Test PASSed.


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by squito <gi...@git.apache.org>.
Github user squito commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    lgtm assuming tests pass


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    **[Test build #91591 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/91591/testReport)** for PR 21518 at commit [`3f59ca2`](https://github.com/apache/spark/commit/3f59ca2ebafae592be354fa75f28dfea63d2e568).


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/15/
    Test PASSed.


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    thanks, merging to master/2.3!


---

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


[GitHub] spark pull request #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerialize...

Posted by praetp <gi...@git.apache.org>.
Github user praetp commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21518#discussion_r208830232
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeRowSerializerSuite.scala ---
    @@ -45,6 +44,14 @@ class ClosableByteArrayInputStream(buf: Array[Byte]) extends ByteArrayInputStrea
     
     class UnsafeRowSerializerSuite extends SparkFunSuite with LocalSparkContext {
     
    +  override def beforeAll() {
    +    super.beforeAll()
    +    // This test suite calls `UnsafeProjection.create` which accesses `SQLConf.get`, we should make
    +    // sure active session is cleaned so that `SQLConf.get` won't refer to a stopped session.
    +    SparkSession.clearActiveSession()
    +    SparkSession.clearDefaultSession()
    --- End diff --
    
    Seems like a major resource leakage to me then..


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    Merged build finished. Test PASSed.


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    **[Test build #91670 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/91670/testReport)** for PR 21518 at commit [`04d7f78`](https://github.com/apache/spark/commit/04d7f785483910dff88fa2c3906c1de6146ced1d).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class UnsafeRowSerializerSuite extends SparkFunSuite with LocalSparkSession `


---

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


[GitHub] spark pull request #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerialize...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/21518


---

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


[GitHub] spark pull request #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerialize...

Posted by squito <gi...@git.apache.org>.
Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21518#discussion_r208613943
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeRowSerializerSuite.scala ---
    @@ -45,6 +44,14 @@ class ClosableByteArrayInputStream(buf: Array[Byte]) extends ByteArrayInputStrea
     
     class UnsafeRowSerializerSuite extends SparkFunSuite with LocalSparkContext {
     
    +  override def beforeAll() {
    +    super.beforeAll()
    +    // This test suite calls `UnsafeProjection.create` which accesses `SQLConf.get`, we should make
    +    // sure active session is cleaned so that `SQLConf.get` won't refer to a stopped session.
    +    SparkSession.clearActiveSession()
    +    SparkSession.clearDefaultSession()
    --- End diff --
    
    @praetp yeah I think so, you probably also need to call `clearActiveSession()` and `clearDefaultSession()` in your `afterEach()` in your tests (or similar).
    
    If that doesn't work, might be best to open a thread on dev@spark.apache.org with more details.


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    cc @vanzin @squito 


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/91591/
    Test PASSed.


---

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


[GitHub] spark pull request #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerialize...

Posted by squito <gi...@git.apache.org>.
Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21518#discussion_r194483889
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeRowSerializerSuite.scala ---
    @@ -45,6 +44,14 @@ class ClosableByteArrayInputStream(buf: Array[Byte]) extends ByteArrayInputStrea
     
     class UnsafeRowSerializerSuite extends SparkFunSuite with LocalSparkContext {
     
    +  override def beforeAll() {
    +    super.beforeAll()
    +    // This test suite calls `UnsafeProjection.create` which accesses `SQLConf.get`, we should make
    +    // sure active session is cleaned so that `SQLConf.get` won't refer to a stopped session.
    +    SparkSession.clearActiveSession()
    +    SparkSession.clearDefaultSession()
    --- End diff --
    
    should we actually do this in `LocalSparkContext.resetSparkContext()` (which is called in `afterEach`)?
    
    I worry there are a lot more places we should be doing this, eg. `MLlibTestSparkContext.afterAll()` only calls `SparkSession.clearActiveSession()`.
    
    this class does seem to be one of the major sources of flakiness so I'm also OK with just getting this in for now.


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution/3906/
    Test PASSed.


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    Merged build finished. Test PASSed.


---

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


[GitHub] spark issue #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerializerSuite

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/21518
  
    **[Test build #91670 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/91670/testReport)** for PR 21518 at commit [`04d7f78`](https://github.com/apache/spark/commit/04d7f785483910dff88fa2c3906c1de6146ced1d).


---

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


[GitHub] spark pull request #21518: [SPARK-24502][SQL] flaky test: UnsafeRowSerialize...

Posted by praetp <gi...@git.apache.org>.
Github user praetp commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21518#discussion_r208555306
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeRowSerializerSuite.scala ---
    @@ -45,6 +44,14 @@ class ClosableByteArrayInputStream(buf: Array[Byte]) extends ByteArrayInputStrea
     
     class UnsafeRowSerializerSuite extends SparkFunSuite with LocalSparkContext {
     
    +  override def beforeAll() {
    +    super.beforeAll()
    +    // This test suite calls `UnsafeProjection.create` which accesses `SQLConf.get`, we should make
    +    // sure active session is cleaned so that `SQLConf.get` won't refer to a stopped session.
    +    SparkSession.clearActiveSession()
    +    SparkSession.clearDefaultSession()
    --- End diff --
    
    @squito @cloud-fan : we are facing similar issues in our own Spark tests. Are you saying just closing the sparkSession is not enough ?


---

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