Merge remote-tracking branch 'upstream/master' into token_fetcher_call_creds_prefetch_and_backoff

pull/37531/head
Mark D. Roth 6 months ago
commit 62517310c8
  1. 2
      .bazelversion
  2. 5
      BUILD
  3. 6
      bazel/grpc_build_system.bzl
  4. 4
      bazel/protobuf.bzl
  5. 2
      bazel/supported_versions.txt
  6. 6
      bazel/update_mirror.sh
  7. 2
      doc/bazel_support.md
  8. 2
      doc/environment_variables.md
  9. 2
      doc/grpc_xds_bootstrap_format.md
  10. 2
      doc/service_config.md
  11. 6
      doc/xds-test-descriptions.md
  12. 2
      examples/android/binder/java/io/grpc/binder/cpp/README.md
  13. 1
      examples/cpp/helloworld/greeter_async_client.cc
  14. 1
      examples/cpp/helloworld/greeter_async_client2.cc
  15. 1
      examples/cpp/helloworld/greeter_async_server.cc
  16. 2
      examples/cpp/xds/README.md
  17. 2
      include/grpc/credentials.h
  18. 2
      include/grpc/event_engine/README.md
  19. 2
      include/grpc/event_engine/internal/slice_cast.h
  20. 1
      include/grpc/event_engine/slice.h
  21. 1
      include/grpc/event_engine/slice_buffer.h
  22. 2
      include/grpc/grpc_crl_provider.h
  23. 2
      include/grpc/impl/channel_arg_names.h
  24. 1
      include/grpcpp/client_context.h
  25. 1
      include/grpcpp/completion_queue.h
  26. 2
      include/grpcpp/ext/call_metric_recorder.h
  27. 1
      include/grpcpp/impl/interceptor_common.h
  28. 1
      include/grpcpp/impl/metadata_map.h
  29. 1
      include/grpcpp/impl/proto_utils.h
  30. 1
      include/grpcpp/impl/server_callback_handlers.h
  31. 1
      include/grpcpp/impl/service_type.h
  32. 1
      include/grpcpp/impl/sync.h
  33. 4
      include/grpcpp/security/credentials.h
  34. 1
      include/grpcpp/security/tls_certificate_provider.h
  35. 1
      include/grpcpp/security/tls_certificate_verifier.h
  36. 1
      include/grpcpp/security/tls_credentials_options.h
  37. 2
      include/grpcpp/server_builder.h
  38. 1
      include/grpcpp/server_interface.h
  39. 1
      include/grpcpp/support/async_stream.h
  40. 1
      include/grpcpp/support/async_unary_call.h
  41. 3
      include/grpcpp/support/byte_buffer.h
  42. 1
      include/grpcpp/support/callback_common.h
  43. 1
      include/grpcpp/support/client_callback.h
  44. 1
      include/grpcpp/support/client_interceptor.h
  45. 2
      include/grpcpp/support/config.h
  46. 2
      include/grpcpp/support/interceptor.h
  47. 1
      include/grpcpp/support/method_handler.h
  48. 1
      include/grpcpp/support/proto_buffer_reader.h
  49. 1
      include/grpcpp/support/proto_buffer_writer.h
  50. 1
      include/grpcpp/support/server_interceptor.h
  51. 1
      include/grpcpp/support/sync_stream.h
  52. 4
      src/core/BUILD
  53. 1
      src/core/channelz/channelz.cc
  54. 1
      src/core/channelz/channelz_registry.cc
  55. 2
      src/core/client_channel/client_channel_internal.h
  56. 1
      src/core/client_channel/config_selector.h
  57. 2
      src/core/client_channel/dynamic_filters.cc
  58. 2
      src/core/client_channel/local_subchannel_pool.cc
  59. 1
      src/core/client_channel/retry_filter.h
  60. 179
      src/core/client_channel/retry_filter_legacy_call_data.cc
  61. 21
      src/core/client_channel/subchannel.cc
  62. 1
      src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc
  63. 2
      src/core/ext/filters/stateful_session/stateful_session_filter.cc
  64. 27
      src/core/ext/transport/chaotic_good/chaotic_good_transport.h
  65. 1
      src/core/ext/transport/chaotic_good/frame.cc
  66. 1
      src/core/ext/transport/chaotic_good/frame_header.cc
  67. 11
      src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc
  68. 7
      src/core/ext/transport/chaotic_good/server_transport.cc
  69. 1
      src/core/ext/transport/chaotic_good/server_transport.h
  70. 1
      src/core/ext/transport/chttp2/alpn/alpn.cc
  71. 1
      src/core/ext/transport/chttp2/transport/bin_encoder.cc
  72. 508
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  73. 1
      src/core/ext/transport/chttp2/transport/flow_control.h
  74. 1
      src/core/ext/transport/chttp2/transport/frame.cc
  75. 1
      src/core/ext/transport/chttp2/transport/frame_data.cc
  76. 1
      src/core/ext/transport/chttp2/transport/frame_goaway.cc
  77. 11
      src/core/ext/transport/chttp2/transport/frame_settings.cc
  78. 1
      src/core/ext/transport/chttp2/transport/frame_window_update.cc
  79. 1
      src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc
  80. 1
      src/core/ext/transport/chttp2/transport/hpack_parse_result.h
  81. 31
      src/core/ext/transport/chttp2/transport/parsing.cc
  82. 1
      src/core/ext/transport/chttp2/transport/ping_callbacks.cc
  83. 1
      src/core/ext/transport/chttp2/transport/varint.h
  84. 1
      src/core/ext/transport/chttp2/transport/write_size_policy.cc
  85. 33
      src/core/ext/transport/chttp2/transport/writing.cc
  86. 1
      src/core/ext/transport/cronet/transport/cronet_api_phony.cc
  87. 10
      src/core/handshaker/handshaker.cc
  88. 1
      src/core/handshaker/security/security_handshaker.cc
  89. 1
      src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc
  90. 1
      src/core/lib/channel/channel_stack.cc
  91. 1
      src/core/lib/channel/channel_stack.h
  92. 1
      src/core/lib/channel/channel_stack_builder_impl.cc
  93. 1
      src/core/lib/channel/connected_channel.cc
  94. 153
      src/core/lib/channel/promise_based_filter.cc
  95. 1
      src/core/lib/compression/compression_internal.cc
  96. 12
      src/core/lib/config/config_vars.cc
  97. 8
      src/core/lib/config/config_vars.h
  98. 4
      src/core/lib/config/config_vars.yaml
  99. 1
      src/core/lib/config/core_configuration.cc
  100. 1
      src/core/lib/config/core_configuration.h
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1 +1 @@
7.1.0
7.3.1

@ -2649,6 +2649,7 @@ grpc_cc_library(
tags = ["nofixdeps"],
visibility = ["@grpc:public"],
deps = [
"config_vars",
"grpc++",
"grpc++_config_proto",
"//src/proto/grpc/reflection/v1:reflection_proto",
@ -3943,7 +3944,6 @@ grpc_cc_library(
deps = [
"config",
"debug_location",
"event_engine_base_hdrs",
"exec_ctx",
"gpr",
"grpc_base",
@ -3955,16 +3955,17 @@ grpc_cc_library(
"orphanable",
"ref_counted_ptr",
"resource_quota_api",
"sockaddr_utils",
"uri_parser",
"//src/core:channel_args",
"//src/core:channel_args_preconditioning",
"//src/core:closure",
"//src/core:error",
"//src/core:error_utils",
"//src/core:event_engine_tcp_socket_utils",
"//src/core:handshaker_registry",
"//src/core:iomgr_fwd",
"//src/core:pollset_set",
"//src/core:resolved_address",
"//src/core:resource_quota",
"//src/core:slice",
"//src/core:slice_refcount",

@ -170,7 +170,7 @@ def grpc_cc_library(
srcs: The source files.
public_hdrs: The public headers.
hdrs: The headers.
external_deps: External depdendencies to be resolved.
external_deps: External dependencies to be resolved.
defines: Build defines to use.
deps: cc_library deps.
select_deps: deps included conditionally.
@ -529,7 +529,7 @@ def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data
timeout: The test timeout.
tags: The tags for the test.
exec_compatible_with: A list of constraint values that must be
satisifed for the platform.
satisfied for the platform.
exec_properties: A dictionary of strings that will be added to the
exec_properties of a platform selected for this target.
shard_count: The number of shards for this test.
@ -660,7 +660,7 @@ def grpc_sh_test(name, srcs = [], args = [], data = [], uses_polling = True, siz
timeout: The test timeout.
tags: The tags for the test.
exec_compatible_with: A list of constraint values that must be
satisifed for the platform.
satisfied for the platform.
exec_properties: A dictionary of strings that will be added to the
exec_properties of a platform selected for this target.
shard_count: The number of shards for this test.

@ -37,13 +37,13 @@ def well_known_proto_libs():
return ["@com_google_protobuf//:" + b for b in _WELL_KNOWN_PROTOS_BASE]
def is_well_known(label):
# Bazel surfaces labels as their undelying identity, even if they are referenced
# Bazel surfaces labels as their underlying identity, even if they are referenced
# via aliases. Bazel also does not currently provide a way to find the real label
# underlying an alias. So the implementation detail that the WKTs present at the
# top level of the protobuf repo are actually backed by targets in the
# //src/google/protobuf package leaks through here.
# We include both the alias path and the underlying path to be resilient to
# reversions of this change as well as for continuing compatiblity with repos
# reversions of this change as well as for continuing compatibility with repos
# that happen to pull in older versions of protobuf.
all_wkt_targets = (["@com_google_protobuf//:" + b for b in _WELL_KNOWN_PROTOS_BASE] +
["@com_google_protobuf//src/google/protobuf:" + b for b in _WELL_KNOWN_PROTOS_BASE])

@ -1,2 +1,2 @@
7.1.0
7.3.1
6.5.0

@ -60,9 +60,9 @@ function upload {
upload github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-linux-x86_64
upload github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-darwin-x86_64
upload github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-windows-x86_64.exe
upload github.com/bazelbuild/bazel/releases/download/7.1.0/bazel-7.1.0-linux-x86_64
upload github.com/bazelbuild/bazel/releases/download/7.1.0/bazel-7.1.0-darwin-x86_64
upload github.com/bazelbuild/bazel/releases/download/7.1.0/bazel-7.1.0-windows-x86_64.exe
upload github.com/bazelbuild/bazel/releases/download/7.3.1/bazel-7.3.1-linux-x86_64
upload github.com/bazelbuild/bazel/releases/download/7.3.1/bazel-7.3.1-darwin-x86_64
upload github.com/bazelbuild/bazel/releases/download/7.3.1/bazel-7.3.1-windows-x86_64.exe
# Collect the github archives to mirror from grpc_deps.bzl
grep -o '"https://github.com/[^"]*"' bazel/grpc_deps.bzl | sed 's/^"https:\/\///' | sed 's/"$//' | while read -r line ; do

@ -43,7 +43,7 @@ However individual releases may have a broader
compatibility range. The currently supported versions are captured by the
following list:
- [`7.1.0`](https://github.com/bazelbuild/bazel/releases/tag/7.1.0)
- [`7.3.1`](https://github.com/bazelbuild/bazel/releases/tag/7.3.1)
- [`6.5.0`](https://github.com/bazelbuild/bazel/releases/tag/6.5.0)
NOTE: gRPC doesn't support bzlmod yet.

@ -60,7 +60,7 @@ some configuration as environment variables that can be set.
- NONE - won't log any.
GRPC_VERBOSITY will set verbosity of absl logging.
- If the external application sets some other verbosity, then whatever is set later will be honoured.
- If nothing is set as GRPC_VERBOSITY, then the setting of the exernal application will be honoured.
- If nothing is set as GRPC_VERBOSITY, then the setting of the external application will be honoured.
- If nothing is set by the external application also, the default set by absl will be honoured.
<!-- END_OPEN_SOURCE_DOCUMENTATION -->

@ -8,7 +8,7 @@ gRPC expects the xDS bootstrap configuration to be specified as a JSON string.
The xDS bootstrap file location may be specified using the environment variable
`GRPC_XDS_BOOTSTRAP`. Alternatively, the bootstrap file contents may be
specified using the environment variable `GRPC_XDS_BOOTSTRAP_CONFIG`. If both
are specified, the former takes precendence.
are specified, the former takes precedence.
The xDS client inside of gRPC parses the bootstrap configuration specified by
one of the above means when it is created to configure itself.

@ -48,7 +48,7 @@ name, will return both the resolved addresses and the service config.
The name resolver returns the service config to the gRPC client in JSON form.
Individual resolver implementations determine where and in what format the
service config is stored. If the resolver implemention obtains the
service config is stored. If the resolver implementation obtains the
service config in protobuf form, it must convert it to JSON.
Alternatively, a resolver implementation may obtain the service config
already in JSON form, in which case it may return it directly. Or it

@ -640,17 +640,17 @@ There are four sub-tests:
1. `app_timeout_exceeded`
1. Test client configured to send UnaryCall RPCs with a 1s application
timeout, and metadata of `rpc-behavior: sleep-2`.
1. Test driver asserts client recieves ~100% status `DEADLINE_EXCEEDED`.
1. Test driver asserts client receives ~100% status `DEADLINE_EXCEEDED`.
1. `timeout_not_exceeded`
1. Test client configured to send UnaryCall RPCs with the default
application timeout (20 seconds), and no metadata.
1. Test driver asserts client recieves ~100% status `OK`.
1. Test driver asserts client receives ~100% status `OK`.
1. `timeout_exceeded` (executed with the below test case)
1. `timeout_different_route`
1. Test client configured to send UnaryCall RPCs and EmptyCall RPCs with
the default application timeout (20 seconds), and metadata of
`rpc-behavior: sleep-4`.
1. Test driver asserts client recieves ~100% status `OK` for EmptyCall
1. Test driver asserts client receives ~100% status `OK` for EmptyCall
and ~100% status `DEADLINE_EXCEEDED` for UnaryCall.
### api_listener

@ -3,7 +3,7 @@
## Build Instruction
1. Install Android SDK and NDK. Only NDK version >= 25 is supported. We tested against SDK Platform `33` and NDK `26.2.11394342`.
2. Make sure Bazel is at least `7.0`. Use `export OVERRIDE_BAZEL_VERSION=7.1.0` to selected a supported version listed in `bazel/supported_versions.txt` if necessary.
2. Make sure Bazel is at least `7.0`. Use `export OVERRIDE_BAZEL_VERSION=7.3.1` to selected a supported version listed in `bazel/supported_versions.txt` if necessary.
3. Point environment variables to install locations of SDK and NDK
```
export ANDROID_HOME=$HOME/android-sdk

@ -24,7 +24,6 @@
#include "absl/flags/parse.h"
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include <grpcpp/grpcpp.h>
#ifdef BAZEL_BUILD

@ -25,7 +25,6 @@
#include "absl/flags/parse.h"
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include <grpcpp/grpcpp.h>
#ifdef BAZEL_BUILD

@ -26,7 +26,6 @@
#include "absl/log/check.h"
#include "absl/strings/str_format.h"
#include <grpc/support/log.h>
#include <grpcpp/grpcpp.h>
#ifdef BAZEL_BUILD

@ -10,7 +10,7 @@ The client takes two command-line arguments -
The server takes three command-line arguments -
* port - Port on which the Hello World service is run. Defaults to 50051.
* mantenance_port - If secure mode is used (see below), the [Admin](https://github.com/grpc/proposal/blob/master/A38-admin-interface-api.md) service is exposed on this port. If secure mode is not used, `maintenance_port` is unused, and the Admin service is just exposed on `port`. Defaults to 50052.
* maintenance_port - If secure mode is used (see below), the [Admin](https://github.com/grpc/proposal/blob/master/A38-admin-interface-api.md) service is exposed on this port. If secure mode is not used, `maintenance_port` is unused, and the Admin service is just exposed on `port`. Defaults to 50052.
* secure - Bool value, defaults to true. When this is set, [XdsServerCredentials](https://github.com/grpc/proposal/blob/master/A29-xds-tls-security.md) will be used with a fallback on `InsecureServerCredentials`. If unset, `InsecureServerCredentials` will be used.
## Running the example

@ -103,7 +103,7 @@ GRPCAPI grpc_call_credentials* grpc_sts_credentials_create(
/** Context that can be used by metadata credentials plugin in order to create
auth related metadata. */
typedef struct {
/** The fully qualifed service url. */
/** The fully qualified service url. */
const char* service_url;
/** The method name of the RPC being called (not fully qualified).

@ -23,7 +23,7 @@ thresholds. To enable this feature, the memory allocation of read/write buffers
within an EventEngine must be acquired in the form of Slices from
SliceAllocators. This is covered more fully in the gRFC and code.
### Documentating expectations around callback execution
### Documenting expectations around callback execution
Some callbacks may be expensive to run. EventEngines should decide on and
document whether callback execution might block polling operations. This way,
application developers can plan accordingly (e.g., run their expensive callbacks

@ -24,7 +24,7 @@ namespace internal {
// with `SliceCast`. Both ways need to be declared (i.e. if
// SliceCastable<A,B> exists, you should declare
// SliceCastable<B,A> too).
// The type has no members, it's just the existance of the specialization that
// The type has no members, it's just the existence of the specialization that
// unlocks SliceCast usage for a type pair.
template <typename Result, typename T>
struct SliceCastable;

@ -25,7 +25,6 @@
#include <grpc/event_engine/internal/slice_cast.h>
#include <grpc/slice.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
// This public slice definition largely based of the internal grpc_core::Slice

@ -28,7 +28,6 @@
#include <grpc/impl/codegen/slice.h>
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
namespace grpc_event_engine {

@ -82,7 +82,7 @@ absl::StatusOr<std::shared_ptr<CrlProvider>> CreateDirectoryReloaderCrlProvider(
} // namespace experimental
} // namespace grpc_core
// TODO(gtcooke94) - Mark with api macro when all wrapped langauges support C++
// TODO(gtcooke94) - Mark with api macro when all wrapped languages support C++
// in core APIs
/**
* EXPERIMENTAL API - Subject to change

@ -259,7 +259,7 @@
issued by the tcp_write(). By default, this is set to 4. */
#define GRPC_ARG_TCP_TX_ZEROCOPY_MAX_SIMULT_SENDS \
"grpc.experimental.tcp_tx_zerocopy_max_simultaneous_sends"
/* Overrides the TCP socket recieve buffer size, SO_RCVBUF. */
/* Overrides the TCP socket receive buffer size, SO_RCVBUF. */
#define GRPC_ARG_TCP_RECEIVE_BUFFER_SIZE "grpc.tcp_receive_buffer_size"
/* Timeout in milliseconds to use for calls to the grpclb load balancer.
If 0 or unset, the balancer calls will have no deadline. */

@ -42,7 +42,6 @@
#include <grpc/impl/compression_types.h>
#include <grpc/impl/propagation_bits.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/create_auth_context.h>
#include <grpcpp/impl/metadata_map.h>
#include <grpcpp/impl/rpc_method.h>

@ -38,7 +38,6 @@
#include <grpc/grpc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <grpcpp/impl/codegen/rpc_service_method.h>
#include <grpcpp/impl/codegen/status.h>

@ -33,7 +33,7 @@ namespace experimental {
/// Records call metrics for the purpose of load balancing.
/// During an RPC, call \a ServerContext::ExperimentalGetCallMetricRecorder()
/// method to retrive the recorder for the current call.
/// method to retrieve the recorder for the current call.
class CallMetricRecorder {
public:
virtual ~CallMetricRecorder() = default;

@ -25,7 +25,6 @@
#include "absl/log/absl_check.h"
#include <grpc/impl/grpc_types.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/call.h>
#include <grpcpp/impl/call_op_set_interface.h>
#include <grpcpp/impl/intercepted_channel.h>

@ -22,7 +22,6 @@
#include <map>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpcpp/support/slice.h>
namespace grpc {

@ -26,7 +26,6 @@
#include <grpc/byte_buffer_reader.h>
#include <grpc/impl/grpc_types.h>
#include <grpc/slice.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/codegen/config_protobuf.h>
#include <grpcpp/impl/serialization_traits.h>
#include <grpcpp/support/byte_buffer.h>

@ -22,7 +22,6 @@
#include <grpc/grpc.h>
#include <grpc/impl/call.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/rpc_service_method.h>
#include <grpcpp/server_context.h>
#include <grpcpp/support/message_allocator.h>

@ -21,7 +21,6 @@
#include "absl/log/absl_check.h"
#include <grpc/support/log.h>
#include <grpcpp/impl/rpc_service_method.h>
#include <grpcpp/impl/serialization_traits.h>
#include <grpcpp/server_interface.h>

@ -30,7 +30,6 @@
#include "absl/log/absl_check.h"
#include "absl/synchronization/mutex.h"
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>

@ -247,7 +247,7 @@ class MetadataCredentialsPlugin {
/// Type of credentials this plugin is implementing.
virtual const char* GetType() const { return ""; }
/// Gets the auth metatada produced by this plugin.
/// Gets the auth metadata produced by this plugin.
/// The fully qualified method name is:
/// service_url + "/" + method_name.
/// The channel_auth_context contains (among other things), the identity of
@ -295,7 +295,7 @@ grpc::Status StsCredentialsOptionsFromJson(const std::string& json_string,
/// Creates STS credentials options from the $STS_CREDENTIALS environment
/// variable. This environment variable points to the path of a JSON file
/// comforming to the schema described above.
/// conforming to the schema described above.
grpc::Status StsCredentialsOptionsFromEnv(StsCredentialsOptions* options);
std::shared_ptr<CallCredentials> StsCredentials(

@ -24,7 +24,6 @@
#include <grpc/grpc_security.h>
#include <grpc/grpc_security_constants.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpcpp/support/config.h>
namespace grpc {

@ -25,7 +25,6 @@
#include <grpc/grpc_security_constants.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/impl/sync.h>
#include <grpcpp/support/config.h>

@ -25,7 +25,6 @@
#include <grpc/grpc_security.h>
#include <grpc/grpc_security_constants.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpcpp/security/tls_certificate_provider.h>
#include <grpcpp/security/tls_certificate_verifier.h>
#include <grpcpp/security/tls_crl_provider.h>

@ -297,7 +297,7 @@ class ServerBuilder {
// Creates a passive listener for Server Endpoint injection.
///
/// \a PasiveListener lets applications provide pre-established connections
/// \a PassiveListener lets applications provide pre-established connections
/// to gRPC Servers. The server will behave as if it accepted the connection
/// itself on its own listening addresses.
///

@ -23,7 +23,6 @@
#include <grpc/grpc.h>
#include <grpc/impl/grpc_types.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>
#include <grpcpp/impl/call.h>

@ -22,7 +22,6 @@
#include "absl/log/absl_check.h"
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/call.h>
#include <grpcpp/impl/channel_interface.h>
#include <grpcpp/impl/service_type.h>

@ -22,7 +22,6 @@
#include "absl/log/absl_check.h"
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpcpp/client_context.h>
#include <grpcpp/impl/call.h>
#include <grpcpp/impl/call_op_set.h>

@ -23,7 +23,6 @@
#include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/serialization_traits.h>
#include <grpcpp/support/config.h>
#include <grpcpp/support/slice.h>
@ -59,7 +58,7 @@ class GrpcByteBufferPeer;
/// A sequence of bytes.
class ByteBuffer final {
public:
/// Constuct an empty buffer.
/// Construct an empty buffer.
ByteBuffer() : buffer_(nullptr) {}
/// Construct buffer from \a slices, of which there are \a nslices.

@ -25,7 +25,6 @@
#include <grpc/grpc.h>
#include <grpc/impl/grpc_types.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/call.h>
#include <grpcpp/impl/codegen/channel_interface.h>
#include <grpcpp/impl/completion_queue_tag.h>

@ -26,7 +26,6 @@
#include <grpc/grpc.h>
#include <grpc/impl/call.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/call.h>
#include <grpcpp/impl/call_op_set.h>
#include <grpcpp/impl/sync.h>

@ -24,7 +24,6 @@
#include "absl/log/absl_check.h"
#include <grpc/support/log.h>
#include <grpcpp/impl/rpc_method.h>
#include <grpcpp/support/interceptor.h>
#include <grpcpp/support/string_ref.h>

@ -35,7 +35,7 @@ namespace grpc {
// Using grpc::string and grpc::to_string is discouraged in favor of
// std::string and std::to_string. This is only for legacy code using
// them explictly.
// them explicitly.
using std::string; // deprecated // NOLINT(misc-unused-using-decls)
using std::to_string; // deprecated // NOLINT(misc-unused-using-decls)

@ -133,7 +133,7 @@ class InterceptorBatchMethods {
/// means that the payload would be available in the serialized form only
/// unless an interceptor replaces the payload with ModifySendMessage.
/// Returns a modifable ByteBuffer holding the serialized form of the message
/// Returns a modifiable ByteBuffer holding the serialized form of the message
/// that is going to be sent. Valid for PRE_SEND_MESSAGE interceptions.
/// A return value of nullptr indicates that this ByteBuffer is not valid.
virtual ByteBuffer* GetSerializedSendMessage() = 0;

@ -22,7 +22,6 @@
#include "absl/log/absl_check.h"
#include <grpc/byte_buffer.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/rpc_service_method.h>
#include <grpcpp/support/byte_buffer.h>
#include <grpcpp/support/sync_stream.h>

@ -28,7 +28,6 @@
#include <grpc/byte_buffer_reader.h>
#include <grpc/impl/grpc_types.h>
#include <grpc/slice.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/codegen/config_protobuf.h>
#include <grpcpp/impl/serialization_traits.h>
#include <grpcpp/support/byte_buffer.h>

@ -28,7 +28,6 @@
#include <grpc/impl/grpc_types.h>
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/codegen/config_protobuf.h>
#include <grpcpp/impl/serialization_traits.h>
#include <grpcpp/support/byte_buffer.h>

@ -24,7 +24,6 @@
#include "absl/log/absl_check.h"
#include <grpc/support/log.h>
#include <grpcpp/impl/rpc_method.h>
#include <grpcpp/support/interceptor.h>
#include <grpcpp/support/string_ref.h>

@ -21,7 +21,6 @@
#include "absl/log/absl_check.h"
#include <grpc/support/log.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/impl/call.h>

@ -142,6 +142,8 @@ grpc_cc_library(
"util/latent_see.h",
],
external_deps = [
"absl/base:core_headers",
"absl/functional:any_invocable",
"absl/log",
"absl/strings",
"absl/types:optional",
@ -952,6 +954,7 @@ grpc_cc_library(
grpc_cc_library(
name = "seq",
external_deps = ["absl/log:log"],
language = "c++",
public_hdrs = [
"lib/promise/seq.h",
@ -5454,6 +5457,7 @@ grpc_cc_library(
"xds/grpc/xds_cluster.h",
],
external_deps = [
"absl/container:flat_hash_map",
"absl/strings",
"absl/types:optional",
"absl/types:variant",

@ -29,7 +29,6 @@
#include "absl/strings/strip.h"
#include <grpc/support/json.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>

@ -29,7 +29,6 @@
#include <grpc/grpc.h>
#include <grpc/support/json.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h>

@ -24,8 +24,6 @@
#include "absl/functional/any_invocable.h"
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include "src/core/lib/gprpp/down_cast.h"
#include "src/core/lib/gprpp/unique_type_name.h"
#include "src/core/lib/resource_quota/arena.h"

@ -29,7 +29,6 @@
#include "absl/strings/string_view.h"
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include "src/core/client_channel/client_channel_internal.h"
#include "src/core/lib/channel/channel_fwd.h"

@ -27,8 +27,6 @@
#include "absl/log/log.h"
#include "absl/status/statusor.h"
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/channel_stack_builder_impl.h"

@ -24,8 +24,6 @@
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include "src/core/client_channel/subchannel.h"
namespace grpc_core {

@ -30,7 +30,6 @@
#include <grpc/event_engine/event_engine.h>
#include <grpc/grpc.h>
#include <grpc/impl/channel_arg_names.h>
#include <grpc/support/log.h>
#include "src/core/client_channel/client_channel_filter.h"
#include "src/core/client_channel/retry_service_config.h"

@ -230,12 +230,11 @@ void RetryFilter::LegacyCallData::CallAttempt::MaybeSwitchToFastPath() {
// yet seen that op from the surface, we can't switch yet.
if (recv_trailing_metadata_internal_batch_ != nullptr) return;
// Switch to fast path.
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld_->chand_ << " calld=" << calld_
<< " attempt=" << this
<< ": retry state no longer needed; "
"moving LB call to parent and unreffing the call attempt";
}
GRPC_TRACE_LOG(retry, INFO)
<< "chand=" << calld_->chand_ << " calld=" << calld_
<< " attempt=" << this
<< ": retry state no longer needed; "
"moving LB call to parent and unreffing the call attempt";
calld_->committed_call_ = std::move(lb_call_);
calld_->call_attempt_.reset(DEBUG_LOCATION, "MaybeSwitchToFastPath");
}
@ -249,12 +248,10 @@ RetryFilter::LegacyCallData::CallAttempt::MaybeCreateBatchForReplay() {
// send_initial_metadata.
if (calld_->seen_send_initial_metadata_ && !started_send_initial_metadata_ &&
!calld_->pending_send_initial_metadata_) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld_->chand_ << " calld=" << calld_
<< " attempt=" << this
<< ": replaying previously completed "
"send_initial_metadata op";
}
GRPC_TRACE_LOG(retry, INFO) << "chand=" << calld_->chand_
<< " calld=" << calld_ << " attempt=" << this
<< ": replaying previously completed "
"send_initial_metadata op";
replay_batch_data = CreateBatch(1, true /* set_on_complete */);
replay_batch_data->AddRetriableSendInitialMetadataOp();
}
@ -263,12 +260,10 @@ RetryFilter::LegacyCallData::CallAttempt::MaybeCreateBatchForReplay() {
if (started_send_message_count_ < calld_->send_messages_.size() &&
started_send_message_count_ == completed_send_message_count_ &&
!calld_->pending_send_message_) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld_->chand_ << " calld=" << calld_
<< " attempt=" << this
<< ": replaying previously completed "
"send_message op";
}
GRPC_TRACE_LOG(retry, INFO) << "chand=" << calld_->chand_
<< " calld=" << calld_ << " attempt=" << this
<< ": replaying previously completed "
"send_message op";
if (replay_batch_data == nullptr) {
replay_batch_data = CreateBatch(1, true /* set_on_complete */);
}
@ -282,12 +277,10 @@ RetryFilter::LegacyCallData::CallAttempt::MaybeCreateBatchForReplay() {
started_send_message_count_ == calld_->send_messages_.size() &&
!started_send_trailing_metadata_ &&
!calld_->pending_send_trailing_metadata_) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld_->chand_ << " calld=" << calld_
<< " attempt=" << this
<< ": replaying previously completed "
"send_trailing_metadata op";
}
GRPC_TRACE_LOG(retry, INFO) << "chand=" << calld_->chand_
<< " calld=" << calld_ << " attempt=" << this
<< ": replaying previously completed "
"send_trailing_metadata op";
if (replay_batch_data == nullptr) {
replay_batch_data = CreateBatch(1, true /* set_on_complete */);
}
@ -325,12 +318,11 @@ void RetryFilter::LegacyCallData::CallAttempt::AddClosureForBatch(
void RetryFilter::LegacyCallData::CallAttempt::
AddBatchForInternalRecvTrailingMetadata(CallCombinerClosureList* closures) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld_->chand_ << " calld=" << calld_
<< " attempt=" << this
<< ": call failed but recv_trailing_metadata not started; "
"starting it internally";
}
GRPC_TRACE_LOG(retry, INFO)
<< "chand=" << calld_->chand_ << " calld=" << calld_
<< " attempt=" << this
<< ": call failed but recv_trailing_metadata not started; "
"starting it internally";
// Create batch_data with 2 refs, since this batch will be unreffed twice:
// once for the recv_trailing_metadata_ready callback when the batch
// completes, and again when we actually get a recv_trailing_metadata
@ -556,12 +548,11 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry(
}
// Status is not OK. Check whether the status is retryable.
if (!calld_->retry_policy_->retryable_status_codes().Contains(*status)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld_->chand_ << " calld=" << calld_
<< " attempt=" << this << ": status "
<< grpc_status_code_to_string(*status)
<< " not configured as retryable";
}
GRPC_TRACE_LOG(retry, INFO)
<< "chand=" << calld_->chand_ << " calld=" << calld_
<< " attempt=" << this << ": status "
<< grpc_status_code_to_string(*status)
<< " not configured as retryable";
return false;
}
}
@ -651,14 +642,12 @@ void RetryFilter::LegacyCallData::CallAttempt::OnPerAttemptRecvTimerLocked(
void* arg, grpc_error_handle error) {
auto* call_attempt = static_cast<CallAttempt*>(arg);
auto* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt
<< ": perAttemptRecvTimeout timer fired: error="
<< StatusToString(error)
<< ", per_attempt_recv_timer_handle_.has_value()="
<< call_attempt->per_attempt_recv_timer_handle_.has_value();
}
GRPC_TRACE_LOG(retry, INFO)
<< "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt
<< ": perAttemptRecvTimeout timer fired: error=" << StatusToString(error)
<< ", per_attempt_recv_timer_handle_.has_value()="
<< call_attempt->per_attempt_recv_timer_handle_.has_value();
CallCombinerClosureList closures;
call_attempt->per_attempt_recv_timer_handle_.reset();
// Cancel this attempt.
@ -804,13 +793,10 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::
RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_;
RetryFilter::LegacyCallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt
<< " batch_data=" << batch_data.get()
<< ": got recv_initial_metadata_ready, error="
<< StatusToString(error);
}
GRPC_TRACE_LOG(retry, INFO)
<< "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt << " batch_data=" << batch_data.get()
<< ": got recv_initial_metadata_ready, error=" << StatusToString(error);
call_attempt->completed_recv_initial_metadata_ = true;
// If this attempt has been abandoned, then we're not going to use the
// result of this recv_initial_metadata op, so do nothing.
@ -901,12 +887,10 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::RecvMessageReady(
RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_;
RetryFilter::LegacyCallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt
<< " batch_data=" << batch_data.get()
<< ": got recv_message_ready, error=" << StatusToString(error);
}
GRPC_TRACE_LOG(retry, INFO)
<< "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt << " batch_data=" << batch_data.get()
<< ": got recv_message_ready, error=" << StatusToString(error);
++call_attempt->completed_recv_message_count_;
// If this attempt has been abandoned, then we're not going to use the
// result of this recv_message op, so do nothing.
@ -930,12 +914,11 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::RecvMessageReady(
if (GPR_UNLIKELY(
(!call_attempt->recv_message_.has_value() || !error.ok()) &&
!call_attempt->completed_recv_trailing_metadata_)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt
<< ": deferring recv_message_ready (nullptr message and "
"recv_trailing_metadata pending)";
}
GRPC_TRACE_LOG(retry, INFO)
<< "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt
<< ": deferring recv_message_ready (nullptr message and "
"recv_trailing_metadata pending)";
call_attempt->recv_message_ready_deferred_batch_ = std::move(batch_data);
call_attempt->recv_message_error_ = error;
CallCombinerClosureList closures;
@ -1094,13 +1077,10 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::
RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_;
RetryFilter::LegacyCallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt
<< " batch_data=" << batch_data.get()
<< ": got recv_trailing_metadata_ready, error="
<< StatusToString(error);
}
GRPC_TRACE_LOG(retry, INFO)
<< "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt << " batch_data=" << batch_data.get()
<< ": got recv_trailing_metadata_ready, error=" << StatusToString(error);
call_attempt->completed_recv_trailing_metadata_ = true;
// If this attempt has been abandoned, then we're not going to use the
// result of this recv_trailing_metadata op, so do nothing.
@ -1121,17 +1101,15 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::
batch_data->batch_.payload->recv_trailing_metadata.recv_trailing_metadata;
GetCallStatus(calld->deadline_, md_batch, error, &status, &server_pushback,
&is_lb_drop, &stream_network_state);
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt << ": call finished, status="
<< grpc_status_code_to_string(status) << " server_pushback="
<< (server_pushback.has_value() ? server_pushback->ToString()
: "N/A")
<< " is_lb_drop=" << is_lb_drop << " stream_network_state="
<< (stream_network_state.has_value()
? absl::StrCat(*stream_network_state)
: "N/A");
}
GRPC_TRACE_LOG(retry, INFO)
<< "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt
<< ": call finished, status=" << grpc_status_code_to_string(status)
<< " server_pushback="
<< (server_pushback.has_value() ? server_pushback->ToString() : "N/A")
<< " is_lb_drop=" << is_lb_drop << " stream_network_state="
<< (stream_network_state.has_value() ? absl::StrCat(*stream_network_state)
: "N/A");
// Check if we should retry.
if (!is_lb_drop) { // Never retry on LB drops.
enum { kNoRetry, kTransparentRetry, kConfigurableRetry } retry = kNoRetry;
@ -1253,15 +1231,11 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::OnComplete(
RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_;
RetryFilter::LegacyCallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt
<< " batch_data=" << batch_data.get()
<< ": got on_complete, error=" << StatusToString(error)
<< ", batch="
<< grpc_transport_stream_op_batch_string(&batch_data->batch_,
false);
}
GRPC_TRACE_LOG(retry, INFO)
<< "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt << " batch_data=" << batch_data.get()
<< ": got on_complete, error=" << StatusToString(error) << ", batch="
<< grpc_transport_stream_op_batch_string(&batch_data->batch_, false);
// If this attempt has been abandoned, then we're not going to propagate
// the completion of this batch, so do nothing.
if (call_attempt->abandoned_) {
@ -1328,15 +1302,12 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::OnCompleteForCancelOp(
RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_;
RetryFilter::LegacyCallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt
<< " batch_data=" << batch_data.get()
<< ": got on_complete for cancel_stream batch, error="
<< StatusToString(error) << ", batch="
<< grpc_transport_stream_op_batch_string(&batch_data->batch_,
false);
}
GRPC_TRACE_LOG(retry, INFO)
<< "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt << " batch_data=" << batch_data.get()
<< ": got on_complete for cancel_stream batch, error="
<< StatusToString(error) << ", batch="
<< grpc_transport_stream_op_batch_string(&batch_data->batch_, false);
GRPC_CALL_COMBINER_STOP(
calld->call_combiner_,
"on_complete for internally generated cancel_stream op");
@ -1371,12 +1342,10 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::
void RetryFilter::LegacyCallData::CallAttempt::BatchData::
AddRetriableSendMessageOp() {
auto* calld = call_attempt_->calld_;
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
LOG(INFO) << "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt_
<< ": starting calld->send_messages["
<< call_attempt_->started_send_message_count_ << "]";
}
GRPC_TRACE_LOG(retry, INFO)
<< "chand=" << calld->chand_ << " calld=" << calld
<< " attempt=" << call_attempt_ << ": starting calld->send_messages["
<< call_attempt_->started_send_message_count_ << "]";
CachedSendMessage cache =
calld->send_messages_[call_attempt_->started_send_message_count_];
++call_attempt_->started_send_message_count_;

@ -417,12 +417,11 @@ class Subchannel::ConnectedSubchannelStateWatcher final
if (c->connected_subchannel_ == nullptr) return;
if (new_state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
new_state == GRPC_CHANNEL_SHUTDOWN) {
if (GRPC_TRACE_FLAG_ENABLED(subchannel)) {
LOG(INFO) << "subchannel " << c << " " << c->key_.ToString()
<< ": Connected subchannel "
<< c->connected_subchannel_.get() << " reports "
<< ConnectivityStateName(new_state) << ": " << status;
}
GRPC_TRACE_LOG(subchannel, INFO)
<< "subchannel " << c << " " << c->key_.ToString()
<< ": Connected subchannel " << c->connected_subchannel_.get()
<< " reports " << ConnectivityStateName(new_state) << ": "
<< status;
c->connected_subchannel_.reset();
if (c->channelz_node() != nullptr) {
c->channelz_node()->SetChildSocket(nullptr);
@ -803,12 +802,10 @@ void Subchannel::OnConnectingFinishedLocked(grpc_error_handle error) {
if (connecting_result_.transport == nullptr || !PublishTransportLocked()) {
const Duration time_until_next_attempt =
next_attempt_time_ - Timestamp::Now();
if (GRPC_TRACE_FLAG_ENABLED(subchannel)) {
LOG(INFO) << "subchannel " << this << " " << key_.ToString()
<< ": connect failed (" << StatusToString(error)
<< "), backing off for " << time_until_next_attempt.millis()
<< " ms";
}
GRPC_TRACE_LOG(subchannel, INFO)
<< "subchannel " << this << " " << key_.ToString()
<< ": connect failed (" << StatusToString(error)
<< "), backing off for " << time_until_next_attempt.millis() << " ms";
SetConnectivityStateLocked(GRPC_CHANNEL_TRANSIENT_FAILURE,
grpc_error_to_absl_status(error));
retry_timer_handle_ = event_engine_->RunAfter(

@ -29,7 +29,6 @@
#include "absl/types/optional.h"
#include <grpc/impl/channel_arg_names.h>
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/promise_based_filter.h"

@ -37,8 +37,6 @@
#include "absl/strings/strip.h"
#include "absl/types/optional.h"
#include <grpc/support/log.h>
#include "src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/config/core_configuration.h"

@ -56,12 +56,11 @@ class ChaoticGoodTransport : public RefCounted<ChaoticGoodTransport> {
bool saw_encoding_errors = false;
auto buffers = frame.Serialize(&encoder_, saw_encoding_errors);
// ignore encoding errors: they will be logged separately already
if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) {
LOG(INFO) << "CHAOTIC_GOOD: WriteFrame to:"
<< ResolvedAddressToString(control_endpoint_.GetPeerAddress())
.value_or("<<unknown peer address>>")
<< " " << frame.ToString();
}
GRPC_TRACE_LOG(chaotic_good, INFO)
<< "CHAOTIC_GOOD: WriteFrame to:"
<< ResolvedAddressToString(control_endpoint_.GetPeerAddress())
.value_or("<<unknown peer address>>")
<< " " << frame.ToString();
return TryJoin<absl::StatusOr>(
control_endpoint_.Write(std::move(buffers.control)),
data_endpoint_.Write(std::move(buffers.data)));
@ -76,15 +75,13 @@ class ChaoticGoodTransport : public RefCounted<ChaoticGoodTransport> {
auto frame_header =
FrameHeader::Parse(reinterpret_cast<const uint8_t*>(
GRPC_SLICE_START_PTR(read_buffer.c_slice())));
if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) {
LOG(INFO) << "CHAOTIC_GOOD: ReadHeader from:"
<< ResolvedAddressToString(
control_endpoint_.GetPeerAddress())
.value_or("<<unknown peer address>>")
<< " "
<< (frame_header.ok() ? frame_header->ToString()
: frame_header.status().ToString());
}
GRPC_TRACE_LOG(chaotic_good, INFO)
<< "CHAOTIC_GOOD: ReadHeader from:"
<< ResolvedAddressToString(control_endpoint_.GetPeerAddress())
.value_or("<<unknown peer address>>")
<< " "
<< (frame_header.ok() ? frame_header->ToString()
: frame_header.status().ToString());
// Read header and trailers from control endpoint.
// Read message padding and message from data endpoint.
return If(

@ -25,7 +25,6 @@
#include "absl/status/statusor.h"
#include <grpc/slice.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chaotic_good/frame_header.h"

@ -19,7 +19,6 @@
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
namespace grpc_core {

@ -300,12 +300,10 @@ auto ChaoticGoodServerListener::ActiveConnection::HandshakingState::
},
[self](PromiseEndpoint ret) -> absl::Status {
MutexLock lock(&self->connection_->listener_->mu_);
if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) {
LOG(INFO) << self->connection_.get()
<< " Data endpoint setup done: shutdown="
<< (self->connection_->listener_->shutdown_ ? "true"
: "false");
}
GRPC_TRACE_LOG(chaotic_good, INFO)
<< self->connection_.get()
<< " Data endpoint setup done: shutdown="
<< (self->connection_->listener_->shutdown_ ? "true" : "false");
if (self->connection_->listener_->shutdown_) {
return absl::UnavailableError("Server shutdown");
}
@ -458,6 +456,7 @@ void ChaoticGoodServerListener::Orphan() {
absl::flat_hash_set<OrphanablePtr<ActiveConnection>> connection_list;
MutexLock lock(&mu_);
connection_list = std::move(connection_list_);
connection_list_.clear();
shutdown_ = true;
}
ee_listener_.reset();

@ -203,10 +203,9 @@ auto ChaoticGoodServerTransport::CallOutboundLoop(
Map(SendCallInitialMetadataAndBody(stream_id, outgoing_frames,
call_initiator),
[stream_id](absl::Status main_body_result) {
if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) {
VLOG(2) << "CHAOTIC_GOOD: CallOutboundLoop: stream_id="
<< stream_id << " main_body_result=" << main_body_result;
}
GRPC_TRACE_VLOG(chaotic_good, 2)
<< "CHAOTIC_GOOD: CallOutboundLoop: stream_id=" << stream_id
<< " main_body_result=" << main_body_result;
return Empty{};
}),
call_initiator.PullServerTrailingMetadata(),

@ -42,7 +42,6 @@
#include <grpc/event_engine/memory_allocator.h>
#include <grpc/grpc.h>
#include <grpc/slice.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chaotic_good/chaotic_good_transport.h"

@ -20,7 +20,6 @@
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/util/useful.h"

@ -23,7 +23,6 @@
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/huffsyms.h"

@ -1308,15 +1308,14 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
return;
}
closure->next_data.scratch -= CLOSURE_BARRIER_FIRST_REF_BIT;
if (GRPC_TRACE_FLAG_ENABLED(http)) {
LOG(INFO) << "complete_closure_step: t=" << t << " " << closure << " refs="
<< (closure->next_data.scratch / CLOSURE_BARRIER_FIRST_REF_BIT)
<< " flags="
<< (closure->next_data.scratch % CLOSURE_BARRIER_FIRST_REF_BIT)
<< " desc=" << desc << " err=" << grpc_core::StatusToString(error)
<< " write_state=" << write_state_name(t->write_state)
<< " whence=" << whence.file() << ":" << whence.line();
}
GRPC_TRACE_LOG(http, INFO)
<< "complete_closure_step: t=" << t << " " << closure << " refs="
<< (closure->next_data.scratch / CLOSURE_BARRIER_FIRST_REF_BIT)
<< " flags="
<< (closure->next_data.scratch % CLOSURE_BARRIER_FIRST_REF_BIT)
<< " desc=" << desc << " err=" << grpc_core::StatusToString(error)
<< " write_state=" << write_state_name(t->write_state)
<< " whence=" << whence.file() << ":" << whence.line();
if (!error.ok()) {
grpc_error_handle cl_err =
@ -1362,6 +1361,241 @@ static void log_metadata(const grpc_metadata_batch* md_batch, uint32_t id,
});
}
static void send_initial_metadata_locked(
grpc_transport_stream_op_batch* op, grpc_chttp2_stream* s,
grpc_transport_stream_op_batch_payload* op_payload,
grpc_chttp2_transport* t, grpc_closure* on_complete) {
if (!grpc_core::IsCallTracerInTransportEnabled()) {
if (s->call_tracer != nullptr) {
s->call_tracer->RecordAnnotation(
grpc_core::HttpAnnotation(grpc_core::HttpAnnotation::Type::kStart,
gpr_now(GPR_CLOCK_REALTIME))
.Add(s->t->flow_control.stats())
.Add(s->flow_control.stats()));
}
} else if (grpc_core::IsTraceRecordCallopsEnabled()) {
auto* call_tracer = s->arena->GetContext<grpc_core::CallTracerInterface>();
if (call_tracer != nullptr && call_tracer->IsSampled()) {
call_tracer->RecordAnnotation(
grpc_core::HttpAnnotation(grpc_core::HttpAnnotation::Type::kStart,
gpr_now(GPR_CLOCK_REALTIME))
.Add(s->t->flow_control.stats())
.Add(s->flow_control.stats()));
}
}
if (t->is_client && t->channelz_socket != nullptr) {
t->channelz_socket->RecordStreamStartedFromLocal();
}
CHECK_EQ(s->send_initial_metadata_finished, nullptr);
on_complete->next_data.scratch |= t->closure_barrier_may_cover_write;
s->send_initial_metadata_finished = add_closure_barrier(on_complete);
s->send_initial_metadata =
op_payload->send_initial_metadata.send_initial_metadata;
if (t->is_client) {
s->deadline =
std::min(s->deadline,
s->send_initial_metadata->get(grpc_core::GrpcTimeoutMetadata())
.value_or(grpc_core::Timestamp::InfFuture()));
}
if (contains_non_ok_status(s->send_initial_metadata)) {
s->seen_error = true;
}
if (!s->write_closed) {
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);
} else {
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("Transport closed",
&t->closed_with_error, 1),
grpc_core::StatusIntProperty::kRpcStatus,
GRPC_STATUS_UNAVAILABLE),
false);
}
} else {
CHECK_NE(s->id, 0u);
grpc_chttp2_mark_stream_writable(t, s);
if (!(op->send_message &&
(op->payload->send_message.flags & GRPC_WRITE_BUFFER_HINT))) {
grpc_chttp2_initiate_write(
t, GRPC_CHTTP2_INITIATE_WRITE_SEND_INITIAL_METADATA);
}
}
} else {
s->send_initial_metadata = nullptr;
grpc_chttp2_complete_closure_step(
t, &s->send_initial_metadata_finished,
GRPC_ERROR_CREATE_REFERENCING(
"Attempt to send initial metadata after stream was closed",
&s->write_closed_error, 1),
"send_initial_metadata_finished");
}
}
static void send_message_locked(
grpc_transport_stream_op_batch* op, grpc_chttp2_stream* s,
grpc_transport_stream_op_batch_payload* op_payload,
grpc_chttp2_transport* t, grpc_closure* on_complete) {
t->num_messages_in_next_write++;
grpc_core::global_stats().IncrementHttp2SendMessageSize(
op->payload->send_message.send_message->Length());
on_complete->next_data.scratch |= t->closure_barrier_may_cover_write;
s->send_message_finished = add_closure_barrier(op->on_complete);
const uint32_t flags = op_payload->send_message.flags;
if (s->write_closed) {
op->payload->send_message.stream_write_closed = true;
// We should NOT return an error here, so as to avoid a cancel OP being
// started. The surface layer will notice that the stream has been closed
// for writes and fail the send message op.
grpc_chttp2_complete_closure_step(t, &s->send_message_finished,
absl::OkStatus(),
"fetching_send_message_finished");
} else {
uint8_t* frame_hdr = grpc_slice_buffer_tiny_add(&s->flow_controlled_buffer,
GRPC_HEADER_SIZE_IN_BYTES);
frame_hdr[0] = (flags & GRPC_WRITE_INTERNAL_COMPRESS) != 0;
size_t len = op_payload->send_message.send_message->Length();
frame_hdr[1] = static_cast<uint8_t>(len >> 24);
frame_hdr[2] = static_cast<uint8_t>(len >> 16);
frame_hdr[3] = static_cast<uint8_t>(len >> 8);
frame_hdr[4] = static_cast<uint8_t>(len);
s->call_tracer_wrapper.RecordOutgoingBytes(
{GRPC_HEADER_SIZE_IN_BYTES, len, 0});
s->next_message_end_offset =
s->flow_controlled_bytes_written +
static_cast<int64_t>(s->flow_controlled_buffer.length) +
static_cast<int64_t>(len);
if (flags & GRPC_WRITE_BUFFER_HINT) {
s->next_message_end_offset -= t->write_buffer_size;
s->write_buffering = true;
} else {
s->write_buffering = false;
}
grpc_slice* const slices =
op_payload->send_message.send_message->c_slice_buffer()->slices;
grpc_slice* const end =
slices + op_payload->send_message.send_message->Count();
for (grpc_slice* slice = slices; slice != end; slice++) {
grpc_slice_buffer_add(&s->flow_controlled_buffer,
grpc_core::CSliceRef(*slice));
}
int64_t notify_offset = s->next_message_end_offset;
if (notify_offset <= s->flow_controlled_bytes_written) {
grpc_chttp2_complete_closure_step(t, &s->send_message_finished,
absl::OkStatus(),
"fetching_send_message_finished");
} else {
grpc_chttp2_write_cb* cb = t->write_cb_pool;
if (cb == nullptr) {
cb = static_cast<grpc_chttp2_write_cb*>(gpr_malloc(sizeof(*cb)));
} else {
t->write_cb_pool = cb->next;
}
cb->call_at_byte = notify_offset;
cb->closure = s->send_message_finished;
s->send_message_finished = nullptr;
grpc_chttp2_write_cb** list = flags & GRPC_WRITE_THROUGH
? &s->on_write_finished_cbs
: &s->on_flow_controlled_cbs;
cb->next = *list;
*list = cb;
}
if (s->id != 0 && (!s->write_buffering || s->flow_controlled_buffer.length >
t->write_buffer_size)) {
grpc_chttp2_mark_stream_writable(t, s);
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_SEND_MESSAGE);
}
}
}
static void send_trailing_metadata_locked(
grpc_transport_stream_op_batch* op, grpc_chttp2_stream* s,
grpc_transport_stream_op_batch_payload* op_payload,
grpc_chttp2_transport* t, grpc_closure* on_complete) {
CHECK_EQ(s->send_trailing_metadata_finished, nullptr);
on_complete->next_data.scratch |= t->closure_barrier_may_cover_write;
s->send_trailing_metadata_finished = add_closure_barrier(on_complete);
s->send_trailing_metadata =
op_payload->send_trailing_metadata.send_trailing_metadata;
s->sent_trailing_metadata_op = op_payload->send_trailing_metadata.sent;
s->write_buffering = false;
if (contains_non_ok_status(s->send_trailing_metadata)) {
s->seen_error = true;
}
if (s->write_closed) {
s->send_trailing_metadata = nullptr;
s->sent_trailing_metadata_op = nullptr;
grpc_chttp2_complete_closure_step(
t, &s->send_trailing_metadata_finished,
op->payload->send_trailing_metadata.send_trailing_metadata->empty()
? absl::OkStatus()
: GRPC_ERROR_CREATE("Attempt to send trailing metadata after "
"stream was closed"),
"send_trailing_metadata_finished");
} else if (s->id != 0) {
// TODO(ctiller): check if there's flow control for any outstanding
// bytes before going writable
grpc_chttp2_mark_stream_writable(t, s);
grpc_chttp2_initiate_write(
t, GRPC_CHTTP2_INITIATE_WRITE_SEND_TRAILING_METADATA);
}
}
static void recv_initial_metadata_locked(
grpc_chttp2_stream* s, grpc_transport_stream_op_batch_payload* op_payload,
grpc_chttp2_transport* t) {
CHECK_EQ(s->recv_initial_metadata_ready, nullptr);
s->recv_initial_metadata_ready =
op_payload->recv_initial_metadata.recv_initial_metadata_ready;
s->recv_initial_metadata =
op_payload->recv_initial_metadata.recv_initial_metadata;
s->trailing_metadata_available =
op_payload->recv_initial_metadata.trailing_metadata_available;
if (s->parsed_trailers_only && s->trailing_metadata_available != nullptr) {
*s->trailing_metadata_available = true;
}
grpc_chttp2_maybe_complete_recv_initial_metadata(t, s);
}
static void recv_message_locked(
grpc_chttp2_stream* s, grpc_transport_stream_op_batch_payload* op_payload,
grpc_chttp2_transport* t) {
CHECK_EQ(s->recv_message_ready, nullptr);
s->recv_message_ready = op_payload->recv_message.recv_message_ready;
s->recv_message = op_payload->recv_message.recv_message;
s->recv_message->emplace();
s->recv_message_flags = op_payload->recv_message.flags;
s->call_failed_before_recv_message =
op_payload->recv_message.call_failed_before_recv_message;
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
}
static void recv_trailing_metadata_locked(
grpc_chttp2_stream* s, grpc_transport_stream_op_batch_payload* op_payload,
grpc_chttp2_transport* t) {
CHECK_EQ(s->collecting_stats, nullptr);
s->collecting_stats = op_payload->recv_trailing_metadata.collect_stats;
CHECK_EQ(s->recv_trailing_metadata_finished, nullptr);
s->recv_trailing_metadata_finished =
op_payload->recv_trailing_metadata.recv_trailing_metadata_ready;
s->recv_trailing_metadata =
op_payload->recv_trailing_metadata.recv_trailing_metadata;
s->final_metadata_requested = true;
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
}
static void perform_stream_op_locked(void* stream_op,
grpc_error_handle /*error_ignored*/) {
grpc_transport_stream_op_batch* op =
@ -1405,225 +1639,27 @@ static void perform_stream_op_locked(void* stream_op,
}
if (op->send_initial_metadata) {
if (!grpc_core::IsCallTracerInTransportEnabled()) {
if (s->call_tracer != nullptr) {
s->call_tracer->RecordAnnotation(
grpc_core::HttpAnnotation(grpc_core::HttpAnnotation::Type::kStart,
gpr_now(GPR_CLOCK_REALTIME))
.Add(s->t->flow_control.stats())
.Add(s->flow_control.stats()));
}
} else if (grpc_core::IsTraceRecordCallopsEnabled()) {
auto* call_tracer =
s->arena->GetContext<grpc_core::CallTracerInterface>();
if (call_tracer != nullptr && call_tracer->IsSampled()) {
call_tracer->RecordAnnotation(
grpc_core::HttpAnnotation(grpc_core::HttpAnnotation::Type::kStart,
gpr_now(GPR_CLOCK_REALTIME))
.Add(s->t->flow_control.stats())
.Add(s->flow_control.stats()));
}
}
if (t->is_client && t->channelz_socket != nullptr) {
t->channelz_socket->RecordStreamStartedFromLocal();
}
CHECK_EQ(s->send_initial_metadata_finished, nullptr);
on_complete->next_data.scratch |= t->closure_barrier_may_cover_write;
s->send_initial_metadata_finished = add_closure_barrier(on_complete);
s->send_initial_metadata =
op_payload->send_initial_metadata.send_initial_metadata;
if (t->is_client) {
s->deadline = std::min(
s->deadline,
s->send_initial_metadata->get(grpc_core::GrpcTimeoutMetadata())
.value_or(grpc_core::Timestamp::InfFuture()));
}
if (contains_non_ok_status(s->send_initial_metadata)) {
s->seen_error = true;
}
if (!s->write_closed) {
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);
} else {
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("Transport closed",
&t->closed_with_error, 1),
grpc_core::StatusIntProperty::kRpcStatus,
GRPC_STATUS_UNAVAILABLE),
false);
}
} else {
CHECK_NE(s->id, 0u);
grpc_chttp2_mark_stream_writable(t, s);
if (!(op->send_message &&
(op->payload->send_message.flags & GRPC_WRITE_BUFFER_HINT))) {
grpc_chttp2_initiate_write(
t, GRPC_CHTTP2_INITIATE_WRITE_SEND_INITIAL_METADATA);
}
}
} else {
s->send_initial_metadata = nullptr;
grpc_chttp2_complete_closure_step(
t, &s->send_initial_metadata_finished,
GRPC_ERROR_CREATE_REFERENCING(
"Attempt to send initial metadata after stream was closed",
&s->write_closed_error, 1),
"send_initial_metadata_finished");
}
send_initial_metadata_locked(op, s, op_payload, t, on_complete);
}
if (op->send_message) {
t->num_messages_in_next_write++;
grpc_core::global_stats().IncrementHttp2SendMessageSize(
op->payload->send_message.send_message->Length());
on_complete->next_data.scratch |= t->closure_barrier_may_cover_write;
s->send_message_finished = add_closure_barrier(op->on_complete);
const uint32_t flags = op_payload->send_message.flags;
if (s->write_closed) {
op->payload->send_message.stream_write_closed = true;
// We should NOT return an error here, so as to avoid a cancel OP being
// started. The surface layer will notice that the stream has been closed
// for writes and fail the send message op.
grpc_chttp2_complete_closure_step(t, &s->send_message_finished,
absl::OkStatus(),
"fetching_send_message_finished");
} else {
uint8_t* frame_hdr = grpc_slice_buffer_tiny_add(
&s->flow_controlled_buffer, GRPC_HEADER_SIZE_IN_BYTES);
frame_hdr[0] = (flags & GRPC_WRITE_INTERNAL_COMPRESS) != 0;
size_t len = op_payload->send_message.send_message->Length();
frame_hdr[1] = static_cast<uint8_t>(len >> 24);
frame_hdr[2] = static_cast<uint8_t>(len >> 16);
frame_hdr[3] = static_cast<uint8_t>(len >> 8);
frame_hdr[4] = static_cast<uint8_t>(len);
s->call_tracer_wrapper.RecordOutgoingBytes(
{GRPC_HEADER_SIZE_IN_BYTES, len, 0});
s->next_message_end_offset =
s->flow_controlled_bytes_written +
static_cast<int64_t>(s->flow_controlled_buffer.length) +
static_cast<int64_t>(len);
if (flags & GRPC_WRITE_BUFFER_HINT) {
s->next_message_end_offset -= t->write_buffer_size;
s->write_buffering = true;
} else {
s->write_buffering = false;
}
grpc_slice* const slices =
op_payload->send_message.send_message->c_slice_buffer()->slices;
grpc_slice* const end =
slices + op_payload->send_message.send_message->Count();
for (grpc_slice* slice = slices; slice != end; slice++) {
grpc_slice_buffer_add(&s->flow_controlled_buffer,
grpc_core::CSliceRef(*slice));
}
int64_t notify_offset = s->next_message_end_offset;
if (notify_offset <= s->flow_controlled_bytes_written) {
grpc_chttp2_complete_closure_step(t, &s->send_message_finished,
absl::OkStatus(),
"fetching_send_message_finished");
} else {
grpc_chttp2_write_cb* cb = t->write_cb_pool;
if (cb == nullptr) {
cb = static_cast<grpc_chttp2_write_cb*>(gpr_malloc(sizeof(*cb)));
} else {
t->write_cb_pool = cb->next;
}
cb->call_at_byte = notify_offset;
cb->closure = s->send_message_finished;
s->send_message_finished = nullptr;
grpc_chttp2_write_cb** list = flags & GRPC_WRITE_THROUGH
? &s->on_write_finished_cbs
: &s->on_flow_controlled_cbs;
cb->next = *list;
*list = cb;
}
if (s->id != 0 &&
(!s->write_buffering ||
s->flow_controlled_buffer.length > t->write_buffer_size)) {
grpc_chttp2_mark_stream_writable(t, s);
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_SEND_MESSAGE);
}
}
send_message_locked(op, s, op_payload, t, on_complete);
}
if (op->send_trailing_metadata) {
CHECK_EQ(s->send_trailing_metadata_finished, nullptr);
on_complete->next_data.scratch |= t->closure_barrier_may_cover_write;
s->send_trailing_metadata_finished = add_closure_barrier(on_complete);
s->send_trailing_metadata =
op_payload->send_trailing_metadata.send_trailing_metadata;
s->sent_trailing_metadata_op = op_payload->send_trailing_metadata.sent;
s->write_buffering = false;
if (contains_non_ok_status(s->send_trailing_metadata)) {
s->seen_error = true;
}
if (s->write_closed) {
s->send_trailing_metadata = nullptr;
s->sent_trailing_metadata_op = nullptr;
grpc_chttp2_complete_closure_step(
t, &s->send_trailing_metadata_finished,
op->payload->send_trailing_metadata.send_trailing_metadata->empty()
? absl::OkStatus()
: GRPC_ERROR_CREATE("Attempt to send trailing metadata after "
"stream was closed"),
"send_trailing_metadata_finished");
} else if (s->id != 0) {
// TODO(ctiller): check if there's flow control for any outstanding
// bytes before going writable
grpc_chttp2_mark_stream_writable(t, s);
grpc_chttp2_initiate_write(
t, GRPC_CHTTP2_INITIATE_WRITE_SEND_TRAILING_METADATA);
}
send_trailing_metadata_locked(op, s, op_payload, t, on_complete);
}
if (op->recv_initial_metadata) {
CHECK_EQ(s->recv_initial_metadata_ready, nullptr);
s->recv_initial_metadata_ready =
op_payload->recv_initial_metadata.recv_initial_metadata_ready;
s->recv_initial_metadata =
op_payload->recv_initial_metadata.recv_initial_metadata;
s->trailing_metadata_available =
op_payload->recv_initial_metadata.trailing_metadata_available;
if (s->parsed_trailers_only && s->trailing_metadata_available != nullptr) {
*s->trailing_metadata_available = true;
}
grpc_chttp2_maybe_complete_recv_initial_metadata(t, s);
recv_initial_metadata_locked(s, op_payload, t);
}
if (op->recv_message) {
CHECK_EQ(s->recv_message_ready, nullptr);
s->recv_message_ready = op_payload->recv_message.recv_message_ready;
s->recv_message = op_payload->recv_message.recv_message;
s->recv_message->emplace();
s->recv_message_flags = op_payload->recv_message.flags;
s->call_failed_before_recv_message =
op_payload->recv_message.call_failed_before_recv_message;
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
recv_message_locked(s, op_payload, t);
}
if (op->recv_trailing_metadata) {
CHECK_EQ(s->collecting_stats, nullptr);
s->collecting_stats = op_payload->recv_trailing_metadata.collect_stats;
CHECK_EQ(s->recv_trailing_metadata_finished, nullptr);
s->recv_trailing_metadata_finished =
op_payload->recv_trailing_metadata.recv_trailing_metadata_ready;
s->recv_trailing_metadata =
op_payload->recv_trailing_metadata.recv_trailing_metadata;
s->final_metadata_requested = true;
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
recv_trailing_metadata_locked(s, op_payload, t);
}
if (on_complete != nullptr) {
@ -2048,11 +2084,10 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t,
// Lambda is immediately invoked as a big scoped section that can be
// exited out of at any point by returning.
[&]() {
if (GRPC_TRACE_FLAG_ENABLED(http)) {
VLOG(2) << "maybe_complete_recv_message " << s
<< " final_metadata_requested=" << s->final_metadata_requested
<< " seen_error=" << s->seen_error;
}
GRPC_TRACE_VLOG(http, 2)
<< "maybe_complete_recv_message " << s
<< " final_metadata_requested=" << s->final_metadata_requested
<< " seen_error=" << s->seen_error;
if (s->final_metadata_requested && s->seen_error) {
grpc_slice_buffer_reset_and_unref(&s->frame_storage);
s->recv_message->reset();
@ -2063,11 +2098,10 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t,
int64_t min_progress_size;
auto r = grpc_deframe_unprocessed_incoming_frames(
s, &min_progress_size, &**s->recv_message, s->recv_message_flags);
if (GRPC_TRACE_FLAG_ENABLED(http)) {
VLOG(2) << "Deframe data frame: "
<< grpc_core::PollToString(
r, [](absl::Status r) { return r.ToString(); });
}
GRPC_TRACE_VLOG(http, 2)
<< "Deframe data frame: "
<< grpc_core::PollToString(
r, [](absl::Status r) { return r.ToString(); });
if (r.pending()) {
if (s->read_closed) {
grpc_slice_buffer_reset_and_unref(&s->frame_storage);
@ -2118,13 +2152,12 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t,
void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_chttp2_transport* t,
grpc_chttp2_stream* s) {
grpc_chttp2_maybe_complete_recv_message(t, s);
if (GRPC_TRACE_FLAG_ENABLED(http)) {
VLOG(2) << "maybe_complete_recv_trailing_metadata cli=" << t->is_client
<< " s=" << s << " closure=" << s->recv_trailing_metadata_finished
<< " read_closed=" << s->read_closed
<< " write_closed=" << s->write_closed << " "
<< s->frame_storage.length;
}
GRPC_TRACE_VLOG(http, 2) << "maybe_complete_recv_trailing_metadata cli="
<< t->is_client << " s=" << s
<< " closure=" << s->recv_trailing_metadata_finished
<< " read_closed=" << s->read_closed
<< " write_closed=" << s->write_closed << " "
<< s->frame_storage.length;
if (s->recv_trailing_metadata_finished != nullptr && s->read_closed &&
s->write_closed) {
if (s->seen_error || !t->is_client) {
@ -2328,15 +2361,12 @@ grpc_chttp2_transport::RemovedStreamHandle grpc_chttp2_mark_stream_closed(
grpc_chttp2_transport* t, grpc_chttp2_stream* s, int close_reads,
int close_writes, grpc_error_handle error) {
grpc_chttp2_transport::RemovedStreamHandle rsh;
if (GRPC_TRACE_FLAG_ENABLED(http)) {
VLOG(2) << "MARK_STREAM_CLOSED: t=" << t << " s=" << s << "(id=" << s->id
<< ") "
<< ((close_reads && close_writes)
? "read+write"
: (close_reads ? "read"
: (close_writes ? "write" : "nothing??")))
<< " [" << grpc_core::StatusToString(error) << "]";
}
GRPC_TRACE_VLOG(http, 2)
<< "MARK_STREAM_CLOSED: t=" << t << " s=" << s << "(id=" << s->id << ") "
<< ((close_reads && close_writes)
? "read+write"
: (close_reads ? "read" : (close_writes ? "write" : "nothing??")))
<< " [" << grpc_core::StatusToString(error) << "]";
if (s->read_closed && s->write_closed) {
// already closed, but we should still fake the status if needed.
grpc_error_handle overall_error = removal_error(error, s, "Stream removed");

@ -32,7 +32,6 @@
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"

@ -23,7 +23,6 @@
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/crash.h"

@ -25,7 +25,6 @@
#include "absl/strings/str_format.h"
#include <grpc/slice_buffer.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/internal.h"

@ -28,7 +28,6 @@
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/internal.h"

@ -187,12 +187,11 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
"invalid value %u passed for %s", parser->value,
grpc_core::Http2Settings::WireIdToName(parser->id).c_str()));
}
if (GRPC_TRACE_FLAG_ENABLED(http)) {
LOG(INFO) << "CHTTP2:" << (t->is_client ? "CLI" : "SVR") << ":"
<< t->peer_string.as_string_view() << ": got setting "
<< grpc_core::Http2Settings::WireIdToName(parser->id)
<< " = " << parser->value;
}
GRPC_TRACE_LOG(http, INFO)
<< "CHTTP2:" << (t->is_client ? "CLI" : "SVR") << ":"
<< t->peer_string.as_string_view() << ": got setting "
<< grpc_core::Http2Settings::WireIdToName(parser->id) << " = "
<< parser->value;
} break;
}
}

@ -25,7 +25,6 @@
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/flow_control.h"

@ -18,7 +18,6 @@
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
namespace grpc_core {

@ -27,7 +27,6 @@
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/crash.h"

@ -331,13 +331,11 @@ absl::variant<size_t, absl::Status> grpc_chttp2_perform_read(
case GRPC_DTS_FH_8:
DCHECK_LT(cur, end);
t->incoming_stream_id |= (static_cast<uint32_t>(*cur));
if (GRPC_TRACE_FLAG_ENABLED(http)) {
LOG(INFO) << "INCOMING[" << t << "]: "
<< FrameTypeString(t->incoming_frame_type,
t->incoming_frame_flags)
<< " len:" << t->incoming_frame_size
<< absl::StrFormat(" id:0x%08x", t->incoming_stream_id);
}
GRPC_TRACE_LOG(http, INFO)
<< "INCOMING[" << t << "]: "
<< FrameTypeString(t->incoming_frame_type, t->incoming_frame_flags)
<< " len:" << t->incoming_frame_size
<< absl::StrFormat(" id:0x%08x", t->incoming_stream_id);
t->deframe_state = GRPC_DTS_FRAME;
err = init_frame_parser(t, requests_started);
if (!err.ok()) {
@ -453,10 +451,9 @@ static grpc_error_handle init_frame_parser(grpc_chttp2_transport* t,
case GRPC_CHTTP2_FRAME_GOAWAY:
return init_goaway_parser(t);
default:
if (GRPC_TRACE_FLAG_ENABLED(http)) {
LOG(ERROR) << "Unknown frame type "
<< absl::StrFormat("%02x", t->incoming_frame_type);
}
GRPC_TRACE_LOG(http, ERROR)
<< "Unknown frame type "
<< absl::StrFormat("%02x", t->incoming_frame_type);
return init_non_header_skip_frame_parser(t);
}
}
@ -790,10 +787,8 @@ static grpc_error_handle init_window_update_frame_parser(
grpc_chttp2_stream* s = t->incoming_stream =
grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
if (s == nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(http)) {
LOG(ERROR) << "Stream " << t->incoming_stream_id
<< " not found, ignoring WINDOW_UPDATE";
}
GRPC_TRACE_LOG(http, ERROR) << "Stream " << t->incoming_stream_id
<< " not found, ignoring WINDOW_UPDATE";
return init_non_header_skip_frame_parser(t);
}
s->call_tracer_wrapper.RecordIncomingBytes({9, 0, 0});
@ -888,10 +883,8 @@ static grpc_error_handle parse_frame_slice(grpc_chttp2_transport* t,
if (GPR_LIKELY(err.ok())) {
return err;
}
if (GRPC_TRACE_FLAG_ENABLED(http)) {
LOG(ERROR) << "INCOMING[" << t << ";" << s << "]: Parse failed with "
<< err;
}
GRPC_TRACE_LOG(http, ERROR)
<< "INCOMING[" << t << ";" << s << "]: Parse failed with " << err;
if (grpc_error_get_int(err, grpc_core::StatusIntProperty::kStreamId,
&unused)) {
grpc_chttp2_parsing_become_skip_parser(t);

@ -20,7 +20,6 @@
#include "absl/meta/type_traits.h"
#include "absl/random/distributions.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
namespace grpc_core {

@ -24,7 +24,6 @@
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
// Helpers for hpack varint encoding

@ -18,7 +18,6 @@
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
namespace grpc_core {

@ -204,24 +204,21 @@ static bool update_list(grpc_chttp2_transport* t, int64_t send_bytes,
static void report_stall(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
const char* staller) {
if (GRPC_TRACE_FLAG_ENABLED(flowctl)) {
VLOG(2) << t->peer_string.as_string_view() << ":" << t << " stream "
<< s->id << " moved to stalled list by " << staller
<< ". This is FULLY expected to happen in a healthy program that "
"is not seeing flow control stalls. However, if you know that "
"there are unwanted stalls, here is some helpful data: "
"[fc:pending="
<< s->flow_controlled_buffer.length
<< ":flowed=" << s->flow_controlled_bytes_flowed
<< ":peer_initwin=" << t->settings.acked().initial_window_size()
<< ":t_win=" << t->flow_control.remote_window() << ":s_win="
<< static_cast<uint32_t>(
std::max(int64_t{0},
s->flow_control.remote_window_delta() +
static_cast<int64_t>(
t->settings.peer().initial_window_size())))
<< ":s_delta=" << s->flow_control.remote_window_delta() << "]";
}
GRPC_TRACE_VLOG(flowctl, 2)
<< t->peer_string.as_string_view() << ":" << t << " stream " << s->id
<< " moved to stalled list by " << staller
<< ". This is FULLY expected to happen in a healthy program that is not "
"seeing flow control stalls. However, if you know that there are "
"unwanted stalls, here is some helpful data: [fc:pending="
<< s->flow_controlled_buffer.length
<< ":flowed=" << s->flow_controlled_bytes_flowed
<< ":peer_initwin=" << t->settings.acked().initial_window_size()
<< ":t_win=" << t->flow_control.remote_window() << ":s_win="
<< static_cast<uint32_t>(std::max(
int64_t{0}, s->flow_control.remote_window_delta() +
static_cast<int64_t>(
t->settings.peer().initial_window_size())))
<< ":s_delta=" << s->flow_control.remote_window_delta() << "]";
}
namespace {

@ -22,7 +22,6 @@
#include "absl/log/check.h"
#include "third_party/objective_c/Cronet/bidirectional_stream_c.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#ifdef GRPC_COMPILE_WITH_CRONET

@ -166,12 +166,10 @@ void HandshakeManager::CallNextHandshakerLocked(absl::Status error) {
error = GRPC_ERROR_CREATE("handshaker shutdown");
args_.endpoint.reset();
}
if (GRPC_TRACE_FLAG_ENABLED(handshaker)) {
LOG(INFO) << "handshake_manager " << this
<< ": handshaking complete -- scheduling "
"on_handshake_done with error="
<< error;
}
GRPC_TRACE_LOG(handshaker, INFO) << "handshake_manager " << this
<< ": handshaking complete -- scheduling "
"on_handshake_done with error="
<< error;
// Cancel deadline timer, since we're invoking the on_handshake_done
// callback now.
args_.event_engine->Cancel(deadline_timer_handle_);

@ -41,7 +41,6 @@
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/channelz/channelz.h"

@ -31,7 +31,6 @@
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/handshaker/handshaker.h"

@ -26,7 +26,6 @@
#include "absl/log/check.h"
#include "absl/log/log.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/channel_args.h"

@ -53,7 +53,6 @@
#include <grpc/grpc.h>
#include <grpc/slice.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>

@ -33,7 +33,6 @@
#include "absl/strings/str_cat.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/channel_fwd.h"

@ -34,7 +34,6 @@
#include <grpc/grpc.h>
#include <grpc/status.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/call_finalization.h"

@ -468,13 +468,12 @@ void BaseCallData::SendMessage::Done(const ServerMetadata& metadata,
void BaseCallData::SendMessage::WakeInsideCombiner(Flusher* flusher,
bool allow_push_to_pipe) {
if (GRPC_TRACE_FLAG_ENABLED(channel)) {
LOG(INFO) << base_->LogTag()
<< " SendMessage.WakeInsideCombiner st=" << StateString(state_)
<< (state_ == State::kBatchCompleted
? absl::StrCat(" status=", completed_status_.ToString())
: "");
}
GRPC_TRACE_LOG(channel, INFO)
<< base_->LogTag()
<< " SendMessage.WakeInsideCombiner st=" << StateString(state_)
<< (state_ == State::kBatchCompleted
? absl::StrCat(" status=", completed_status_.ToString())
: "");
switch (state_) {
case State::kInitial:
case State::kIdle:
@ -502,12 +501,11 @@ void BaseCallData::SendMessage::WakeInsideCombiner(Flusher* flusher,
CHECK(push_.has_value());
auto r_push = (*push_)();
if (auto* p = r_push.value_if_ready()) {
if (GRPC_TRACE_FLAG_ENABLED(channel)) {
LOG(INFO) << base_->LogTag()
<< " SendMessage.WakeInsideCombiner push complete, "
"result="
<< (*p ? "true" : "false");
}
GRPC_TRACE_LOG(channel, INFO)
<< base_->LogTag()
<< " SendMessage.WakeInsideCombiner push complete, "
"result="
<< (*p ? "true" : "false");
// We haven't pulled through yet, so this certainly shouldn't succeed.
CHECK(!*p);
state_ = State::kCancelled;
@ -517,12 +515,11 @@ void BaseCallData::SendMessage::WakeInsideCombiner(Flusher* flusher,
CHECK(next_.has_value());
auto r_next = (*next_)();
if (auto* p = r_next.value_if_ready()) {
if (GRPC_TRACE_FLAG_ENABLED(channel)) {
LOG(INFO) << base_->LogTag()
<< " SendMessage.WakeInsideCombiner next complete, "
"result.has_value="
<< (p->has_value() ? "true" : "false");
}
GRPC_TRACE_LOG(channel, INFO)
<< base_->LogTag()
<< " SendMessage.WakeInsideCombiner next complete, "
"result.has_value="
<< (p->has_value() ? "true" : "false");
if (p->has_value()) {
batch_->payload->send_message.send_message->Swap((**p)->payload());
batch_->payload->send_message.flags = (**p)->flags();
@ -774,13 +771,12 @@ void BaseCallData::ReceiveMessage::Done(const ServerMetadata& metadata,
void BaseCallData::ReceiveMessage::WakeInsideCombiner(Flusher* flusher,
bool allow_push_to_pipe) {
if (GRPC_TRACE_FLAG_ENABLED(channel)) {
LOG(INFO) << base_->LogTag()
<< " ReceiveMessage.WakeInsideCombiner st=" << StateString(state_)
<< " push?=" << (push_.has_value() ? "yes" : "no")
<< " next?=" << (next_.has_value() ? "yes" : "no")
<< " allow_push_to_pipe=" << (allow_push_to_pipe ? "yes" : "no");
}
GRPC_TRACE_LOG(channel, INFO)
<< base_->LogTag()
<< " ReceiveMessage.WakeInsideCombiner st=" << StateString(state_)
<< " push?=" << (push_.has_value() ? "yes" : "no")
<< " next?=" << (next_.has_value() ? "yes" : "no")
<< " allow_push_to_pipe=" << (allow_push_to_pipe ? "yes" : "no");
switch (state_) {
case State::kInitial:
case State::kIdle:
@ -865,12 +861,11 @@ void BaseCallData::ReceiveMessage::WakeInsideCombiner(Flusher* flusher,
p->cancelled() ? absl::CancelledError() : absl::OkStatus(),
"recv_message");
}
if (GRPC_TRACE_FLAG_ENABLED(channel)) {
LOG(INFO) << base_->LogTag()
<< " ReceiveMessage.WakeInsideCombiner next complete: "
<< (p->has_value() ? "got message" : "end of stream")
<< " new_state=" << StateString(state_);
}
GRPC_TRACE_LOG(channel, INFO)
<< base_->LogTag()
<< " ReceiveMessage.WakeInsideCombiner next complete: "
<< (p->has_value() ? "got message" : "end of stream")
<< " new_state=" << StateString(state_);
}
if (state_ != State::kPulledFromPipe &&
state_ != State::kCompletedWhilePulledFromPipe) {
@ -1079,15 +1074,14 @@ class ClientCallData::PollContext {
case SendInitialState::kForwarded: {
// Poll the promise once since we're waiting for it.
Poll<ServerMetadataHandle> poll = self_->promise_();
if (GRPC_TRACE_FLAG_ENABLED(channel)) {
LOG(INFO) << self_->LogTag()
<< " ClientCallData.PollContext.Run: poll="
<< PollToString(poll,
[](const ServerMetadataHandle& h) {
return h->DebugString();
})
<< "; " << self_->DebugString();
}
GRPC_TRACE_LOG(channel, INFO)
<< self_->LogTag() << " ClientCallData.PollContext.Run: poll="
<< PollToString(poll,
[](const ServerMetadataHandle& h) {
return h->DebugString();
})
<< "; " << self_->DebugString();
if (auto* r = poll.value_if_ready()) {
auto md = std::move(*r);
if (self_->send_message() != nullptr) {
@ -1749,12 +1743,10 @@ void ClientCallData::RecvTrailingMetadataReadyCallback(
void ClientCallData::RecvTrailingMetadataReady(grpc_error_handle error) {
Flusher flusher(this);
if (GRPC_TRACE_FLAG_ENABLED(channel)) {
LOG(INFO) << LogTag() << " ClientCallData.RecvTrailingMetadataReady "
<< "recv_trailing_state=" << StateString(recv_trailing_state_)
<< " error=" << error
<< " md=" << recv_trailing_metadata_->DebugString();
}
GRPC_TRACE_LOG(channel, INFO)
<< LogTag() << " ClientCallData.RecvTrailingMetadataReady "
<< "recv_trailing_state=" << StateString(recv_trailing_state_)
<< " error=" << error << " md=" << recv_trailing_metadata_->DebugString();
// If we were cancelled prior to receiving this callback, we should simply
// forward the callback up with the same error.
if (recv_trailing_state_ == RecvTrailingState::kCancelled) {
@ -2119,15 +2111,13 @@ void ServerCallData::StartBatch(grpc_transport_stream_op_batch* b) {
// Handle cancellation.
void ServerCallData::Completed(grpc_error_handle error,
bool tarpit_cancellation, Flusher* flusher) {
if (GRPC_TRACE_FLAG_ENABLED(channel)) {
VLOG(2) << LogTag() << "ServerCallData::Completed: send_trailing_state="
<< StateString(send_trailing_state_) << " send_initial_state="
<< (send_initial_metadata_ == nullptr
? "null"
: SendInitialMetadata::StateString(
send_initial_metadata_->state))
<< " error=" << error;
}
GRPC_TRACE_VLOG(channel, 2)
<< LogTag() << "ServerCallData::Completed: send_trailing_state="
<< StateString(send_trailing_state_) << " send_initial_state="
<< (send_initial_metadata_ == nullptr
? "null"
: SendInitialMetadata::StateString(send_initial_metadata_->state))
<< " error=" << error;
// Track the latest reason for cancellation.
cancelled_error_ = error;
// Stop running the promise.
@ -2396,11 +2386,10 @@ void ServerCallData::WakeInsideCombiner(Flusher* flusher) {
flusher,
send_initial_metadata_ == nullptr ||
send_initial_metadata_->state == SendInitialMetadata::kForwarded);
if (GRPC_TRACE_FLAG_ENABLED(channel)) {
VLOG(2) << LogTag() << ": After send_message WakeInsideCombiner "
<< DebugString() << " is_idle=" << send_message()->IsIdle()
<< " is_forwarded=" << send_message()->IsForwarded();
}
GRPC_TRACE_VLOG(channel, 2)
<< LogTag() << ": After send_message WakeInsideCombiner "
<< DebugString() << " is_idle=" << send_message()->IsIdle()
<< " is_forwarded=" << send_message()->IsForwarded();
if (send_trailing_state_ == SendTrailingState::kQueuedBehindSendMessage &&
(send_message()->IsIdle() ||
(send_trailing_metadata_batch_->send_message &&
@ -2422,34 +2411,30 @@ void ServerCallData::WakeInsideCombiner(Flusher* flusher) {
if (promise_.has_value()) {
Poll<ServerMetadataHandle> poll;
poll = promise_();
if (GRPC_TRACE_FLAG_ENABLED(channel)) {
LOG(INFO) << LogTag() << ": WakeInsideCombiner poll="
<< PollToString(poll,
[](const ServerMetadataHandle& h) {
return h->DebugString();
})
.c_str()
<< "; send_initial_metadata="
<< (send_initial_metadata_ == nullptr
? "null"
: SendInitialMetadata::StateString(
send_initial_metadata_->state))
<< " send_trailing_metadata="
<< StateString(send_trailing_state_);
}
GRPC_TRACE_LOG(channel, INFO)
<< LogTag() << ": WakeInsideCombiner poll="
<< PollToString(
poll,
[](const ServerMetadataHandle& h) { return h->DebugString(); })
.c_str()
<< "; send_initial_metadata="
<< (send_initial_metadata_ == nullptr
? "null"
: SendInitialMetadata::StateString(
send_initial_metadata_->state))
<< " send_trailing_metadata=" << StateString(send_trailing_state_);
if (send_initial_metadata_ != nullptr &&
send_initial_metadata_->state ==
SendInitialMetadata::kQueuedAndPushedToPipe) {
CHECK(send_initial_metadata_->metadata_next_.has_value());
auto p = (*send_initial_metadata_->metadata_next_)();
if (GRPC_TRACE_FLAG_ENABLED(channel)) {
LOG(INFO) << LogTag()
<< ": WakeInsideCombiner send_initial_metadata poll="
<< PollToString(
p, [](const NextResult<ServerMetadataHandle>& h) {
return (*h)->DebugString();
});
}
GRPC_TRACE_LOG(channel, INFO)
<< LogTag() << ": WakeInsideCombiner send_initial_metadata poll="
<< PollToString(p, [](const NextResult<ServerMetadataHandle>& h) {
return (*h)->DebugString();
});
if (auto* nr = p.value_if_ready()) {
ServerMetadataHandle md = std::move(nr->value());
if (send_initial_metadata_->batch->payload->send_initial_metadata

@ -29,7 +29,6 @@
#include "absl/strings/str_split.h"
#include <grpc/compression.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/channel_args.h"

@ -72,6 +72,10 @@ ABSL_FLAG(absl::optional<bool>, grpc_not_use_system_ssl_roots, {},
"Disable loading system root certificates.");
ABSL_FLAG(absl::optional<std::string>, grpc_ssl_cipher_suites, {},
"A colon separated list of cipher suites to use with OpenSSL");
ABSL_FLAG(absl::optional<bool>, grpc_cpp_experimental_disable_reflection, {},
"EXPERIMENTAL. Only respected when there is a dependency on "
":grpc++_reflection. If true, no reflection server will be "
"automatically added.");
namespace grpc_core {
@ -89,6 +93,10 @@ ConfigVars::ConfigVars(const Overrides& overrides)
not_use_system_ssl_roots_(LoadConfig(
FLAGS_grpc_not_use_system_ssl_roots, "GRPC_NOT_USE_SYSTEM_SSL_ROOTS",
overrides.not_use_system_ssl_roots, false)),
cpp_experimental_disable_reflection_(
LoadConfig(FLAGS_grpc_cpp_experimental_disable_reflection,
"GRPC_CPP_EXPERIMENTAL_DISABLE_REFLECTION",
overrides.cpp_experimental_disable_reflection, false)),
dns_resolver_(LoadConfig(FLAGS_grpc_dns_resolver, "GRPC_DNS_RESOLVER",
overrides.dns_resolver, "")),
verbosity_(LoadConfig(FLAGS_grpc_verbosity, "GRPC_VERBOSITY",
@ -136,7 +144,9 @@ std::string ConfigVars::ToString() const {
"\"", ", default_ssl_roots_file_path: ", "\"",
absl::CEscape(DefaultSslRootsFilePath()), "\"",
", not_use_system_ssl_roots: ", NotUseSystemSslRoots() ? "true" : "false",
", ssl_cipher_suites: ", "\"", absl::CEscape(SslCipherSuites()), "\"");
", ssl_cipher_suites: ", "\"", absl::CEscape(SslCipherSuites()), "\"",
", cpp_experimental_disable_reflection: ",
CppExperimentalDisableReflection() ? "true" : "false");
}
} // namespace grpc_core

@ -38,6 +38,7 @@ class GPR_DLL ConfigVars {
absl::optional<bool> enable_fork_support;
absl::optional<bool> abort_on_leaks;
absl::optional<bool> not_use_system_ssl_roots;
absl::optional<bool> cpp_experimental_disable_reflection;
absl::optional<std::string> dns_resolver;
absl::optional<std::string> verbosity;
absl::optional<std::string> poll_strategy;
@ -97,6 +98,12 @@ class GPR_DLL ConfigVars {
bool NotUseSystemSslRoots() const { return not_use_system_ssl_roots_; }
// A colon separated list of cipher suites to use with OpenSSL
absl::string_view SslCipherSuites() const { return ssl_cipher_suites_; }
// EXPERIMENTAL. Only respected when there is a dependency on
// :grpc++_reflection. If true, no reflection server will be automatically
// added.
bool CppExperimentalDisableReflection() const {
return cpp_experimental_disable_reflection_;
}
private:
explicit ConfigVars(const Overrides& overrides);
@ -106,6 +113,7 @@ class GPR_DLL ConfigVars {
bool enable_fork_support_;
bool abort_on_leaks_;
bool not_use_system_ssl_roots_;
bool cpp_experimental_disable_reflection_;
std::string dns_resolver_;
std::string verbosity_;
std::string poll_strategy_;

@ -120,3 +120,7 @@
ECDHE-ECDSA-AES256-GCM-SHA384:\
ECDHE-RSA-AES128-GCM-SHA256:\
ECDHE-RSA-AES256-GCM-SHA384"
- name: cpp_experimental_disable_reflection
type: bool
description: "EXPERIMENTAL. Only respected when there is a dependency on :grpc++_reflection. If true, no reflection server will be automatically added."
default: false

@ -20,7 +20,6 @@
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
namespace grpc_core {

@ -20,7 +20,6 @@
#include "absl/functional/any_invocable.h"
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/handshaker/handshaker_registry.h"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save