Skip to content

Akka/Pekko retry frenzy when all hosts are blacklisted #3610

@mirzov

Description

@mirzov

It appears that the retry logic in AkkaHttpClient has a problem in the scenario when all the hosts got blacklisted. The problem is that in this situation retry is attempted without any delay, and the retry is repeated until maxRetryTimeout time has passed since the first attempt, but the repetition is doomed to failure because all the hosts are blacklisted. This results in high CPU usage, but without any network calls to Elastic.
Perhaps the problem can be solved by adding the extra condition for going into another retry, namely checking that there are non-blacklisted hosts? Something like

if (timePassed < settings.maxRetryTimeout.toNanos && settings.hosts.exists(!blacklist.contains(_)) {
   logger.trace(s"Retrying a request: ${request.endpoint}")
   queueRequestWithRetry(request, startTimeNanos)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions