[alts] Update max concurrent streams to ALTS handshaker service to 100. (#37966)

This matches the gRPC-Go behavior.

Closes #37966

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37966 from matthewstevenson88:max-concurrent-streams 8395f097e4
PiperOrigin-RevId: 688180702
pull/37933/head^2
Matthew Stevenson 4 months ago committed by Copybara-Service
parent 4ef9cfdb18
commit 3ef7b76a0d
  1. 4
      src/core/tsi/alts/handshaker/alts_handshaker_client.cc
  2. 6
      test/core/tsi/alts/handshaker/alts_handshaker_client_test.cc

@ -929,11 +929,11 @@ void alts_handshaker_client_destroy(alts_handshaker_client* c) {
} }
size_t MaxNumberOfConcurrentHandshakes() { size_t MaxNumberOfConcurrentHandshakes() {
size_t max_concurrent_handshakes = 40; size_t max_concurrent_handshakes = 100;
absl::optional<std::string> env_var_max_concurrent_handshakes = absl::optional<std::string> env_var_max_concurrent_handshakes =
grpc_core::GetEnv(kMaxConcurrentStreamsEnvironmentVariable); grpc_core::GetEnv(kMaxConcurrentStreamsEnvironmentVariable);
if (env_var_max_concurrent_handshakes.has_value()) { if (env_var_max_concurrent_handshakes.has_value()) {
size_t effective_max_concurrent_handshakes = 40; size_t effective_max_concurrent_handshakes = 100;
if (absl::SimpleAtoi(*env_var_max_concurrent_handshakes, if (absl::SimpleAtoi(*env_var_max_concurrent_handshakes,
&effective_max_concurrent_handshakes)) { &effective_max_concurrent_handshakes)) {
max_concurrent_handshakes = effective_max_concurrent_handshakes; max_concurrent_handshakes = effective_max_concurrent_handshakes;

@ -512,17 +512,17 @@ TEST(AltsHandshakerClientTest, ScheduleRequestGrpcCallFailureTest) {
TEST(MaxNumberOfConcurrentHandshakesTest, Default) { TEST(MaxNumberOfConcurrentHandshakesTest, Default) {
grpc_core::UnsetEnv(kMaxConcurrentStreamsEnvironmentVariable); grpc_core::UnsetEnv(kMaxConcurrentStreamsEnvironmentVariable);
EXPECT_EQ(MaxNumberOfConcurrentHandshakes(), 40); EXPECT_EQ(MaxNumberOfConcurrentHandshakes(), 100);
} }
TEST(MaxNumberOfConcurrentHandshakesTest, EnvVarNotInt) { TEST(MaxNumberOfConcurrentHandshakesTest, EnvVarNotInt) {
grpc_core::SetEnv(kMaxConcurrentStreamsEnvironmentVariable, "not-a-number"); grpc_core::SetEnv(kMaxConcurrentStreamsEnvironmentVariable, "not-a-number");
EXPECT_EQ(MaxNumberOfConcurrentHandshakes(), 40); EXPECT_EQ(MaxNumberOfConcurrentHandshakes(), 100);
} }
TEST(MaxNumberOfConcurrentHandshakesTest, EnvVarNegative) { TEST(MaxNumberOfConcurrentHandshakesTest, EnvVarNegative) {
grpc_core::SetEnv(kMaxConcurrentStreamsEnvironmentVariable, "-10"); grpc_core::SetEnv(kMaxConcurrentStreamsEnvironmentVariable, "-10");
EXPECT_EQ(MaxNumberOfConcurrentHandshakes(), 40); EXPECT_EQ(MaxNumberOfConcurrentHandshakes(), 100);
} }
TEST(MaxNumberOfConcurrentHandshakesTest, EnvVarSuccess) { TEST(MaxNumberOfConcurrentHandshakesTest, EnvVarSuccess) {

Loading…
Cancel
Save