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

   ### What changes were proposed in this pull request?
   
   [SPARK-61390](https://issues.apache.org/jira/browse/SPARK-61390): 
`RetryPolicy::default()` now has the values of PySpark 4.3.0's `DefaultPolicy`, 
which the Scala client's `RetryPolicy.defaultPolicy()` shares:
   
   - 15 retries from 50 ms, quadrupling up to 60 s.
   - 500 ms of jitter on the waits from the 2 s threshold.
   - The server's `google.rpc.RetryInfo` delay is honored, capped at 10 minutes.
   
   A failure with a `RetryInfo` detail is retried whatever its code, as 
`DefaultPolicy.can_retry` does. The new `retry_delay_ms` reads the delay from 
`grpc-status-details-bin`, and the four retry sites of the client pass it to 
the backoff. The wait is rounded down, as the reference's `int()` does.
   
   ### Why are the changes needed?
   
   The default policy was that of an older client: 1 s doubling up to 64 s, 
without jitter and without the server's delay. So a client retried on another 
schedule than PySpark's, with a total of 639 s instead of 608.25 s with the 
jitter off, and ignored the delay that the server asks for. For example, a 
`RESOURCE_EXHAUSTED` with `RetryInfo(retry_delay=300ms)` was raised at once; 
now it is retried after 300 ms, as PySpark does.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. The retry timings of the default client match PySpark's, and failures 
with a `RetryInfo` detail are retried.
   
   ### How was this patch tested?
   
   - Rust unit tests: the default schedule without jitter (50, 200, 800, 3200, 
12800, 51200, then 60000 nine times, 608250 ms in total); the jitter applies 
only from the threshold and stays under 500 ms; the server delay is honored and 
capped, and ignored when `recognize_server_retry_delay` is false; and a status 
with `RetryInfo` is retried whatever its code.
   - An offline Python test with a mock `RetryInfo` failure, retried after the 
server's delay.
   - `cargo test -p apache-spark-connect -p apache-spark-connect-core --release 
--lib`, the core e2e tests and the drop-in suites against a Spark 4.3.0 server.
   
   ### 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