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

[pull] master from grpc:master #603

Merged
merged 5 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ python_config_settings()
# This should be updated along with build_handwritten.yaml
g_stands_for = "gears" # @unused

core_version = "45.0.0" # @unused
core_version = "46.0.0" # @unused

version = "1.71.0-dev" # @unused

Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt

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

8 changes: 4 additions & 4 deletions Makefile

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

3 changes: 0 additions & 3 deletions bazel/experiments.bzl

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

2 changes: 1 addition & 1 deletion build_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.

module GrpcBuildConfig
CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-45.dll'
CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-46.dll'
end
2 changes: 1 addition & 1 deletion build_handwritten.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ settings:
'#08': Use "-preN" suffixes to identify pre-release versions
'#09': Per-language overrides are possible with (eg) ruby_version tag here
'#10': See the expand_version.py for all the quirks here
core_version: 45.0.0
core_version: 46.0.0
csharp_major_version: 2
g_stands_for: gears
protobuf_version: 3.29.0
Expand Down
20 changes: 1 addition & 19 deletions src/core/ext/transport/chttp2/transport/chttp2_transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,6 @@ using TaskHandle = ::grpc_event_engine::experimental::EventEngine::TaskHandle;

grpc_core::CallTracerAnnotationInterface* CallTracerIfSampled(
grpc_chttp2_stream* s) {
if (!grpc_core::IsTraceRecordCallopsEnabled()) {
return nullptr;
}
auto* call_tracer =
s->arena->GetContext<grpc_core::CallTracerAnnotationInterface>();
if (call_tracer == nullptr || !call_tracer->IsSampled()) {
Expand All @@ -242,9 +239,6 @@ grpc_core::CallTracerAnnotationInterface* CallTracerIfSampled(

std::shared_ptr<grpc_core::TcpTracerInterface> TcpTracerIfSampled(
grpc_chttp2_stream* s) {
if (!grpc_core::IsTraceRecordCallopsEnabled()) {
return nullptr;
}
auto* call_attempt_tracer =
s->arena->GetContext<grpc_core::CallTracerInterface>();
if (call_attempt_tracer == nullptr || !call_attempt_tracer->IsSampled()) {
Expand Down Expand Up @@ -1395,7 +1389,7 @@ static void trace_annotations(grpc_chttp2_stream* s) {
.Add(s->t->flow_control.stats())
.Add(s->flow_control.stats()));
}
} else if (grpc_core::IsTraceRecordCallopsEnabled()) {
} else {
auto* call_tracer = s->arena->GetContext<grpc_core::CallTracerInterface>();
if (call_tracer != nullptr && call_tracer->IsSampled()) {
call_tracer->RecordAnnotation(
Expand Down Expand Up @@ -1504,18 +1498,6 @@ static void send_message_locked(
absl::OkStatus(),
"fetching_send_message_finished");
} else {
// Buffer hint is used to buffer the message in the transport until the
// write buffer size (specified through GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE) is
// reached. This is to batch writes sent down to tcp. However, if the memory
// pressure is high, disable the buffer hint to flush data down to tcp as
// soon as possible to avoid OOM.
if (grpc_core::IsDisableBufferHintOnHighMemoryPressureEnabled() &&
t->memory_owner.GetPressureInfo().pressure_control_value >= 0.8) {
// Disable write buffer hint if memory pressure is high. The value of 0.8
// is chosen to match the threshold used by the tcp endpoint (in
// allocating memory for socket reads).
op_payload->send_message.flags &= ~GRPC_WRITE_BUFFER_HINT;
}
flags = op_payload->send_message.flags;
uint8_t* frame_hdr = grpc_slice_buffer_tiny_add(&s->flow_controlled_buffer,
GRPC_HEADER_SIZE_IN_BYTES);
Expand Down
40 changes: 1 addition & 39 deletions src/core/ext/transport/chttp2/transport/stream_lists.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,26 +128,6 @@ static void stream_list_add_tail(grpc_chttp2_transport* t,
<< "]: add to " << stream_list_id_string(id);
}

static void stream_list_add_head(grpc_chttp2_transport* t,
grpc_chttp2_stream* s,
grpc_chttp2_stream_list_id id) {
grpc_chttp2_stream* old_head;
CHECK(!s->included.is_set(id));
old_head = t->lists[id].head;
s->links[id].next = old_head;
s->links[id].prev = nullptr;
if (old_head) {
old_head->links[id].prev = s;
} else {
t->lists[id].tail = s;
}
t->lists[id].head = s;
s->included.set(id);
GRPC_TRACE_LOG(http2_stream_state, INFO)
<< t << "[" << s->id << "][" << (t->is_client ? "cli" : "svr")
<< "]: add to " << stream_list_id_string(id);
}

static bool stream_list_add(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
grpc_chttp2_stream_list_id id) {
if (s->included.is_set(id)) {
Expand All @@ -157,24 +137,11 @@ static bool stream_list_add(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
return true;
}

static bool stream_list_prepend(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
grpc_chttp2_stream_list_id id) {
if (s->included.is_set(id)) {
return false;
}
stream_list_add_head(t, s, id);
return true;
}

// wrappers for specializations

bool grpc_chttp2_list_add_writable_stream(grpc_chttp2_transport* t,
grpc_chttp2_stream* s) {
CHECK_NE(s->id, 0u);
if (grpc_core::IsPrioritizeFinishedRequestsEnabled() &&
s->send_trailing_metadata != nullptr) {
return stream_list_prepend(t, s, GRPC_CHTTP2_LIST_WRITABLE);
}
return stream_list_add(t, s, GRPC_CHTTP2_LIST_WRITABLE);
}

Expand Down Expand Up @@ -219,12 +186,7 @@ void grpc_chttp2_list_remove_waiting_for_concurrency(grpc_chttp2_transport* t,

void grpc_chttp2_list_add_stalled_by_transport(grpc_chttp2_transport* t,
grpc_chttp2_stream* s) {
if (grpc_core::IsPrioritizeFinishedRequestsEnabled() &&
s->send_trailing_metadata != nullptr) {
stream_list_prepend(t, s, GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT);
} else {
stream_list_add(t, s, GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT);
}
stream_list_add(t, s, GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT);
}

bool grpc_chttp2_list_pop_stalled_by_transport(grpc_chttp2_transport* t,
Expand Down
4 changes: 2 additions & 2 deletions src/core/ext/transport/chttp2/transport/writing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ class StreamWriteContext {
.Add(s_->flow_control.stats())
.Add(write_stats));
}
} else if (grpc_core::IsTraceRecordCallopsEnabled()) {
} else {
auto* call_tracer =
s_->arena->GetContext<grpc_core::CallTracerInterface>();
if (call_tracer != nullptr && call_tracer->IsSampled()) {
Expand Down Expand Up @@ -646,7 +646,7 @@ class StreamWriteContext {
.Add(s_->t->flow_control.stats())
.Add(s_->flow_control.stats()));
}
} else if (grpc_core::IsTraceRecordCallopsEnabled()) {
} else {
auto* call_tracer =
s_->arena->GetContext<grpc_core::CallTracerInterface>();
if (call_tracer != nullptr && call_tracer->IsSampled()) {
Expand Down
Loading
Loading