zjncs opened a new pull request, #5794:
URL: https://github.com/apache/rocketmq-dashboard/pull/5794

   ### What
   
   Resubmission of #5606 against the `rocketmq-studio` branch, with the review 
feedback applied. The fix: remove `@Cacheable(DATA_SOURCE_CACHE)` from the 
parameterised, paginated `listDataSources` overload.
   
   ### Why
   
   `SettingsService.java:211-222` documents the cache as a cache of the **full 
list**; `CacheConfig` backs it with a bare `ConcurrentMapCacheManager` (no TTL, 
no size bound, no eviction); and `GET /api/settings/datasources/page` is not in 
`AuthInterceptor.isAdminOnlyGetPath`, so any authenticated reader can pin one 
permanent `PageResult` per distinct search term — each metric tab's search box 
is a slow memory leak with no upper bound.
   
   ### What changed
   
   - the parameterised overload keeps its validation and repository call; it 
simply stops participating in the cache. The full-list cache (the documented 
scope) is untouched, and every write path still evicts it via `allEntries`.
   - `SettingsServiceDataSourceCacheBoundTest` runs inside a real application 
context registering the production `CacheConfig`: the control proves the 
full-list cache works (repository hit exactly once), the bound test sends 50 
distinct searches and asserts **zero** permanent entries.
   
   ### Review feedback applied (from #5606)
   
   - test methods end with `Test`
   - trailing newlines verified
   - severity framing corrected: the cached `DataSourceVO` carries no 
credential fields — the argument is the unbounded heap alone
   - `@Configuration`/`@Bean` imported
   
   ### Verification
   
   - New tests on unmodified code: **2/2 green** with checkstyle clean.
   - Mutation: `@Cacheable` restored on the overload — the bound test reddens 
with 50 permanent entries; restored, 2/2 green.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to