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

   Supersedes #5352 (stale-bot closed) — same concurrency fix, with all four 
review asks and both notes applied. The branch also merged onto the current 
`rocketmq-studio` cleanly.
   
   ## The fix
   
   A first `NettyRemotingClient.start()` failure left a permanently unstarted 
client published for any concurrent first-use caller, and the failing caller 
could hand a half-initialised client to `invokeSync`. The client is now 
published only after `start()` returned, and a failed candidate is disposed 
with its disposal failure chained onto the rethrown start failure via 
`addSuppressed`.
   
   ## Review asks from #5352, applied
   
   1. **Bounded shutdown:** shutdown no longer contends on the initialisation 
lock — it takes a `ReentrantLock.tryLock(5s)`; a hung `start()` therefore 
cannot stall `@PreDestroy` until SIGKILL, and a shutdown skipped for a client 
still initialising is logged and accepted (the JVM is going away either way).
   2. **No failure amplification:** a failed start now starts a 30s cooldown; 
within the window the memoized failure is rethrown without paying another 
construct/start/shutdown Netty lifecycle, so one group-list request costs at 
most one lifecycle instead of (groups x proxies) per request. The window is a 
package-visible field so tests can disable or extend it.
   3. `shutdownFailedCandidateQuietly` catches `RuntimeException` only, and the 
disposal failure is chained via `addSuppressed` on the rethrown start failure 
instead of vanishing into a log line.
   4. Both latch awaits are wrapped in `assertThat(...).as(...).isTrue()`, so a 
latch that never fires fails fast with a named assertion.
   5. Import order restored (`Mock` before `MockedConstruction`), and the 
concurrency test documents why both `invokeSync` labels are deliberately the 
same string.
   
   ## Tests
   
   `ProxyConsumerResolverTest` is 9/9: the two original mutation-sensitive 
regressions keep pinning the publication contract (the first-failure test runs 
with the cooldown disabled), plus a new 
`aFailedStartIsNotRetriedWithinTheCooldownWindowTest` asserting a second query 
inside the window rethrows the memoized failure and never constructs a second 
client.
   
   cc @lizhimins
   


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