yyqdbngt opened a new pull request, #2861:
URL: https://github.com/apache/rocketmq-dashboard/pull/2861

   ## Summary
   - Serialize `MqClientPool` client creation/insertion with 
`release()`/`shutdown()` via a `lifecycleLock`
   - Re-check `closed` under the lifecycle lock instead of inside the 
`computeIfAbsent` lambda
   - Make `createPullConsumer`/`createProducer` protected (test seam, mirroring 
`MqAdminExtFactory.newAdmin`) and add `MqClientPoolTest` with a regression test 
for the race
   
   ## Why
   `shutdown()` sets `closed`, scans `cache.values()`, and clears — but a 
concurrent request whose client was still being created (network I/O) passed 
the `closed` re-check *before* the slow creation and then inserted the started 
client *after* the scan/clear. That client was never shut down: its Netty 
threads and NameServer connections stayed alive past context destruction 
(started clients hold non-daemon threads, which can even hang JVM exit). 
`release()` had the same window.
   
   ## Testing
   - `mvn -Dtest=MqClientPoolTest test` → Tests run: 5, Failures: 0, Errors: 0 
(new test class)
   - `mvn -Dtest='RuntimeAdminClientResolverTest,RocketMQAdminClientImplTest' 
test` → 9/9 and 39/39 pass (direct consumers of the pool)
   


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