Skip to content

Commit

Permalink
Include max concurrent request limit in the error status for concurre…
Browse files Browse the repository at this point in the history
…nt connections limit exceeded
  • Loading branch information
kannanjgithub committed Jan 22, 2025
1 parent fc86084 commit 64aba22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion xds/src/main/java/io/grpc/xds/ClusterImplLoadBalancer.java
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ public PickResult pickSubchannel(PickSubchannelArgs args) {
dropStats.recordDroppedRequest();
}
return PickResult.withDrop(Status.UNAVAILABLE.withDescription(
"Cluster max concurrent requests limit exceeded"));
String.format("Cluster max concurrent requests limit of %d exceeded",
maxConcurrentRequests)));
}
}
final AtomicReference<ClusterLocality> clusterLocality =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ private void subtest_maxConcurrentRequests_appliedByLbConfig(boolean enableCircu
assertThat(result.getStatus().isOk()).isFalse();
assertThat(result.getStatus().getCode()).isEqualTo(Code.UNAVAILABLE);
assertThat(result.getStatus().getDescription())
.isEqualTo("Cluster max concurrent requests limit exceeded");
.isEqualTo("Cluster max concurrent requests limit of 100 exceeded");
assertThat(clusterStats.totalDroppedRequests()).isEqualTo(1L);
} else {
assertThat(result.getStatus().isOk()).isTrue();
Expand Down Expand Up @@ -667,7 +667,7 @@ private void subtest_maxConcurrentRequests_appliedByLbConfig(boolean enableCircu
assertThat(result.getStatus().isOk()).isFalse();
assertThat(result.getStatus().getCode()).isEqualTo(Code.UNAVAILABLE);
assertThat(result.getStatus().getDescription())
.isEqualTo("Cluster max concurrent requests limit exceeded");
.isEqualTo("Cluster max concurrent requests limit of 101 exceeded");
assertThat(clusterStats.totalDroppedRequests()).isEqualTo(1L);
} else {
assertThat(result.getStatus().isOk()).isTrue();
Expand Down Expand Up @@ -731,7 +731,7 @@ private void subtest_maxConcurrentRequests_appliedWithDefaultValue(
assertThat(result.getStatus().isOk()).isFalse();
assertThat(result.getStatus().getCode()).isEqualTo(Code.UNAVAILABLE);
assertThat(result.getStatus().getDescription())
.isEqualTo("Cluster max concurrent requests limit exceeded");
.isEqualTo("Cluster max concurrent requests limit of 1024 exceeded");
assertThat(clusterStats.totalDroppedRequests()).isEqualTo(1L);
} else {
assertThat(result.getStatus().isOk()).isTrue();
Expand Down

0 comments on commit 64aba22

Please sign in to comment.