failsafe-lib/failsafe

Failsafe okhttp integration causes issues with BearerAuth and outdated tokens

shauser opened this issue · 0 comments

When using HttpBearerAuth with any type of expiring / non-reusable tokens the default setup as documented on https://failsafe.dev/okhttp/ causes issues: It can happen that a circuit breaker or retry policy causes enough delay for the token to expire.

It seems that the only way to address this right now is to check for status 401 and then re-create the call and executor, which causes the retry policy to be reset.