Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xds: Circuit breaking doesn't support unsigned 32 bits #11695

Open
ejona86 opened this issue Nov 14, 2024 · 0 comments
Open

xds: Circuit breaking doesn't support unsigned 32 bits #11695

ejona86 opened this issue Nov 14, 2024 · 0 comments
Labels
Milestone

Comments

@ejona86
Copy link
Member

ejona86 commented Nov 14, 2024

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:

maxConcurrentRequests = (long) threshold.getMaxRequests().getValue();

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

CC @kannanjgithub

@ejona86 ejona86 added the bug label Nov 14, 2024
@ejona86 ejona86 added this to the Next milestone Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant