Lyin-OTTF opened a new pull request, #5423:
URL: https://github.com/apache/eventmesh/pull/5423

   `ClusterMembership.addressOf` returned everything after the first `|` of the 
heartbeat value. Since the value carries load fields once a `LoadMeter` is 
wired (`<ts>|<addr>|<active>|<inflow>|<outflow>|<cpu>`), the address came back 
as `host:10105|0|0|0|0.42`, and `HttpForwarder` built 
`http://host:10105|0|0|0|0.42/internal/forward`. Every cross-instance forward 
failed with an illegal URL, so cluster delivery silently degraded to local-only 
delivery for that instance.
   
   `NacosMetaStore.namingRegister` had the same assumption from the other side: 
`value.split("\\|", 2)` put `host:10105|0|0|0|0.42` into the address slot, 
`split(":", 2)` then gave `parsePort` the string `10105|0|0|0|0.42`, and the 
naming instance was registered with an unusable port. That is the address 
`/session/recommend` hands to SDK clients.
   
   Both now call a shared `ClusterMembership.addressFromHeartbeat`, which cuts 
the value at the load separator and leaves values without load fields untouched.
   
   Verification on Windows, JDK 21:
   
   - `ClusterMembershipLoadTest` (8 tests) adds `addressOfIgnoresLoadFields` 
and `addressFromHeartbeatHandlesBothFormats`, and keeps the existing no-load / 
partial-load / malformed cases.
   - Reverting the two production files makes the suite fail to compile because 
the shared parser is gone; reverting only `addressOf` back to `substring(sep + 
1)` fails `addressOfIgnoresLoadFields` at runtime.
   - `./gradlew :eventmesh-runtime:test --tests "*ClusterMembershipLoadTest*"` 
— BUILD SUCCESSFUL.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to