armeria icon indicating copy to clipboard operation
armeria copied to clipboard

`RetryingClient` gets deadlocked when a decorator returns a failed response.

Open ikhoon opened this issue 1 year ago • 0 comments

If a decorator inside RetryingClient directly returns a failed response, it may not complete RequestLog. A RetryingClient that waits for the log to be completed will be hanged. https://github.com/line/armeria/blob/01f2c6f6ee49548c499b202be50fc9d3df84dd4f/core/src/main/java/com/linecorp/armeria/client/retry/RetryingClient.java#L375-L379

I encountered the problem when OauthClient received an invalid response that completes .getAccessToken() exceptionally. https://github.com/line/armeria/blob/01f2c6f6ee49548c499b202be50fc9d3df84dd4f/oauth2/src/main/java/com/linecorp/armeria/client/auth/oauth2/OAuth2Client.java#L63-L69

Related: https://github.com/line/armeria/pull/4834

We need to think more about how to solve this, but the approach should be to remove access to RequestLog from RetryingClient.

ikhoon avatar May 30 '24 13:05 ikhoon