zmuxuny opened a new pull request, #5052: URL: https://github.com/apache/rocketmq-dashboard/pull/5052
### Which Issue(s) This PR Fixes - Fixes #5049 ### Brief Description Rotating an Aliyun credential invalidates its cached OpenAPI clients. Previously, `invalidateCredential` could finish while a cache miss was still building a client from the old secret; that client could then enter the cache after invalidation and be reused by later requests. Coordinate cache misses and invalidation on the factory monitor, so a client being created is published before invalidation removes and closes it. Cached lookups retain the direct `ConcurrentHashMap` read path. The change is scoped to the Aliyun OpenAPI client cache; the Tencent factory already coordinates its corresponding path. ### How Did You Test This Change? - Added a deterministic concurrency regression that pauses first-client creation, starts credential invalidation, then checks that the first client is closed and the next lookup creates a replacement. The final lookup failed against the unmodified `rocketmq-studio` code because it returned the old client. - `cd server && mvn -B -ntp -Dtest=AliyunClientFactoryTest,CloudCredentialServiceTest test` — 28 tests passed; Checkstyle passed. - `git diff --check` — passed. ### Checklist - [x] One coherent bug fix; no unrelated changes - [x] Conventional commit subject - [x] Regression test added with a `...Test` method name - [x] No new UI text, API contract, or source files -- 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]
