RockteMQ-AI commented on issue #4201:
URL:
https://github.com/apache/rocketmq-dashboard/issues/4201#issuecomment-5604159650
**Issue Evaluation**
Category: `bug` | Status: **Confirmed**
The reported cache inconsistency has been verified against the
`rocketmq-studio` branch.
**Root Cause:** `InstanceService.deleteInstance()` →
`removeDataSourceBindings()` writes through `SettingsRepository` directly,
bypassing `SettingsService` where the `@CacheEvict("data-sources")` annotations
live. The DB row is updated correctly, but the cached list results (both full
and paged) keep returning the stale binding until another data-source mutation
or application restart. No TTL is configured on the default
`ConcurrentMapCacheManager`, so staleness is unbounded.
**Impact:** Data-source list endpoints (and downstream UI) can expose
deleted instance names in `DataSourceVO.instanceIds`. The batch
`deleteInstances()` path is equally affected since it routes through
`self.deleteInstance()`.
**Severity:** medium — read-consistency bug with unbounded stale duration,
but no data loss or security exposure.
**Fix hint:** Route the binding update through `SettingsService` (so
`@CacheEvict` fires), or add an explicit `@CacheEvict` call post-commit. Note
that `deleteInstance` is `@Transactional`, so eviction should run after commit
to avoid re-caching pre-commit data. The class already demonstrates this
pattern in `releaseApacheEndpointAfterCommit()` using
`TransactionSynchronization.afterCommit()`.
An automated fix proposal can be generated. Reply `/approve` to proceed with
PR generation.
---
*Automated evaluation by RockteMQ-AI*
--
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]