You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)).
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 aUInt32Value
, but that's encoded as a signedint
in Java. The code casts to long, but the sign is preserved:grpc-java/xds/src/main/java/io/grpc/xds/XdsClusterResource.java
Line 216 in 4e8f7df
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'sUnsignedInts.toLong(int)
).b/372943501
CC @kannanjgithub
The text was updated successfully, but these errors were encountered: