By default, the Ktor client doesn't retry requests that failed due to network or server errors. You can use the HttpRequestRetry plugin to configure the retry policy for failed requests in various ways: specify the number of retries, configure conditions for retrying a request, or modify a request before retrying.
https://ktor.io/docs/client-request-retry.html
Default configuration should be good enough:
val client = HttpClient(CIO) {
install(HttpRequestRetry) {
retryOnServerErrors(maxRetries = 3)
exponentialDelay()
}
}
https://ktor.io/docs/client-request-retry.html
Default configuration should be good enough: