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

   <!-- Base branch: `rocketmq-studio`, the RocketMQ Studio trunk. -->
   
   ### Brief Description
   
   `ProxyAddressService` stores and validates an IPv6 proxy address in URI form 
(`[2001:db8::1]:8081`),
   but it passed the host **with** its brackets to the TCP probe
   (`ProxyAddressService.buildTopology` and 
`ProxyAddressService.previewReloadForInstance`).
   `InetSocketAddress` cannot resolve `[2001:db8::1]`: the address stays 
unresolved, the connect
   throws `UnknownHostException` and `SocketProxyHealthProbe` degrades it to 
*unreachable*, so a
   reachable IPv6 proxy was always reported `DOWN` (and 
`remotingReachable=false`) by
   `GET /api/proxies/topology` and by the per-Instance reload preview. 
`ApacheRocketMqProxyMetricsCollector.resolveGrpcTarget`
   already strips the URI brackets before probing, so this was an inconsistent 
probe target.
   
   The probe target is now the bare address literal, via one small helper used 
by both call sites;
   the displayed address is unchanged (`[2001:db8::1]:8081`).
   
   ### How Did You Test This Change?
   
   Two new test methods in `ProxyAddressServiceTest`: the first registers 
`[2001:db8::1]:8081` and
   asserts that no probe ever receives the bracketed host and that the topology 
row is `UP`; the
   second asserts the same for `previewReloadForInstance` on a discovered IPv6 
proxy.
   
   Before the fix (red):
   
   ```
   $ cd server && mvn -B -ntp test -Dtest=ProxyAddressServiceTest
   [ERROR] Tests run: 22, Failures: 2, Errors: 0, Skipped: 0
   buildTopologyShouldProbeBracketedIpv6ProxyByItsBareAddressLiteral:
     Expecting ArrayList:
       ["127.0.0.1", "127.0.0.1", "[2001:db8::1]", "[2001:db8::1]"]
     to contain:
       ["2001:db8::1"]
   instancePreviewShouldProbeBracketedIpv6ProxyByItsBareAddressLiteral:
     healthProbe.probe("[2001:db8::1]", 8081, 2000)
     instead of
     healthProbe.probe("2001:db8::1", 8081, <any integer>)
   ```
   
   After the fix (green) — the whole class, plus the neighbouring proxy classes:
   
   ```
   $ cd server && mvn -B -ntp test -Dtest=ProxyAddressServiceTest
   [INFO] Tests run: 22, Failures: 0, Errors: 0, Skipped: 0
   [INFO] BUILD SUCCESS
   
   $ cd server && mvn -B -ntp test 
-Dtest='ProxyControllerTest,ProxyCompatControllerTest,ApacheRocketMqProxyMetricsCollectorTest'
   [INFO] Tests run: 17, Failures: 0, Errors: 0, Skipped: 0
   [INFO] BUILD SUCCESS
   ```
   
   `mvn test` runs checkstyle in the `validate` phase: `You have 0 Checkstyle 
violations.`
   
   Note on the full suite: on a clean `rocketmq-studio` checkout `mvn -B -ntp 
test` already reports
   `Tests run: 3051, Failures: 6, Errors: 25, Skipped: 4`. The 11 red classes 
are the MySQL 8 backed
   Spring integration tests (`AuthServiceBootstrapIntegrationTest`,
   `AuthServiceConcurrencyIntegrationTest`, 
`AuthServiceSessionOverviewIntegrationTest`,
   `HealthProbeIntegrationTest`, `QueryHistoryServiceIntegrationTest`,
   `NativeAlertEvaluationTransactionTest`, 
`NotificationOutboxMapperIntegrationTest`,
   `RmqAlertStateMapperIntegrationTest`, `StudioApplicationTest`) plus the 
external-CLI ones
   (`CliAgentProviderTest`, `ClaudeCodeAgentProviderTest`). None of them are 
touched by this change.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`fix:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
(no UI text in this change)
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [x] New source files carry the ASF license header (no new files)
   - [x] Documentation touched where behaviour changed (no documented contract 
change: the endpoint already promised live `UP`/`PARTIAL`/`DOWN` status per 
registered proxy)
   


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