Closed
Description
If the control plane sends MAX_UINT32 as the max_requests for circuit breaking, grpc-java will treat it as a negative number. That should cause circuit breaking to trigger for all RPCs.
max_requests
is a UInt32Value
, but that's encoded as a signed int
in Java. The code casts to long, but the sign is preserved:
To treat it as a uint32, you essentially need to AND it with 0xFFFFFFFFL to make it unsigned. Since this is in xDS, we can use Integer.toUnsignedLong(int)
(the main other convenience being Guava's UnsignedInts.toLong(int)
).
b/372943501