Current behavior
Since v0.386.0, gorouter fails to unmarshal router.register NATS messages for any route configured with hash-based load balancing (loadbalancing: hash) that includes a hash_balance factor. The message is rejected as a validation error and dropped, so the endpoint is never registered — the route becomes unreachable (404 / stale until TTL expiry) even though the app and the registration message are healthy.
Observed log (gorouter.subscriber):
{"message":"validation-error","source":"gorouter.subscriber","data":{
"error":"json: cannot unmarshal string into Go struct field RegistryMessageOpts.options.hash_balance of type float64",
"payload":"{\"host\":\"10.0.73.2\",\"port\":0,\"tls_port\":61000,\"uris\":[\"...cf...sapcloud.io\"],\"protocol\":\"http1\",\"app\":\"e2483c52-...\",...,\"options\":{\"loadbalancing\":\"hash\",\"hash_header\":\"http-header-name\",\"hash_balance\":\"1.2\"}}",
"subject":"router.register"}}
Desired behavior
gorouter should again accept hash_balance when it arrives as a JSON string, matching the wire format that Cloud Controller and route-emitter actually produce.
Fix WIP: #584
Affected Version
v0.386.0 through v0.393.0 (latest). Introduced by commit 02a2a93 (PR #535); last unaffected release: v0.385.0.
Current behavior
Since v0.386.0, gorouter fails to unmarshal
router.registerNATS messages for any route configured with hash-based load balancing (loadbalancing: hash) that includes ahash_balancefactor. The message is rejected as a validation error and dropped, so the endpoint is never registered — the route becomes unreachable (404 / stale until TTL expiry) even though the app and the registration message are healthy.Observed log (
gorouter.subscriber):{"message":"validation-error","source":"gorouter.subscriber","data":{ "error":"json: cannot unmarshal string into Go struct field RegistryMessageOpts.options.hash_balance of type float64", "payload":"{\"host\":\"10.0.73.2\",\"port\":0,\"tls_port\":61000,\"uris\":[\"...cf...sapcloud.io\"],\"protocol\":\"http1\",\"app\":\"e2483c52-...\",...,\"options\":{\"loadbalancing\":\"hash\",\"hash_header\":\"http-header-name\",\"hash_balance\":\"1.2\"}}", "subject":"router.register"}}Desired behavior
gorouter should again accept
hash_balancewhen it arrives as a JSON string, matching the wire format that Cloud Controller and route-emitter actually produce.Fix WIP: #584
Affected Version
v0.386.0 through v0.393.0 (latest). Introduced by commit 02a2a93 (PR #535); last unaffected release: v0.385.0.