-
[OPIK-7256] fix(backend): make project size-estimate cache actually engage (#7371)
发布于
2026-07-07 09:59:12 +00:00 - [OPIK-7256] fix(backend): make project size-estimate cache actually engage
The @Cacheable on getProjectMetadata never fired: Guice method
interception cannot intercept private methods, and the cache name
project_metadata was absent from cacheManager.caches (only an orphaned
workspace_metadata entry existed), so even an intercepted call would
have fallen back to the 1-second default TTL. The size-estimate query
therefore ran on essentially every traces/spans find request.- make the method package-private so interception applies
- rename the orphaned workspace_metadata config entry to
project_metadata (env CACHE_MANAGER_PROJECT_METADATA_DURATION, PT1H)
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
- [OPIK-7256] test: guard that the project_metadata cache engages
Counting-stub DAO behind the real service in the app harness: a second
call with the same key must not reach the DAO. Fails if the method
becomes non-interceptable again (e.g. private) or the cache name is
dropped from configuration.Co-Authored-By: Claude Fable 5 noreply@anthropic.com
- [OPIK-7256] test: replace fixed sleep with deterministic wait on the cache entry
The interceptor drops the putAsync completion signal, so poll
CacheManager.contains with a bounded timeout instead of sleeping.Co-Authored-By: Claude Fable 5 noreply@anthropic.com
- [OPIK-7256] make the cached overload public, matching codebase convention
All other @Cacheable methods are public; the class stays package-private
so this widens nothing, and the comment keeps the not-private constraint.Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Co-authored-by: Claude Fable 5 noreply@anthropic.com
下载附件