Tim Meehan created SPARK-61261:
----------------------------------

             Summary: Reattach after a dropped connection instead of failing 
the query, in Spark Connect Rust as PySpark does
                 Key: SPARK-61261
                 URL: https://issues.apache.org/jira/browse/SPARK-61261
             Project: Spark
          Issue Type: Bug
          Components: Connect
    Affects Versions: connect-rust-4.3.0
            Reporter: Tim Meehan


When the connection drops in the middle of a result, PySpark's Connect client 
reconnects and reattaches to the execution and returns every row. The Rust 
client fails the query instead.

Repro: put a TCP proxy between the client and an OSS Spark 4.3.0 Connect server 
that resets the connection once, after about 2 MB of response, and collect 
spark.range(3_000_000).
* pyspark-client 4.3.0 reconnects, sends ReattachExecute and returns all 
3,000,000 rows, also after three resets.
* spark-connect-rust fails after about 0.5 seconds with "[Unknown error] h2 
protocol error: error reading a body from connection" (measured at 4ad36945). 
At 8768cc4 it still fails, with the same kind of proxy in front of a mock 
server.

>From source: grpc-python reports the reset as UNAVAILABLE, which PySpark's 
>retry policy retries. tonic reports it as Unknown, and 
>DefaultPolicy::can_retry (crates/spark-connect-core/src/retries.rs:73) retries 
>only Unavailable, and Internal with INVALID_CURSOR.DISCONNECTED, so the 
>reattach loop gives up. SPARK-60964 made each reattach retry, but this error 
>never reaches the retry.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to