Skip to content

Commit

Permalink
Merge github.com:grpc/grpc into scala
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Dec 4, 2024
2 parents 214b5ec + e15fd5a commit 39895db
Show file tree
Hide file tree
Showing 773 changed files with 4,578 additions and 5,037 deletions.
1 change: 1 addition & 0 deletions Package.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions bazel/grpc_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ def grpc_deps():
if "com_google_protobuf" not in native.existing_rules():
http_archive(
name = "com_google_protobuf",
sha256 = "8766fce06ef41d79cb6037d04be37df3d5c493d9da92517a7243640d6389f03c",
strip_prefix = "protobuf-10ef3f77683f77fb3c059bf47725c27b3ff41e63",
sha256 = "cf2db029202bb8eb1471b9bae387cc475d15d9e99c547e6906155033f81249a5",
strip_prefix = "protobuf-2d4414f384dc499af113b5991ce3eaa9df6dd931",
urls = [
# https://github.com/protocolbuffers/protobuf/commits/v28.1
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/protobuf/archive/10ef3f77683f77fb3c059bf47725c27b3ff41e63.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/10ef3f77683f77fb3c059bf47725c27b3ff41e63.tar.gz",
# https://github.com/protocolbuffers/protobuf/commits/v29.0
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/protobuf/archive/2d4414f384dc499af113b5991ce3eaa9df6dd931.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/2d4414f384dc499af113b5991ce3eaa9df6dd931.tar.gz",
],
patches = [
"@com_github_grpc_grpc//third_party:protobuf.patch",
Expand Down
2 changes: 2 additions & 0 deletions build_autogenerated.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build_handwritten.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ settings:
core_version: 44.1.0
csharp_major_version: 2
g_stands_for: gridiron
protobuf_version: 3.28.1
protobuf_version: 3.29.0
supported_python_versions:
- '3.8'
- '3.9'
Expand Down
2 changes: 2 additions & 0 deletions gRPC-C++.podspec

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions gRPC-Core.podspec

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions grpc.gemspec

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/core/client_channel/direct_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void DirectChannel::StartCall(UnstartedCallHandler unstarted_handler) {
"start",
[interception_chain = interception_chain_, unstarted_handler]() mutable {
interception_chain->StartCall(std::move(unstarted_handler));
return []() { return Empty{}; };
return []() {};
});
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ext/transport/chaotic_good/client_transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ void ChaoticGoodClientTransport::AbortWithError() {
call_handler.SpawnInfallible("cancel", [call_handler]() mutable {
call_handler.PushServerTrailingMetadata(ServerMetadataFromStatus(
absl::UnavailableError("Transport closed.")));
return Empty{};
});
}
}
Expand Down
1 change: 0 additions & 1 deletion src/core/ext/transport/chaotic_good/data_endpoints.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ DataEndpoints::DataEndpoints(
input_queues](absl::StatusOr<SliceBuffer> buffer) {
input_queues->CompleteRead(ticket,
std::move(buffer));
return Empty{};
});
});
},
Expand Down
11 changes: 3 additions & 8 deletions src/core/ext/transport/chaotic_good/server_transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,8 @@ void ChaoticGoodServerTransport::AbortWithError() {
lock.Release();
for (const auto& pair : stream_map) {
auto call_initiator = pair.second;
call_initiator.SpawnInfallible("cancel", [call_initiator]() mutable {
call_initiator.Cancel();
return Empty{};
});
call_initiator.SpawnInfallible(
"cancel", [call_initiator]() mutable { call_initiator.Cancel(); });
}
}

Expand Down Expand Up @@ -418,10 +416,7 @@ absl::Status ChaoticGoodServerTransport::NewStream(
self->ExtractStream(stream_id);
if (call_initiator.has_value()) {
auto c = std::move(*call_initiator);
c.SpawnInfallible("cancel", [c]() mutable {
c.Cancel();
return Empty{};
});
c.SpawnInfallible("cancel", [c]() mutable { c.Cancel(); });
}
});
if (!on_done_added) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ void ChaoticGoodClientTransport::AbortWithError() {
call_handler.SpawnInfallible("cancel", [call_handler]() mutable {
call_handler.PushServerTrailingMetadata(ServerMetadataFromStatus(
absl::UnavailableError("Transport closed.")));
return Empty{};
});
}
}
Expand Down
12 changes: 3 additions & 9 deletions src/core/ext/transport/chaotic_good_legacy/server_transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ auto ChaoticGoodServerTransport::CallOutboundLoop(
GRPC_TRACE_VLOG(chaotic_good, 2)
<< "CHAOTIC_GOOD: CallOutboundLoop: stream_id=" << stream_id
<< " main_body_result=" << main_body_result;
return Empty{};
}),
call_initiator.PullServerTrailingMetadata(),
// Capture the call_initator to ensure the underlying call_spine
Expand Down Expand Up @@ -422,10 +421,8 @@ void ChaoticGoodServerTransport::AbortWithError() {
lock.Release();
for (const auto& pair : stream_map) {
auto call_initiator = pair.second;
call_initiator.SpawnInfallible("cancel", [call_initiator]() mutable {
call_initiator.Cancel();
return Empty{};
});
call_initiator.SpawnInfallible(
"cancel", [call_initiator]() mutable { call_initiator.Cancel(); });
}
}

Expand Down Expand Up @@ -474,10 +471,7 @@ absl::Status ChaoticGoodServerTransport::NewStream(
self->ExtractStream(stream_id);
if (call_initiator.has_value()) {
auto c = std::move(*call_initiator);
c.SpawnInfallible("cancel", [c]() mutable {
c.Cancel();
return Empty{};
});
c.SpawnInfallible("cancel", [c]() mutable { c.Cancel(); });
}
});
if (!on_done_added) {
Expand Down
24 changes: 22 additions & 2 deletions src/core/ext/transport/chttp2/transport/chttp2_transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,10 @@ static void read_channel_args(grpc_chttp2_transport* t,
t->max_concurrent_streams_overload_protection =
channel_args.GetBool(GRPC_ARG_MAX_CONCURRENT_STREAMS_OVERLOAD_PROTECTION)
.value_or(true);

t->max_concurrent_streams_reject_on_client =
channel_args.GetBool(GRPC_ARG_MAX_CONCURRENT_STREAMS_REJECT_ON_CLIENT)
.value_or(false);
}

static void init_keepalive_pings_if_enabled_locked(
Expand Down Expand Up @@ -1427,8 +1431,24 @@ static void send_initial_metadata_locked(
if (t->is_client) {
if (t->closed_with_error.ok()) {
CHECK_EQ(s->id, 0u);
grpc_chttp2_list_add_waiting_for_concurrency(t, s);
maybe_start_some_streams(t);
if (t->max_concurrent_streams_reject_on_client &&
t->stream_map.size() >=
t->settings.peer().max_concurrent_streams()) {
s->trailing_metadata_buffer.Set(
grpc_core::GrpcStreamNetworkState(),
grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
grpc_chttp2_cancel_stream(
t, s,
grpc_error_set_int(
GRPC_ERROR_CREATE_REFERENCING("Too many streams",
&t->closed_with_error, 1),
grpc_core::StatusIntProperty::kRpcStatus,
GRPC_STATUS_RESOURCE_EXHAUSTED),
false);
} else {
grpc_chttp2_list_add_waiting_for_concurrency(t, s);
maybe_start_some_streams(t);
}
} else {
s->trailing_metadata_buffer.Set(
grpc_core::GrpcStreamNetworkState(),
Expand Down
6 changes: 6 additions & 0 deletions src/core/ext/transport/chttp2/transport/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ struct grpc_chttp2_transport final : public grpc_core::FilterStackTransport,
/// True if we count stream allocation (instead of HTTP2 concurrency) for
/// MAX_CONCURRENT_STREAMS
bool max_concurrent_streams_overload_protection = false;
bool max_concurrent_streams_reject_on_client = false;

// What percentage of rst_stream frames on the server should cause a ping
// frame to be generated.
Expand Down Expand Up @@ -706,6 +707,11 @@ struct grpc_chttp2_stream {
#define GRPC_ARG_MAX_CONCURRENT_STREAMS_OVERLOAD_PROTECTION \
"grpc.http.overload_protection"

// EXPERIMENTAL: Fail requests at the client if the client is over max
// concurrent streams, so they may be retried elsewhere.
#define GRPC_ARG_MAX_CONCURRENT_STREAMS_REJECT_ON_CLIENT \
"grpc.http.max_concurrent_streams_reject_on_client"

/// Transport writing call flow:
/// grpc_chttp2_initiate_write() is called anywhere that we know bytes need to
/// go out on the wire.
Expand Down
6 changes: 3 additions & 3 deletions src/core/ext/upb-gen/envoy/admin/v3/certs.upb.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/core/ext/upb-gen/envoy/admin/v3/clusters.upb.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 39895db

Please sign in to comment.