[promises] Sketch out a spot for the in-process transport promise conversion (#34616)

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
pull/34673/head
Craig Tiller 1 year ago committed by GitHub
parent f15635287b
commit 8430af1614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CMakeLists.txt
  2. 2
      Makefile
  3. 2
      Package.swift
  4. 4
      build_autogenerated.yaml
  5. 1
      config.m4
  6. 1
      config.w32
  7. 2
      gRPC-C++.podspec
  8. 3
      gRPC-Core.podspec
  9. 2
      grpc.gemspec
  10. 2
      grpc.gyp
  11. 2
      package.xml
  12. 3
      src/core/BUILD
  13. 1283
      src/core/ext/transport/inproc/inproc_transport.cc
  14. 4
      src/core/ext/transport/inproc/inproc_transport.h
  15. 1290
      src/core/ext/transport/inproc/legacy_inproc_transport.cc
  16. 30
      src/core/ext/transport/inproc/legacy_inproc_transport.h
  17. 18
      src/core/lib/experiments/experiments.cc
  18. 8
      src/core/lib/experiments/experiments.h
  19. 6
      src/core/lib/experiments/experiments.yaml
  20. 1
      src/python/grpcio/grpc_core_dependencies.py
  21. 2
      tools/doxygen/Doxyfile.c++.internal
  22. 2
      tools/doxygen/Doxyfile.core.internal

2
CMakeLists.txt generated

@ -1846,6 +1846,7 @@ add_library(grpc
src/core/ext/transport/chttp2/transport/writing.cc
src/core/ext/transport/inproc/inproc_plugin.cc
src/core/ext/transport/inproc/inproc_transport.cc
src/core/ext/transport/inproc/legacy_inproc_transport.cc
src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c
src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c
src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c
@ -2884,6 +2885,7 @@ add_library(grpc_unsecure
src/core/ext/transport/chttp2/transport/writing.cc
src/core/ext/transport/inproc/inproc_plugin.cc
src/core/ext/transport/inproc/inproc_transport.cc
src/core/ext/transport/inproc/legacy_inproc_transport.cc
src/core/ext/upb-generated/google/api/annotations.upb.c
src/core/ext/upb-generated/google/api/http.upb.c
src/core/ext/upb-generated/google/protobuf/any.upb.c

2
Makefile generated

@ -1067,6 +1067,7 @@ LIBGRPC_SRC = \
src/core/ext/transport/chttp2/transport/writing.cc \
src/core/ext/transport/inproc/inproc_plugin.cc \
src/core/ext/transport/inproc/inproc_transport.cc \
src/core/ext/transport/inproc/legacy_inproc_transport.cc \
src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c \
src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c \
src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c \
@ -1957,6 +1958,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/transport/chttp2/transport/writing.cc \
src/core/ext/transport/inproc/inproc_plugin.cc \
src/core/ext/transport/inproc/inproc_transport.cc \
src/core/ext/transport/inproc/legacy_inproc_transport.cc \
src/core/ext/upb-generated/google/api/annotations.upb.c \
src/core/ext/upb-generated/google/api/http.upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.c \

2
Package.swift generated

@ -327,6 +327,8 @@ let package = Package(
"src/core/ext/transport/inproc/inproc_plugin.cc",
"src/core/ext/transport/inproc/inproc_transport.cc",
"src/core/ext/transport/inproc/inproc_transport.h",
"src/core/ext/transport/inproc/legacy_inproc_transport.cc",
"src/core/ext/transport/inproc/legacy_inproc_transport.h",
"src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c",
"src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h",
"src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c",

@ -315,6 +315,7 @@ libs:
- src/core/ext/transport/chttp2/transport/ping_rate_policy.h
- src/core/ext/transport/chttp2/transport/varint.h
- src/core/ext/transport/inproc/inproc_transport.h
- src/core/ext/transport/inproc/legacy_inproc_transport.h
- src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h
- src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h
- src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h
@ -1147,6 +1148,7 @@ libs:
- src/core/ext/transport/chttp2/transport/writing.cc
- src/core/ext/transport/inproc/inproc_plugin.cc
- src/core/ext/transport/inproc/inproc_transport.cc
- src/core/ext/transport/inproc/legacy_inproc_transport.cc
- src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c
- src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c
- src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c
@ -2059,6 +2061,7 @@ libs:
- src/core/ext/transport/chttp2/transport/ping_rate_policy.h
- src/core/ext/transport/chttp2/transport/varint.h
- src/core/ext/transport/inproc/inproc_transport.h
- src/core/ext/transport/inproc/legacy_inproc_transport.h
- src/core/ext/upb-generated/google/api/annotations.upb.h
- src/core/ext/upb-generated/google/api/http.upb.h
- src/core/ext/upb-generated/google/protobuf/any.upb.h
@ -2502,6 +2505,7 @@ libs:
- src/core/ext/transport/chttp2/transport/writing.cc
- src/core/ext/transport/inproc/inproc_plugin.cc
- src/core/ext/transport/inproc/inproc_transport.cc
- src/core/ext/transport/inproc/legacy_inproc_transport.cc
- src/core/ext/upb-generated/google/api/annotations.upb.c
- src/core/ext/upb-generated/google/api/http.upb.c
- src/core/ext/upb-generated/google/protobuf/any.upb.c

1
config.m4 generated

@ -154,6 +154,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/transport/chttp2/transport/writing.cc \
src/core/ext/transport/inproc/inproc_plugin.cc \
src/core/ext/transport/inproc/inproc_transport.cc \
src/core/ext/transport/inproc/legacy_inproc_transport.cc \
src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c \
src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c \
src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c \

1
config.w32 generated

@ -119,6 +119,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\transport\\chttp2\\transport\\writing.cc " +
"src\\core\\ext\\transport\\inproc\\inproc_plugin.cc " +
"src\\core\\ext\\transport\\inproc\\inproc_transport.cc " +
"src\\core\\ext\\transport\\inproc\\legacy_inproc_transport.cc " +
"src\\core\\ext\\upb-generated\\envoy\\admin\\v3\\certs.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\admin\\v3\\clusters.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\admin\\v3\\config_dump.upb.c " +

2
gRPC-C++.podspec generated

@ -386,6 +386,7 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/ping_rate_policy.h',
'src/core/ext/transport/chttp2/transport/varint.h',
'src/core/ext/transport/inproc/inproc_transport.h',
'src/core/ext/transport/inproc/legacy_inproc_transport.h',
'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h',
'src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h',
'src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h',
@ -1457,6 +1458,7 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/ping_rate_policy.h',
'src/core/ext/transport/chttp2/transport/varint.h',
'src/core/ext/transport/inproc/inproc_transport.h',
'src/core/ext/transport/inproc/legacy_inproc_transport.h',
'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h',
'src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h',
'src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h',

3
gRPC-Core.podspec generated

@ -430,6 +430,8 @@ Pod::Spec.new do |s|
'src/core/ext/transport/inproc/inproc_plugin.cc',
'src/core/ext/transport/inproc/inproc_transport.cc',
'src/core/ext/transport/inproc/inproc_transport.h',
'src/core/ext/transport/inproc/legacy_inproc_transport.cc',
'src/core/ext/transport/inproc/legacy_inproc_transport.h',
'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c',
'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h',
'src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c',
@ -2213,6 +2215,7 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/ping_rate_policy.h',
'src/core/ext/transport/chttp2/transport/varint.h',
'src/core/ext/transport/inproc/inproc_transport.h',
'src/core/ext/transport/inproc/legacy_inproc_transport.h',
'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h',
'src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h',
'src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h',

2
grpc.gemspec generated

@ -333,6 +333,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/inproc/inproc_plugin.cc )
s.files += %w( src/core/ext/transport/inproc/inproc_transport.cc )
s.files += %w( src/core/ext/transport/inproc/inproc_transport.h )
s.files += %w( src/core/ext/transport/inproc/legacy_inproc_transport.cc )
s.files += %w( src/core/ext/transport/inproc/legacy_inproc_transport.h )
s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c )

2
grpc.gyp generated

@ -385,6 +385,7 @@
'src/core/ext/transport/chttp2/transport/writing.cc',
'src/core/ext/transport/inproc/inproc_plugin.cc',
'src/core/ext/transport/inproc/inproc_transport.cc',
'src/core/ext/transport/inproc/legacy_inproc_transport.cc',
'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c',
'src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c',
'src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c',
@ -1217,6 +1218,7 @@
'src/core/ext/transport/chttp2/transport/writing.cc',
'src/core/ext/transport/inproc/inproc_plugin.cc',
'src/core/ext/transport/inproc/inproc_transport.cc',
'src/core/ext/transport/inproc/legacy_inproc_transport.cc',
'src/core/ext/upb-generated/google/api/annotations.upb.c',
'src/core/ext/upb-generated/google/api/http.upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',

2
package.xml generated

@ -315,6 +315,8 @@
<file baseinstalldir="/" name="src/core/ext/transport/inproc/inproc_plugin.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/inproc/inproc_transport.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/inproc/inproc_transport.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/inproc/legacy_inproc_transport.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/inproc/legacy_inproc_transport.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c" role="src" />

@ -5913,9 +5913,11 @@ grpc_cc_library(
srcs = [
"ext/transport/inproc/inproc_plugin.cc",
"ext/transport/inproc/inproc_transport.cc",
"ext/transport/inproc/legacy_inproc_transport.cc",
],
hdrs = [
"ext/transport/inproc/inproc_transport.h",
"ext/transport/inproc/legacy_inproc_transport.h",
],
external_deps = [
"absl/status",
@ -5931,6 +5933,7 @@ grpc_cc_library(
"channel_stack_type",
"closure",
"error",
"experiments",
"iomgr_fwd",
"slice",
"slice_buffer",

File diff suppressed because it is too large Load Diff

@ -1,5 +1,3 @@
//
//
// Copyright 2017 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -13,8 +11,6 @@
// 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_EXT_TRANSPORT_INPROC_INPROC_TRANSPORT_H
#define GRPC_SRC_CORE_EXT_TRANSPORT_INPROC_INPROC_TRANSPORT_H

File diff suppressed because it is too large Load Diff

@ -0,0 +1,30 @@
// Copyright 2017 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_EXT_TRANSPORT_INPROC_LEGACY_INPROC_TRANSPORT_H
#define GRPC_SRC_CORE_EXT_TRANSPORT_INPROC_LEGACY_INPROC_TRANSPORT_H
#include <grpc/support/port_platform.h>
#include <grpc/grpc.h>
#include "src/core/lib/debug/trace.h"
grpc_channel* grpc_legacy_inproc_channel_create(grpc_server* server,
const grpc_channel_args* args,
void* reserved);
extern grpc_core::TraceFlag grpc_inproc_trace;
#endif // GRPC_SRC_CORE_EXT_TRANSPORT_INPROC_LEGACY_INPROC_TRANSPORT_H

@ -99,6 +99,9 @@ const char* const description_promise_based_client_call =
"If set, use the new gRPC promise based call code when it's appropriate "
"(ie when all filters in a stack are promise based)";
const char* const additional_constraints_promise_based_client_call = "{}";
const char* const description_promise_based_inproc_transport =
"Use promises for the in-process transport.";
const char* const additional_constraints_promise_based_inproc_transport = "{}";
const char* const description_promise_based_server_call =
"If set, use the new gRPC promise based call code when it's appropriate "
"(ie when all filters in a stack are promise based)";
@ -226,6 +229,9 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_ping_on_rst_stream, true, true},
{"promise_based_client_call", description_promise_based_client_call,
additional_constraints_promise_based_client_call, false, true},
{"promise_based_inproc_transport",
description_promise_based_inproc_transport,
additional_constraints_promise_based_inproc_transport, false, true},
{"promise_based_server_call", description_promise_based_server_call,
additional_constraints_promise_based_server_call, false, true},
{"red_max_concurrent_streams", description_red_max_concurrent_streams,
@ -346,6 +352,9 @@ const char* const description_promise_based_client_call =
"If set, use the new gRPC promise based call code when it's appropriate "
"(ie when all filters in a stack are promise based)";
const char* const additional_constraints_promise_based_client_call = "{}";
const char* const description_promise_based_inproc_transport =
"Use promises for the in-process transport.";
const char* const additional_constraints_promise_based_inproc_transport = "{}";
const char* const description_promise_based_server_call =
"If set, use the new gRPC promise based call code when it's appropriate "
"(ie when all filters in a stack are promise based)";
@ -473,6 +482,9 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_ping_on_rst_stream, true, true},
{"promise_based_client_call", description_promise_based_client_call,
additional_constraints_promise_based_client_call, false, true},
{"promise_based_inproc_transport",
description_promise_based_inproc_transport,
additional_constraints_promise_based_inproc_transport, false, true},
{"promise_based_server_call", description_promise_based_server_call,
additional_constraints_promise_based_server_call, false, true},
{"red_max_concurrent_streams", description_red_max_concurrent_streams,
@ -593,6 +605,9 @@ const char* const description_promise_based_client_call =
"If set, use the new gRPC promise based call code when it's appropriate "
"(ie when all filters in a stack are promise based)";
const char* const additional_constraints_promise_based_client_call = "{}";
const char* const description_promise_based_inproc_transport =
"Use promises for the in-process transport.";
const char* const additional_constraints_promise_based_inproc_transport = "{}";
const char* const description_promise_based_server_call =
"If set, use the new gRPC promise based call code when it's appropriate "
"(ie when all filters in a stack are promise based)";
@ -720,6 +735,9 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_ping_on_rst_stream, true, true},
{"promise_based_client_call", description_promise_based_client_call,
additional_constraints_promise_based_client_call, false, true},
{"promise_based_inproc_transport",
description_promise_based_inproc_transport,
additional_constraints_promise_based_inproc_transport, false, true},
{"promise_based_server_call", description_promise_based_server_call,
additional_constraints_promise_based_server_call, false, true},
{"red_max_concurrent_streams", description_red_max_concurrent_streams,

@ -97,6 +97,7 @@ inline bool IsPickFirstHappyEyeballsEnabled() { return true; }
#define GRPC_EXPERIMENT_IS_INCLUDED_PING_ON_RST_STREAM
inline bool IsPingOnRstStreamEnabled() { return true; }
inline bool IsPromiseBasedClientCallEnabled() { return false; }
inline bool IsPromiseBasedInprocTransportEnabled() { return false; }
inline bool IsPromiseBasedServerCallEnabled() { return false; }
inline bool IsRedMaxConcurrentStreamsEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_REGISTERED_METHOD_LOOKUP_IN_TRANSPORT
@ -163,6 +164,7 @@ inline bool IsPickFirstHappyEyeballsEnabled() { return true; }
#define GRPC_EXPERIMENT_IS_INCLUDED_PING_ON_RST_STREAM
inline bool IsPingOnRstStreamEnabled() { return true; }
inline bool IsPromiseBasedClientCallEnabled() { return false; }
inline bool IsPromiseBasedInprocTransportEnabled() { return false; }
inline bool IsPromiseBasedServerCallEnabled() { return false; }
inline bool IsRedMaxConcurrentStreamsEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_REGISTERED_METHOD_LOOKUP_IN_TRANSPORT
@ -229,6 +231,7 @@ inline bool IsPickFirstHappyEyeballsEnabled() { return true; }
#define GRPC_EXPERIMENT_IS_INCLUDED_PING_ON_RST_STREAM
inline bool IsPingOnRstStreamEnabled() { return true; }
inline bool IsPromiseBasedClientCallEnabled() { return false; }
inline bool IsPromiseBasedInprocTransportEnabled() { return false; }
inline bool IsPromiseBasedServerCallEnabled() { return false; }
inline bool IsRedMaxConcurrentStreamsEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_REGISTERED_METHOD_LOOKUP_IN_TRANSPORT
@ -279,6 +282,7 @@ enum ExperimentIds {
kExperimentIdPickFirstHappyEyeballs,
kExperimentIdPingOnRstStream,
kExperimentIdPromiseBasedClientCall,
kExperimentIdPromiseBasedInprocTransport,
kExperimentIdPromiseBasedServerCall,
kExperimentIdRedMaxConcurrentStreams,
kExperimentIdRegisteredMethodLookupInTransport,
@ -387,6 +391,10 @@ inline bool IsPingOnRstStreamEnabled() {
inline bool IsPromiseBasedClientCallEnabled() {
return IsExperimentEnabled(kExperimentIdPromiseBasedClientCall);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_INPROC_TRANSPORT
inline bool IsPromiseBasedInprocTransportEnabled() {
return IsExperimentEnabled(kExperimentIdPromiseBasedInprocTransport);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_SERVER_CALL
inline bool IsPromiseBasedServerCallEnabled() {
return IsExperimentEnabled(kExperimentIdPromiseBasedServerCall);

@ -172,6 +172,12 @@
expiry: 2023/11/01
owner: ctiller@google.com
test_tags: ["core_end2end_test", "lame_client_test"]
- name: promise_based_inproc_transport
description:
Use promises for the in-process transport.
expiry: 2024/06/06
owner: ctiller@google.com
test_tags: []
- name: promise_based_server_call
description:
If set, use the new gRPC promise based call code when it's appropriate

@ -128,6 +128,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/transport/chttp2/transport/writing.cc',
'src/core/ext/transport/inproc/inproc_plugin.cc',
'src/core/ext/transport/inproc/inproc_transport.cc',
'src/core/ext/transport/inproc/legacy_inproc_transport.cc',
'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c',
'src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c',
'src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c',

@ -1330,6 +1330,8 @@ src/core/ext/transport/chttp2/transport/writing.cc \
src/core/ext/transport/inproc/inproc_plugin.cc \
src/core/ext/transport/inproc/inproc_transport.cc \
src/core/ext/transport/inproc/inproc_transport.h \
src/core/ext/transport/inproc/legacy_inproc_transport.cc \
src/core/ext/transport/inproc/legacy_inproc_transport.h \
src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c \
src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h \
src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c \

@ -1106,6 +1106,8 @@ src/core/ext/transport/chttp2/transport/writing.cc \
src/core/ext/transport/inproc/inproc_plugin.cc \
src/core/ext/transport/inproc/inproc_transport.cc \
src/core/ext/transport/inproc/inproc_transport.h \
src/core/ext/transport/inproc/legacy_inproc_transport.cc \
src/core/ext/transport/inproc/legacy_inproc_transport.h \
src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c \
src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h \
src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c \

Loading…
Cancel
Save