Aias00 opened a new pull request, #4761: URL: https://github.com/apache/rocketmq-dashboard/pull/4761
## Summary - wrap cached admin, producer, and pull-consumer clients in a package-private reference-counted `ClientLease` - remove retired entries from their caches immediately while deferring `shutdown()` until admitted actions finish - make the final `closed` check and lease acquisition atomic with shutdown through a fair lifecycle read/write gate - preserve cache keys, public APIs, connection creation, authentication isolation, exception mapping, and instance update ownership boundaries - add deterministic concurrency regressions for endpoint release, credential-scoped release, shutdown draining, replacement-client creation, and creation racing with shutdown Fixes #4755 ## Scope This is the pure lifecycle refactor requested during review of #4387. It changes only: - `ClientLease` - `MqAdminExtFactory` - `MqClientPool` - their focused tests It does not include Ops runtime connection persistence, default/no-instance routing, transport-setting changes, provider constructor changes, `application.yml`, or deploy/Compose files. ## Verification - Red/green: four release/shutdown tests first failed because clients were shut down while actions were still in flight. - Red/green: the shutdown-admission regression first showed an action running after `closed=true`; it now receives 503 without running and the unadmitted client is retired. - `mvn -B -ntp -Dtest=MqAdminExtFactoryTest,MqClientPoolTest,RuntimeAdminClientResolverTest,InstanceServiceTest test` with Java 21: 111 tests passed; Checkstyle 0 violations. - Full backend suite with Java 21 and an isolated H2 MySQL-compatible datasource: 3079 tests, 0 failures/errors, 3 skipped; Checkstyle 0 violations. - `mvn -B -ntp -DskipTests package`: passed. - `git diff --check`: passed. - Independent concurrency review: initial HIGH shutdown-admission race fixed; focused re-review approved with 0 remaining findings. ## Direction The default RocketMQ connection remains fail-closed and non-editable at runtime under the current instance model. This PR retains only the lifecycle safety that applies to instance endpoint and credential updates. -- 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]
