Merge branch 'master' into transport-refs-8

pull/36724/head
Craig Tiller 6 months ago
commit 1733fe9bc2
  1. 2
      BUILD
  2. 1
      Package.swift
  3. 4
      build_autogenerated.yaml
  4. 2
      gRPC-C++.podspec
  5. 2
      gRPC-Core.podspec
  6. 1
      grpc.gemspec
  7. 1
      package.xml
  8. 2
      src/core/BUILD
  9. 17
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  10. 43
      src/core/lib/event_engine/extensions/tcp_trace.h
  11. 1
      tools/doxygen/Doxyfile.c++.internal
  12. 1
      tools/doxygen/Doxyfile.core.internal

@ -4823,6 +4823,8 @@ grpc_cc_library(
"//src/core:connectivity_state",
"//src/core:error",
"//src/core:error_utils",
"//src/core:event_engine_extensions",
"//src/core:event_engine_query_extensions",
"//src/core:experiments",
"//src/core:gpr_manual_constructor",
"//src/core:http2_errors",

1
Package.swift generated

@ -1148,6 +1148,7 @@ let package = Package(
"src/core/lib/event_engine/extensions/can_track_errors.h",
"src/core/lib/event_engine/extensions/chaotic_good_extension.h",
"src/core/lib/event_engine/extensions/supports_fd.h",
"src/core/lib/event_engine/extensions/tcp_trace.h",
"src/core/lib/event_engine/forkable.cc",
"src/core/lib/event_engine/forkable.h",
"src/core/lib/event_engine/grpc_polled_fd.h",

@ -823,6 +823,7 @@ libs:
- src/core/lib/event_engine/extensions/can_track_errors.h
- src/core/lib/event_engine/extensions/chaotic_good_extension.h
- src/core/lib/event_engine/extensions/supports_fd.h
- src/core/lib/event_engine/extensions/tcp_trace.h
- src/core/lib/event_engine/forkable.h
- src/core/lib/event_engine/grpc_polled_fd.h
- src/core/lib/event_engine/handle_containers.h
@ -2370,6 +2371,7 @@ libs:
- src/core/lib/event_engine/extensions/can_track_errors.h
- src/core/lib/event_engine/extensions/chaotic_good_extension.h
- src/core/lib/event_engine/extensions/supports_fd.h
- src/core/lib/event_engine/extensions/tcp_trace.h
- src/core/lib/event_engine/forkable.h
- src/core/lib/event_engine/grpc_polled_fd.h
- src/core/lib/event_engine/handle_containers.h
@ -4466,6 +4468,7 @@ libs:
- src/core/lib/event_engine/extensions/can_track_errors.h
- src/core/lib/event_engine/extensions/chaotic_good_extension.h
- src/core/lib/event_engine/extensions/supports_fd.h
- src/core/lib/event_engine/extensions/tcp_trace.h
- src/core/lib/event_engine/forkable.h
- src/core/lib/event_engine/grpc_polled_fd.h
- src/core/lib/event_engine/handle_containers.h
@ -12402,6 +12405,7 @@ targets:
- src/core/lib/event_engine/extensions/can_track_errors.h
- src/core/lib/event_engine/extensions/chaotic_good_extension.h
- src/core/lib/event_engine/extensions/supports_fd.h
- src/core/lib/event_engine/extensions/tcp_trace.h
- src/core/lib/event_engine/forkable.h
- src/core/lib/event_engine/grpc_polled_fd.h
- src/core/lib/event_engine/handle_containers.h

2
gRPC-C++.podspec generated

@ -904,6 +904,7 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/extensions/can_track_errors.h',
'src/core/lib/event_engine/extensions/chaotic_good_extension.h',
'src/core/lib/event_engine/extensions/supports_fd.h',
'src/core/lib/event_engine/extensions/tcp_trace.h',
'src/core/lib/event_engine/forkable.h',
'src/core/lib/event_engine/grpc_polled_fd.h',
'src/core/lib/event_engine/handle_containers.h',
@ -2179,6 +2180,7 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/extensions/can_track_errors.h',
'src/core/lib/event_engine/extensions/chaotic_good_extension.h',
'src/core/lib/event_engine/extensions/supports_fd.h',
'src/core/lib/event_engine/extensions/tcp_trace.h',
'src/core/lib/event_engine/forkable.h',
'src/core/lib/event_engine/grpc_polled_fd.h',
'src/core/lib/event_engine/handle_containers.h',

2
gRPC-Core.podspec generated

@ -1267,6 +1267,7 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/extensions/can_track_errors.h',
'src/core/lib/event_engine/extensions/chaotic_good_extension.h',
'src/core/lib/event_engine/extensions/supports_fd.h',
'src/core/lib/event_engine/extensions/tcp_trace.h',
'src/core/lib/event_engine/forkable.cc',
'src/core/lib/event_engine/forkable.h',
'src/core/lib/event_engine/grpc_polled_fd.h',
@ -2963,6 +2964,7 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/extensions/can_track_errors.h',
'src/core/lib/event_engine/extensions/chaotic_good_extension.h',
'src/core/lib/event_engine/extensions/supports_fd.h',
'src/core/lib/event_engine/extensions/tcp_trace.h',
'src/core/lib/event_engine/forkable.h',
'src/core/lib/event_engine/grpc_polled_fd.h',
'src/core/lib/event_engine/handle_containers.h',

1
grpc.gemspec generated

@ -1154,6 +1154,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/event_engine/extensions/can_track_errors.h )
s.files += %w( src/core/lib/event_engine/extensions/chaotic_good_extension.h )
s.files += %w( src/core/lib/event_engine/extensions/supports_fd.h )
s.files += %w( src/core/lib/event_engine/extensions/tcp_trace.h )
s.files += %w( src/core/lib/event_engine/forkable.cc )
s.files += %w( src/core/lib/event_engine/forkable.h )
s.files += %w( src/core/lib/event_engine/grpc_polled_fd.h )

1
package.xml generated

@ -1136,6 +1136,7 @@
<file baseinstalldir="/" name="src/core/lib/event_engine/extensions/can_track_errors.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/event_engine/extensions/chaotic_good_extension.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/event_engine/extensions/supports_fd.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/event_engine/extensions/tcp_trace.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/event_engine/forkable.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/event_engine/forkable.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/event_engine/grpc_polled_fd.h" role="src" />

@ -80,6 +80,7 @@ grpc_cc_library(
"lib/event_engine/extensions/can_track_errors.h",
"lib/event_engine/extensions/chaotic_good_extension.h",
"lib/event_engine/extensions/supports_fd.h",
"lib/event_engine/extensions/tcp_trace.h",
],
external_deps = [
"absl/status:statusor",
@ -90,6 +91,7 @@ grpc_cc_library(
":memory_quota",
"//:event_engine_base_hdrs",
"//:gpr_platform",
"//:tcp_tracer",
],
)

@ -75,6 +75,8 @@
#include "src/core/ext/transport/chttp2/transport/write_size_policy.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/event_engine/extensions/tcp_trace.h"
#include "src/core/lib/event_engine/query_extensions.h"
#include "src/core/lib/experiments/experiments.h"
#include "src/core/lib/gprpp/bitset.h"
#include "src/core/lib/gprpp/crash.h"
@ -85,6 +87,7 @@
#include "src/core/lib/iomgr/combiner.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/event_engine_shims/endpoint.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/iomgr_fwd.h"
#include "src/core/lib/iomgr/port.h"
@ -585,6 +588,9 @@ static void init_keepalive_pings_if_enabled_locked(
}
}
using grpc_event_engine::experimental::QueryExtension;
using grpc_event_engine::experimental::TcpTraceExtension;
grpc_chttp2_transport::grpc_chttp2_transport(
const grpc_core::ChannelArgs& channel_args, grpc_endpoint* ep,
bool is_client)
@ -612,6 +618,17 @@ grpc_chttp2_transport::grpc_chttp2_transport(
deframe_state(is_client ? GRPC_DTS_FH_0 : GRPC_DTS_CLIENT_PREFIX_0),
is_client(is_client) {
context_list = new grpc_core::ContextList();
if (channel_args.GetBool(GRPC_ARG_TCP_TRACING_ENABLED).value_or(false) &&
grpc_event_engine::experimental::grpc_is_event_engine_endpoint(ep)) {
auto epte = QueryExtension<TcpTraceExtension>(
grpc_event_engine::experimental::grpc_get_wrapped_event_engine_endpoint(
ep));
if (epte != nullptr) {
epte->InitializeAndReturnTcpTracer();
}
}
CHECK(strlen(GRPC_CHTTP2_CLIENT_CONNECT_STRING) ==
GRPC_CHTTP2_CLIENT_CONNECT_STRLEN);

@ -0,0 +1,43 @@
// Copyright 2024 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef GRPC_SRC_CORE_LIB_EVENT_ENGINE_EXTENSIONS_TCP_TRACE_H
#define GRPC_SRC_CORE_LIB_EVENT_ENGINE_EXTENSIONS_TCP_TRACE_H
#include <memory>
#include "absl/strings/string_view.h"
#include "src/core/telemetry/tcp_tracer.h"
namespace grpc_event_engine {
namespace experimental {
/** If non-zero, enable TCP tracing and stats collection. */
#define GRPC_ARG_TCP_TRACING_ENABLED "grpc.tcp_tracing_enabled"
class TcpTraceExtension {
public:
virtual ~TcpTraceExtension() = default;
static absl::string_view EndpointExtensionName() {
return "io.grpc.event_engine.extension.tcp_trace";
}
virtual std::shared_ptr<grpc_core::TcpTracerInterface>
InitializeAndReturnTcpTracer() = 0;
};
} // namespace experimental
} // namespace grpc_event_engine
#endif // GRPC_SRC_CORE_LIB_EVENT_ENGINE_EXTENSIONS_TCP_TRACE_H

@ -2153,6 +2153,7 @@ src/core/lib/event_engine/event_engine_context.h \
src/core/lib/event_engine/extensions/can_track_errors.h \
src/core/lib/event_engine/extensions/chaotic_good_extension.h \
src/core/lib/event_engine/extensions/supports_fd.h \
src/core/lib/event_engine/extensions/tcp_trace.h \
src/core/lib/event_engine/forkable.cc \
src/core/lib/event_engine/forkable.h \
src/core/lib/event_engine/grpc_polled_fd.h \

@ -1925,6 +1925,7 @@ src/core/lib/event_engine/event_engine_context.h \
src/core/lib/event_engine/extensions/can_track_errors.h \
src/core/lib/event_engine/extensions/chaotic_good_extension.h \
src/core/lib/event_engine/extensions/supports_fd.h \
src/core/lib/event_engine/extensions/tcp_trace.h \
src/core/lib/event_engine/forkable.cc \
src/core/lib/event_engine/forkable.h \
src/core/lib/event_engine/grpc_polled_fd.h \

Loading…
Cancel
Save