You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "xie shuiahu (Jira)" <ji...@apache.org> on 2023/10/31 11:13:00 UTC

[jira] [Updated] (SPARK-45738) client will wait forever if session in spark connect server is evicted

     [ https://issues.apache.org/jira/browse/SPARK-45738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

xie shuiahu updated SPARK-45738:
--------------------------------
    Description: 
Step1. start a spark connect server

Step2. submit a spark job which will run long
{code:java}
from pyspark.sql import SparkSession
spark = SparkSession.builder.remote(f"sc://HOST:PORT/;user_id=job").create()
spark.sql("A SQL will run longer than creating 100 sessions").show() {code}
 

Step3. create more than 100 sessions

Tips: Run concurrently with step2
{code:java}
for i in range(0, 200):
    spark = SparkSession.builder.remote(f"sc://HOST:PORT/;user_id={i}").create()
    spark.sql("show databases") {code}
 

*When the python code in step3 is executed, the session created in step2 will be evicted, and the client will wait forever*

 

  was:
Step1. start a spark connect server


Step2. submit a spark job which will run long
{code:java}
from pyspark.sql import SparkSession
spark = SparkSession.builder.remote(f"sc://HOST:PORT/;user_id=job").create()
spark.sql("A SQL will run longer than creating 100 sessions").show() {code}
 

Step3. create more than 100 sessions

Tips: Run concurrently with step2
{code:java}
for i in range(0, 200):
    spark = SparkSession.builder.remote(f"sc://HOST:PORT/;user_id={i}").create()
    spark.sql("show databases") {code}
 

*When the python code in step3 is executed, the session created in step2 will be evicted, and the client will wait forever*

The server will log exception like this:


> client will wait forever if session in spark connect server is evicted
> ----------------------------------------------------------------------
>
>                 Key: SPARK-45738
>                 URL: https://issues.apache.org/jira/browse/SPARK-45738
>             Project: Spark
>          Issue Type: Bug
>          Components: Connect
>    Affects Versions: 3.5.0
>            Reporter: xie shuiahu
>            Priority: Critical
>
> Step1. start a spark connect server
> Step2. submit a spark job which will run long
> {code:java}
> from pyspark.sql import SparkSession
> spark = SparkSession.builder.remote(f"sc://HOST:PORT/;user_id=job").create()
> spark.sql("A SQL will run longer than creating 100 sessions").show() {code}
>  
> Step3. create more than 100 sessions
> Tips: Run concurrently with step2
> {code:java}
> for i in range(0, 200):
>     spark = SparkSession.builder.remote(f"sc://HOST:PORT/;user_id={i}").create()
>     spark.sql("show databases") {code}
>  
> *When the python code in step3 is executed, the session created in step2 will be evicted, and the client will wait forever*
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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