unbridled-41 commented on PR #11046: URL: https://github.com/apache/rocketmq/pull/11046#issuecomment-5556022599
**Evidence-chain audit (2026-09-06)** — every technical assertion in the PR body re-verified against source; tests re-run at the branch tip. Code-level anchors (personally re-read at the fix branch): - `DefaultBrokerHeartbeatManager#onBrokerHeartbeat` `prev != null` branch (main `:133-142` pre-fix) refreshes only timestamp/timeout/priority/epoch; `BrokerLiveInfo#setChannel` exists but is called **nowhere** in the file (grep `setChannel` → only the definition `BrokerLiveInfo.java:151-153`). - `onBrokerChannelClose` (`:147-161` pre-fix) evicts by channel **identity** match and fires `notifyBrokerInActive` on the stale match. - Wiring confirmed end-to-end: `BrokerHousekeepingService.onChannelClose/onChannelException/onChannelIdle` → `onBrokerChannelClose` (`BrokerHousekeepingService.java:38-50`); it is registered as the controller `ChannelEventListener` (`ControllerManager.java:82`, passed at `:123`) and handed to `DLedgerServer` (`DLedgerController.java:117→136`). `ControllerManager#onBrokerInactive` triggers `triggerElectMaster` when the evicted broker is the current master. - Nameserver-consistency claim in the body now verified directly: `RouteInfoManager.registerBroker` **replaces** the whole `BrokerLiveInfo` (carrying `ctx.channel()`) on every registration heartbeat (`namesrv/.../RouteInfoManager.java:373-380`), so the NameServer refreshes the channel every heartbeat — the controller did not. Fresh re-run at this PR's tip `a7accbf9b` (2026-09-06, JDK 21): ``` mvn -pl controller test -Dtest=DefaultBrokerHeartbeatManagerTest Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS ``` The jRaft heartbeat manager (`RaftBrokerHeartBeatManager`) routes live info through raft consensus with `channel = null` in its `BrokerLiveInfo`, so it has a different close-detection mechanism and is intentionally untouched by this fix. -- 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]
