uber / kraken

P2P Docker registry capable of distributing TBs of data in seconds
Apache License 2.0
6.13k stars 421 forks source link

Enable caching of agent readiness success #384

Open Anton-Kalpakchiev opened 1 day ago

Anton-Kalpakchiev commented 1 day ago

As described in https://github.com/uber/kraken/issues/371, the agent has a readiness endpoint, which checks its dependencies' readienss. This endpoint is already implemented. However, depending on usage, the endpoint might be called very frequently, which would result in many redundant checks being performed (for example if the endpoint is queried once per second). To address this, we are adding the ability to cache readiness success for a certain amount of time. If the endpoint is queried and succeeds, it will continue reporting success without making any readiness checks until the readiness cache TTL expires. The TTL is is configurable through the .yaml config. Failures are not cached.