andygrove opened a new issue, #2604:
URL: https://github.com/apache/datafusion-ballista/issues/2604

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   
   In 
[`ballista/core/src/client.rs`](https://github.com/apache/datafusion-ballista/blob/ea1126c0649b2bc08e1e233b1972b64318821c16/ballista/core/src/client.rs),
 `BallistaClient::execute_do_get` (L292-L367) and 
`execute_do_action_with_header` (L389-L463) copy the same ~50 lines: 
protobuf-encoding the `Action`, the retry loop with its sleep and warning, and 
the decision to retry only on `Code::Unknown`. Any change to the retry policy 
has to be made in both.
   
   Both loops also end in `unreachable!` (e.g. 
[L366](https://github.com/apache/datafusion-ballista/blob/ea1126c0649b2bc08e1e233b1972b64318821c16/ballista/core/src/client.rs#L366)).
 The loop is `for i in 0..io_retries_times`, so if `io_retries_times` is 
configured as 0 the body never runs and the client panics instead of returning 
an error.
   
   **Describe the solution you'd like**
   
   - Extract `encode_action(&Action)` and a generic `retry_io(&self, op)` 
helper that owns the sleep, warning and `Code::Unknown` logic, returning the 
first non-retryable error.
   - Have both methods use it, so they only build the request and wrap the 
response stream.
   - Treat `io_retries_times == 0` as a single attempt (or validate it at 
construction) and return an error instead of reaching `unreachable!`.
   
   **Describe alternatives you've considered**
   
   Only fix the `io_retries_times == 0` panic.
   
   **Additional context**
   
   This is small and self-contained, a good first issue. Line references are 
pinned to commit ea1126c0649b.
   


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