We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a5f777 commit f8f6139Copy full SHA for f8f6139
2 files changed
xds/src/main/java/io/grpc/xds/XdsClusterResource.java
@@ -215,7 +215,7 @@ private static StructOrError<CdsUpdate.Builder> parseNonAggregateCluster(
215
continue;
216
}
217
if (threshold.hasMaxRequests()) {
218
- maxConcurrentRequests = (long) threshold.getMaxRequests().getValue();
+ maxConcurrentRequests = Integer.toUnsignedLong(threshold.getMaxRequests().getValue());
219
220
221
xds/src/test/java/io/grpc/xds/GrpcXdsClientImplTestBase.java
@@ -4001,6 +4001,25 @@ public void sendToBadUrl() throws Exception {
4001
client.shutdown();
4002
4003
4004
+ @Test
4005
+ public void circuitBreakingConversionOf32bitIntTo64bitLongForMaxRequestNegativeValue() {
4006
+ DiscoveryRpcCall call = startResourceWatcher(XdsClusterResource.getInstance(), CDS_RESOURCE,
4007
+ cdsResourceWatcher);
4008
+ Any clusterCircuitBreakers = Any.pack(
4009
+ mf.buildEdsCluster(CDS_RESOURCE, null, "round_robin", null, null, false, null,
4010
+ "envoy.transport_sockets.tls", mf.buildCircuitBreakers(50, -1), null));
4011
+ call.sendResponse(CDS, clusterCircuitBreakers, VERSION_1, "0000");
4012
+
4013
+ // Client sent an ACK CDS request.
4014
+ call.verifyRequest(CDS, CDS_RESOURCE, VERSION_1, "0000", NODE);
4015
+ verify(cdsResourceWatcher).onChanged(cdsUpdateCaptor.capture());
4016
+ CdsUpdate cdsUpdate = cdsUpdateCaptor.getValue();
4017
4018
+ assertThat(cdsUpdate.clusterName()).isEqualTo(CDS_RESOURCE);
4019
+ assertThat(cdsUpdate.clusterType()).isEqualTo(ClusterType.EDS);
4020
+ assertThat(cdsUpdate.maxConcurrentRequests()).isEqualTo(4294967295L);
4021
+ }
4022
4023
@Test
4024
public void sendToNonexistentServer() throws Exception {
4025
// Setup xdsClient to fail on stream creation
0 commit comments