RockteMQ-AI commented on issue #11189: URL: https://github.com/apache/rocketmq/issues/11189#issuecomment-5757329230
**Issue Evaluation** Category: `bug` | Status: **Confirmed** The reported race condition has been verified against the current codebase on the `develop` branch. **Root Cause:** `AuthorizationMetadataManagerImpl.createAcl/updateAcl/deleteAcl` calls `getAcl()` which returns the direct Caffeine cache reference (no defensive copy in `LocalAuthorizationMetadataProvider.getAcl()`), then mutates it in-place via `oldAcl.updatePolicy(...)` before persisting. The authorization hot path reads the same mutable object concurrently. **Impact:** - Torn reads: concurrent authorization checks can observe half-updated policy sets (ALLOW/DENY flip) - `ConcurrentModificationException` on concurrent structural modification - Cache divergence from disk if the RocksDB write fails after in-memory mutation **Severity:** high — affects correctness of the ACL authorization path under concurrent admin operations. **Suggested fix direction:** Return a defensive copy from `getAcl()`/`getUser()`, or restructure the write path to build a new immutable object and swap it into the cache only after successful persistence. 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]
