[Geo] Fix token timeout issue for container registry sync
What does this MR do and why?
We use memoization for an HTTP client when it's set up with auth data and other parameters. The token is relatively short-living, 5 minutes by default, so for large containers, we can get an authentication error due to the timeout. Ideally, we would want to re-generate the token when it's expired and we get an appropriate error message but unfortunately, the registry just raises a common "unauthenticated error" so we have no chance to differentiate it from the wrongly specified credentials in the config file. This MR adds a memoization utility with an expiration policy and uses it for registry clients to fix the issue. To some extent, it can be considered as an optimization because the failed job will be retried anyway, so in this case, we don't let it fail too early so amount of attempts will be decreased.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #384862 (closed)