Aias00 opened a new issue, #1226:
URL: https://github.com/apache/rocketmq-dashboard/issues/1226

   ## Background
   
   RocketMQ Studio caches `DefaultMQAdminExt` connections per NameServer 
endpoint and Aliyun OpenAPI clients per credential/region. Existing lifecycle 
PRs release clients when an endpoint or credential is changed or deleted 
(#1185, #1213), but neither cache has a capacity or idle policy.
   
   ## Why this needs design first
   
   Evicting directly from the current `ConcurrentHashMap` and immediately 
calling `shutdown` / `close` can race with an in-flight request that already 
obtained the client. A size-only LRU implementation would therefore introduce 
request failures.
   
   ## Proposed direction
   
   - Wrap cached clients in an entry with lease/reference count and last-access 
metadata.
   - Acquire a lease before each action and release it in `finally`.
   - Evict only idle, unleased entries after a bounded capacity or TTL policy.
   - Define shutdown behavior for in-flight calls and test concurrent 
acquire/evict paths.
   - Keep invalidation on endpoint/credential mutations as an explicit forced 
lifecycle transition.
   
   ## Acceptance criteria
   
   - No active admin/OpenAPI action observes a client closed by cache eviction.
   - Cache size and idle lifetime are bounded and configurable.
   - Concurrent acquire, invalidate, eviction, and shutdown behavior have 
regression tests.
   
   ## Track
   
   Track 1 - Control Plane runtime client lifecycle.


-- 
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