HyukjinKwon opened a new pull request, #202:
URL: https://github.com/apache/spark-connect-rust/pull/202

   ### What changes were proposed in this pull request?
   
   [SPARK-60963](https://issues.apache.org/jira/browse/SPARK-60963): the 
artifact uploads of the Rust transport now run under the retry policy, as 
PySpark's do.
   
   - **Cache uploads** of large local relations: the `ArtifactStatus` check and 
the `AddArtifacts` upload are one attempt, as in 
`SparkConnectClient.cache_artifacts`. So a transient error of either is retried 
from the status check.
   - **`addArtifacts` and `copyFromLocalToFs`** upload each path in an attempt 
of its own, as `SparkConnectClient.add_artifacts` does. That makes one 
`AddArtifacts` call per path, as PySpark makes.
   
   An attempt sends all the frames again, since a stream cannot be resumed. The 
checks of the response, its CRCs and the acknowledgement of each cached 
artifact, stay outside the retries.
   
   ### Why are the changes needed?
   
   Each of these requests was sent once, so a transient error, such as an 
`UNAVAILABLE` of a reset connection, failed `createDataFrame` of a large 
PyArrow table, or `addArtifacts`, at once. PySpark retries it.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, these calls survive transient errors, as with PySpark 4.3.0. 
`addArtifacts` of several paths makes one upload per path.
   
   ### How was this patch tested?
   
   - New tests against the mock Connect server of the Arrow handoff tests, 
which can now fail `ArtifactStatus` and `AddArtifacts` calls with given status 
codes:
     - A cache upload whose status check and upload each fail once with 
`UNAVAILABLE` succeeds, with three status checks and two upload attempts, and 
the server reads the cached data.
     - A `PERMISSION_DENIED` of the upload is not retried.
     - `addArtifacts` of two paths, with one transient failure, uploads both in 
three attempts.
     
     The retry tests fail without this change.
   - The test of the frames of `addArtifacts` now expects one upload per path.
   - The lib tests and every integration test, e2e included, against a local 
Spark 4.3.0 server (660 passed, and 123 of the transport crate), the build of 
all tests with `wasm-udf`, the offline Python suites (913 passed, 9 skipped), 
and the live drop-in and Arrow suites (82 passed) and live cases (10 passed). 
Clippy reports no diagnostics in the changed lines.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 5.5
   
   This pull request and its description were written by Isaac.
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to