grpc 1.49.1 → 1.50.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +54 -153
- data/include/grpc/event_engine/endpoint_config.h +11 -5
- data/include/grpc/event_engine/event_engine.h +1 -1
- data/include/grpc/impl/codegen/atm_gcc_atomic.h +19 -28
- data/include/grpc/impl/codegen/atm_gcc_sync.h +0 -2
- data/include/grpc/impl/codegen/atm_windows.h +0 -2
- data/include/grpc/impl/codegen/grpc_types.h +6 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +3 -3
- data/src/core/ext/filters/client_channel/backup_poller.cc +4 -6
- data/src/core/ext/filters/client_channel/client_channel.cc +33 -22
- data/src/core/ext/filters/client_channel/client_channel.h +1 -1
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +0 -16
- data/src/core/ext/filters/client_channel/http_proxy.cc +12 -19
- data/src/core/ext/filters/client_channel/http_proxy.h +3 -2
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +6 -4
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +5 -4
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +0 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +112 -96
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +20 -11
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +106 -108
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +16 -0
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +20 -13
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +165 -257
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +218 -231
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +10 -6
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +389 -444
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +16 -16
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +8 -13
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +84 -96
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +38 -37
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +106 -186
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +106 -93
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +170 -218
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +2 -2
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +13 -15
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +84 -37
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +11 -0
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +1 -0
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +5 -3
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +5 -4
- data/src/core/ext/filters/client_channel/retry_filter.cc +25 -29
- data/src/core/ext/filters/client_channel/subchannel.cc +38 -33
- data/src/core/ext/filters/client_channel/subchannel.h +12 -3
- data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +1 -2
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +23 -16
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +8 -0
- data/src/core/ext/filters/http/client/http_client_filter.cc +1 -2
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +2 -4
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +0 -2
- data/src/core/ext/filters/http/server/http_server_filter.cc +1 -2
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +12 -8
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +32 -26
- data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +25 -130
- data/src/core/ext/transport/chttp2/transport/decode_huff.cc +287 -0
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +1018 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +83 -51
- data/src/core/ext/transport/chttp2/transport/flow_control.h +11 -6
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -2
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +2 -20
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +28 -28
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +1 -10
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +11 -6
- data/src/core/ext/transport/chttp2/transport/internal.h +2 -0
- data/src/core/ext/transport/chttp2/transport/parsing.cc +44 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +3 -14
- data/src/core/ext/transport/inproc/inproc_transport.cc +1 -3
- data/src/core/ext/xds/certificate_provider_store.cc +63 -3
- data/src/core/ext/xds/certificate_provider_store.h +9 -1
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +5 -5
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +1 -1
- data/src/core/ext/xds/xds_api.cc +21 -17
- data/src/core/ext/xds/xds_api.h +7 -0
- data/src/core/ext/xds/xds_bootstrap.cc +5 -537
- data/src/core/ext/xds/xds_bootstrap.h +39 -111
- data/src/core/ext/xds/xds_bootstrap_grpc.cc +370 -0
- data/src/core/ext/xds/xds_bootstrap_grpc.h +169 -0
- data/src/core/ext/xds/xds_client.cc +219 -145
- data/src/core/ext/xds/xds_client.h +19 -17
- data/src/core/ext/xds/xds_client_grpc.cc +18 -80
- data/src/core/ext/xds/xds_client_grpc.h +2 -25
- data/src/core/ext/xds/xds_client_stats.cc +4 -4
- data/src/core/ext/xds/xds_cluster.cc +87 -79
- data/src/core/ext/xds/xds_cluster.h +5 -5
- data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +3 -1
- data/src/core/ext/xds/xds_common_types.cc +13 -5
- data/src/core/ext/xds/xds_endpoint.cc +8 -6
- data/src/core/ext/xds/xds_endpoint.h +3 -4
- data/src/core/ext/xds/xds_lb_policy_registry.cc +4 -2
- data/src/core/ext/xds/xds_listener.cc +25 -20
- data/src/core/ext/xds/xds_listener.h +3 -4
- data/src/core/ext/xds/xds_resource_type.h +11 -8
- data/src/core/ext/xds/xds_route_config.cc +15 -16
- data/src/core/ext/xds/xds_route_config.h +3 -3
- data/src/core/ext/xds/xds_server_config_fetcher.cc +7 -5
- data/src/core/ext/xds/xds_transport_grpc.cc +15 -7
- data/src/core/lib/backoff/backoff.cc +2 -4
- data/src/core/lib/channel/call_finalization.h +1 -3
- data/src/core/lib/channel/channel_args.h +114 -14
- data/src/core/lib/channel/channel_trace.cc +3 -4
- data/src/core/lib/channel/promise_based_filter.cc +18 -19
- data/src/core/lib/channel/status_util.cc +27 -0
- data/src/core/lib/channel/status_util.h +10 -0
- data/src/core/lib/config/core_configuration.cc +5 -1
- data/src/core/lib/config/core_configuration.h +33 -0
- data/src/core/lib/debug/stats.cc +26 -30
- data/src/core/lib/debug/stats.h +2 -12
- data/src/core/lib/debug/stats_data.cc +118 -614
- data/src/core/lib/debug/stats_data.h +67 -465
- data/src/core/lib/debug/trace.cc +0 -2
- data/src/core/lib/event_engine/channel_args_endpoint_config.cc +12 -20
- data/src/core/lib/event_engine/channel_args_endpoint_config.h +13 -7
- data/src/core/lib/event_engine/forkable.cc +1 -1
- data/src/core/lib/event_engine/poller.h +14 -12
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +53 -32
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +23 -1
- data/src/core/lib/event_engine/thread_pool.cc +131 -94
- data/src/core/lib/event_engine/thread_pool.h +56 -23
- data/src/core/lib/event_engine/time_util.cc +30 -0
- data/src/core/lib/event_engine/time_util.h +32 -0
- data/src/core/lib/event_engine/utils.cc +0 -5
- data/src/core/lib/event_engine/utils.h +0 -4
- data/src/core/lib/event_engine/windows/iocp.cc +13 -7
- data/src/core/lib/event_engine/windows/iocp.h +2 -1
- data/src/core/lib/event_engine/windows/win_socket.cc +1 -1
- data/src/core/lib/experiments/config.cc +146 -0
- data/src/core/lib/experiments/config.h +43 -0
- data/src/core/lib/experiments/experiments.cc +75 -0
- data/src/core/lib/experiments/experiments.h +56 -0
- data/src/core/lib/gpr/alloc.cc +1 -9
- data/src/core/lib/gpr/log_windows.cc +0 -1
- data/src/core/lib/gpr/string_util_windows.cc +3 -30
- data/src/core/lib/gpr/sync_abseil.cc +0 -14
- data/src/core/lib/gpr/sync_posix.cc +0 -14
- data/src/core/lib/gpr/time_posix.cc +0 -6
- data/src/core/lib/gpr/time_precise.h +1 -1
- data/src/core/lib/gpr/tmpfile_windows.cc +5 -7
- data/src/core/lib/gpr/useful.h +11 -0
- data/src/core/lib/{gpr → gprpp}/env.h +25 -12
- data/src/core/lib/{gpr → gprpp}/env_linux.cc +20 -15
- data/src/core/lib/{gpr → gprpp}/env_posix.cc +11 -10
- data/src/core/lib/gprpp/env_windows.cc +56 -0
- data/src/core/lib/gprpp/fork.cc +14 -22
- data/src/core/lib/gprpp/fork.h +0 -8
- data/src/core/lib/gprpp/global_config_env.cc +7 -6
- data/src/core/lib/gprpp/notification.h +67 -0
- data/src/core/lib/gprpp/packed_table.h +40 -0
- data/src/core/lib/gprpp/ref_counted_ptr.h +20 -33
- data/src/core/lib/gprpp/sorted_pack.h +98 -0
- data/src/core/lib/gprpp/status_helper.h +6 -0
- data/src/core/lib/gprpp/table.h +9 -1
- data/src/core/lib/gprpp/tchar.cc +49 -0
- data/src/core/lib/gprpp/tchar.h +33 -0
- data/src/core/lib/gprpp/time.cc +21 -0
- data/src/core/lib/gprpp/time.h +55 -0
- data/src/core/lib/gprpp/validation_errors.cc +61 -0
- data/src/core/lib/gprpp/validation_errors.h +110 -0
- data/src/core/{ext/filters/client_channel → lib/handshaker}/proxy_mapper.h +3 -3
- data/src/core/{ext/filters/client_channel → lib/handshaker}/proxy_mapper_registry.cc +14 -36
- data/src/core/lib/handshaker/proxy_mapper_registry.h +75 -0
- data/src/core/lib/iomgr/call_combiner.cc +0 -8
- data/src/core/lib/iomgr/closure.h +0 -1
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +14 -10
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +2 -2
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +1 -38
- data/src/core/lib/iomgr/ev_poll_posix.cc +2 -17
- data/src/core/lib/iomgr/exec_ctx.cc +0 -10
- data/src/core/lib/iomgr/exec_ctx.h +7 -31
- data/src/core/lib/iomgr/iocp_windows.cc +1 -2
- data/src/core/lib/iomgr/iomgr.cc +6 -8
- data/src/core/lib/iomgr/iomgr_fwd.h +1 -0
- data/src/core/lib/iomgr/pollset.h +1 -1
- data/src/core/lib/iomgr/pollset_set.h +0 -1
- data/src/core/lib/iomgr/resolve_address.h +1 -0
- data/src/core/lib/iomgr/resolve_address_impl.h +1 -0
- data/src/core/lib/iomgr/resolve_address_posix.cc +1 -0
- data/src/core/lib/iomgr/resolve_address_windows.cc +1 -0
- data/src/core/lib/iomgr/sockaddr_utils_posix.cc +2 -1
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +12 -34
- data/src/core/lib/iomgr/socket_utils_posix.cc +83 -1
- data/src/core/lib/iomgr/socket_utils_posix.h +98 -6
- data/src/core/lib/iomgr/tcp_client.cc +6 -7
- data/src/core/lib/iomgr/tcp_client.h +11 -11
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +6 -6
- data/src/core/lib/iomgr/tcp_client_posix.cc +33 -29
- data/src/core/lib/iomgr/tcp_client_posix.h +12 -9
- data/src/core/lib/iomgr/tcp_client_windows.cc +6 -6
- data/src/core/lib/iomgr/tcp_posix.cc +131 -114
- data/src/core/lib/iomgr/tcp_posix.h +3 -1
- data/src/core/lib/iomgr/tcp_server.cc +5 -4
- data/src/core/lib/iomgr/tcp_server.h +9 -6
- data/src/core/lib/iomgr/tcp_server_posix.cc +17 -28
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +2 -2
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +3 -3
- data/src/core/lib/iomgr/tcp_server_windows.cc +6 -7
- data/src/core/lib/iomgr/tcp_windows.cc +0 -1
- data/src/core/lib/iomgr/tcp_windows.h +0 -1
- data/src/core/lib/iomgr/timer_generic.cc +4 -4
- data/src/core/lib/iomgr/timer_manager.cc +1 -2
- data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +0 -2
- data/src/core/lib/json/json_object_loader.cc +21 -52
- data/src/core/lib/json/json_object_loader.h +56 -76
- data/src/core/lib/json/json_util.cc +2 -1
- data/src/core/lib/load_balancing/lb_policy.h +5 -5
- data/src/core/lib/load_balancing/lb_policy_registry.cc +29 -55
- data/src/core/lib/load_balancing/lb_policy_registry.h +23 -11
- data/src/core/lib/promise/activity.h +2 -3
- data/src/core/lib/promise/context.h +1 -1
- data/src/core/lib/promise/sleep.cc +16 -4
- data/src/core/lib/promise/sleep.h +8 -2
- data/src/core/lib/resolver/resolver.h +13 -3
- data/src/core/lib/resource_quota/api.cc +9 -0
- data/src/core/lib/resource_quota/api.h +6 -0
- data/src/core/lib/resource_quota/arena.cc +1 -3
- data/src/core/lib/resource_quota/memory_quota.cc +8 -24
- data/src/core/lib/resource_quota/memory_quota.h +6 -19
- data/src/core/lib/resource_quota/periodic_update.cc +2 -3
- data/src/core/{ext/xds → lib/security/certificate_provider}/certificate_provider_factory.h +3 -3
- data/src/core/lib/security/certificate_provider/certificate_provider_registry.cc +60 -0
- data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +70 -0
- data/src/core/lib/security/credentials/channel_creds_registry_init.cc +1 -0
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +15 -16
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +2 -1
- data/src/core/lib/security/credentials/google_default/credentials_generic.cc +5 -8
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +6 -6
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +3 -2
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +1 -1
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +1 -2
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +4 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +4 -2
- data/src/core/lib/security/credentials/tls/tls_utils.cc +3 -1
- data/src/core/lib/security/transport/client_auth_filter.cc +12 -1
- data/src/core/lib/security/transport/secure_endpoint.cc +0 -4
- data/src/core/lib/surface/call.cc +1 -11
- data/src/core/lib/surface/channel.cc +3 -2
- data/src/core/lib/surface/completion_queue.cc +16 -28
- data/src/core/lib/surface/completion_queue.h +1 -1
- data/src/core/lib/surface/completion_queue_factory.cc +5 -0
- data/src/core/lib/surface/init.cc +16 -11
- data/src/core/lib/surface/init_internally.cc +24 -0
- data/src/core/lib/surface/init_internally.h +28 -0
- data/src/core/lib/surface/server.cc +1 -7
- data/src/core/lib/surface/server.h +4 -6
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.cc +1 -3
- data/src/core/lib/transport/metadata_batch.cc +2 -3
- data/src/core/lib/transport/metadata_batch.h +9 -7
- data/src/core/lib/transport/parsed_metadata.h +4 -2
- data/src/core/lib/transport/status_conversion.cc +1 -3
- data/src/core/lib/transport/tcp_connect_handshaker.cc +9 -5
- data/src/core/lib/transport/transport.h +0 -1
- data/src/core/lib/transport/transport_impl.h +0 -1
- data/src/core/plugin_registry/grpc_plugin_registry.cc +23 -46
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +13 -25
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/spec/channel_spec.rb +5 -0
- data/src/ruby/spec/generic/server_interceptors_spec.rb +1 -1
- data/src/ruby/spec/user_agent_spec.rb +1 -1
- metadata +33 -19
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +0 -56
- data/src/core/ext/xds/certificate_provider_registry.cc +0 -103
- data/src/core/ext/xds/certificate_provider_registry.h +0 -59
- data/src/core/lib/event_engine/promise.h +0 -78
- data/src/core/lib/gpr/env_windows.cc +0 -74
- data/src/core/lib/gpr/string_windows.h +0 -32
- data/src/core/lib/profiling/basic_timers.cc +0 -295
- data/src/core/lib/profiling/stap_timers.cc +0 -50
- data/src/core/lib/profiling/timers.h +0 -94
@@ -60,10 +60,10 @@
|
|
60
60
|
#include "src/core/ext/transport/chttp2/transport/varint.h"
|
61
61
|
#include "src/core/lib/channel/channel_args.h"
|
62
62
|
#include "src/core/lib/debug/stats.h"
|
63
|
+
#include "src/core/lib/experiments/experiments.h"
|
63
64
|
#include "src/core/lib/gpr/useful.h"
|
64
65
|
#include "src/core/lib/gprpp/bitset.h"
|
65
66
|
#include "src/core/lib/gprpp/debug_location.h"
|
66
|
-
#include "src/core/lib/gprpp/global_config_env.h"
|
67
67
|
#include "src/core/lib/gprpp/ref_counted.h"
|
68
68
|
#include "src/core/lib/gprpp/status_helper.h"
|
69
69
|
#include "src/core/lib/gprpp/time.h"
|
@@ -72,9 +72,7 @@
|
|
72
72
|
#include "src/core/lib/iomgr/error.h"
|
73
73
|
#include "src/core/lib/iomgr/exec_ctx.h"
|
74
74
|
#include "src/core/lib/iomgr/iomgr_fwd.h"
|
75
|
-
#include "src/core/lib/iomgr/pollset.h"
|
76
75
|
#include "src/core/lib/iomgr/timer.h"
|
77
|
-
#include "src/core/lib/profiling/timers.h"
|
78
76
|
#include "src/core/lib/promise/poll.h"
|
79
77
|
#include "src/core/lib/resource_quota/arena.h"
|
80
78
|
#include "src/core/lib/resource_quota/memory_quota.h"
|
@@ -93,12 +91,6 @@
|
|
93
91
|
#include "src/core/lib/transport/transport.h"
|
94
92
|
#include "src/core/lib/transport/transport_impl.h"
|
95
93
|
|
96
|
-
GPR_GLOBAL_CONFIG_DEFINE_BOOL(
|
97
|
-
grpc_experimental_enable_peer_state_based_framing, false,
|
98
|
-
"If set, the max sizes of frames sent to lower layers is controlled based "
|
99
|
-
"on the peer's memory pressure which is reflected in its max http2 frame "
|
100
|
-
"size.");
|
101
|
-
|
102
94
|
#define DEFAULT_CONNECTION_WINDOW_TARGET (1024 * 1024)
|
103
95
|
#define MAX_WINDOW 0x7fffffffu
|
104
96
|
#define MAX_WRITE_BUFFER_SIZE (64 * 1024 * 1024)
|
@@ -450,7 +442,7 @@ static void init_keepalive_pings_if_enabled(grpc_chttp2_transport* t) {
|
|
450
442
|
GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked, init_keepalive_ping, t,
|
451
443
|
grpc_schedule_on_exec_ctx);
|
452
444
|
grpc_timer_init(&t->keepalive_ping_timer,
|
453
|
-
grpc_core::
|
445
|
+
grpc_core::Timestamp::Now() + t->keepalive_time,
|
454
446
|
&t->init_keepalive_ping_locked);
|
455
447
|
} else {
|
456
448
|
// Use GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED to indicate there are no
|
@@ -717,21 +709,18 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
|
|
717
709
|
static int init_stream(grpc_transport* gt, grpc_stream* gs,
|
718
710
|
grpc_stream_refcount* refcount, const void* server_data,
|
719
711
|
grpc_core::Arena* arena) {
|
720
|
-
GPR_TIMER_SCOPE("init_stream", 0);
|
721
712
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>(gt);
|
722
713
|
new (gs) grpc_chttp2_stream(t, refcount, server_data, arena);
|
723
714
|
return 0;
|
724
715
|
}
|
725
716
|
|
726
717
|
static void destroy_stream_locked(void* sp, grpc_error_handle /*error*/) {
|
727
|
-
GPR_TIMER_SCOPE("destroy_stream", 0);
|
728
718
|
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(sp);
|
729
719
|
s->~grpc_chttp2_stream();
|
730
720
|
}
|
731
721
|
|
732
722
|
static void destroy_stream(grpc_transport* gt, grpc_stream* gs,
|
733
723
|
grpc_closure* then_schedule_closure) {
|
734
|
-
GPR_TIMER_SCOPE("destroy_stream", 0);
|
735
724
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>(gt);
|
736
725
|
grpc_chttp2_stream* s = reinterpret_cast<grpc_chttp2_stream*>(gs);
|
737
726
|
|
@@ -794,85 +783,10 @@ static void set_write_state(grpc_chttp2_transport* t,
|
|
794
783
|
}
|
795
784
|
}
|
796
785
|
|
797
|
-
static void inc_initiate_write_reason(
|
798
|
-
grpc_chttp2_initiate_write_reason reason) {
|
799
|
-
switch (reason) {
|
800
|
-
case GRPC_CHTTP2_INITIATE_WRITE_INITIAL_WRITE:
|
801
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_INITIAL_WRITE();
|
802
|
-
break;
|
803
|
-
case GRPC_CHTTP2_INITIATE_WRITE_START_NEW_STREAM:
|
804
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_START_NEW_STREAM();
|
805
|
-
break;
|
806
|
-
case GRPC_CHTTP2_INITIATE_WRITE_SEND_MESSAGE:
|
807
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SEND_MESSAGE();
|
808
|
-
break;
|
809
|
-
case GRPC_CHTTP2_INITIATE_WRITE_SEND_INITIAL_METADATA:
|
810
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SEND_INITIAL_METADATA();
|
811
|
-
break;
|
812
|
-
case GRPC_CHTTP2_INITIATE_WRITE_SEND_TRAILING_METADATA:
|
813
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SEND_TRAILING_METADATA();
|
814
|
-
break;
|
815
|
-
case GRPC_CHTTP2_INITIATE_WRITE_RETRY_SEND_PING:
|
816
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_RETRY_SEND_PING();
|
817
|
-
break;
|
818
|
-
case GRPC_CHTTP2_INITIATE_WRITE_CONTINUE_PINGS:
|
819
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_CONTINUE_PINGS();
|
820
|
-
break;
|
821
|
-
case GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT:
|
822
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_GOAWAY_SENT();
|
823
|
-
break;
|
824
|
-
case GRPC_CHTTP2_INITIATE_WRITE_RST_STREAM:
|
825
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_RST_STREAM();
|
826
|
-
break;
|
827
|
-
case GRPC_CHTTP2_INITIATE_WRITE_CLOSE_FROM_API:
|
828
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_CLOSE_FROM_API();
|
829
|
-
break;
|
830
|
-
case GRPC_CHTTP2_INITIATE_WRITE_STREAM_FLOW_CONTROL:
|
831
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_STREAM_FLOW_CONTROL();
|
832
|
-
break;
|
833
|
-
case GRPC_CHTTP2_INITIATE_WRITE_TRANSPORT_FLOW_CONTROL:
|
834
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_TRANSPORT_FLOW_CONTROL();
|
835
|
-
break;
|
836
|
-
case GRPC_CHTTP2_INITIATE_WRITE_SEND_SETTINGS:
|
837
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SEND_SETTINGS();
|
838
|
-
break;
|
839
|
-
case GRPC_CHTTP2_INITIATE_WRITE_SETTINGS_ACK:
|
840
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SETTINGS_ACK();
|
841
|
-
break;
|
842
|
-
case GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_SETTING:
|
843
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_FLOW_CONTROL_UNSTALLED_BY_SETTING();
|
844
|
-
break;
|
845
|
-
case GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_UPDATE:
|
846
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_FLOW_CONTROL_UNSTALLED_BY_UPDATE();
|
847
|
-
break;
|
848
|
-
case GRPC_CHTTP2_INITIATE_WRITE_APPLICATION_PING:
|
849
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_APPLICATION_PING();
|
850
|
-
break;
|
851
|
-
case GRPC_CHTTP2_INITIATE_WRITE_BDP_PING:
|
852
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_BDP_ESTIMATOR_PING();
|
853
|
-
break;
|
854
|
-
case GRPC_CHTTP2_INITIATE_WRITE_KEEPALIVE_PING:
|
855
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_KEEPALIVE_PING();
|
856
|
-
break;
|
857
|
-
case GRPC_CHTTP2_INITIATE_WRITE_TRANSPORT_FLOW_CONTROL_UNSTALLED:
|
858
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_TRANSPORT_FLOW_CONTROL_UNSTALLED();
|
859
|
-
break;
|
860
|
-
case GRPC_CHTTP2_INITIATE_WRITE_PING_RESPONSE:
|
861
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_PING_RESPONSE();
|
862
|
-
break;
|
863
|
-
case GRPC_CHTTP2_INITIATE_WRITE_FORCE_RST_STREAM:
|
864
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_FORCE_RST_STREAM();
|
865
|
-
break;
|
866
|
-
}
|
867
|
-
}
|
868
|
-
|
869
786
|
void grpc_chttp2_initiate_write(grpc_chttp2_transport* t,
|
870
787
|
grpc_chttp2_initiate_write_reason reason) {
|
871
|
-
GPR_TIMER_SCOPE("grpc_chttp2_initiate_write", 0);
|
872
|
-
|
873
788
|
switch (t->write_state) {
|
874
789
|
case GRPC_CHTTP2_WRITE_STATE_IDLE:
|
875
|
-
inc_initiate_write_reason(reason);
|
876
790
|
set_write_state(t, GRPC_CHTTP2_WRITE_STATE_WRITING,
|
877
791
|
grpc_chttp2_initiate_write_reason_string(reason));
|
878
792
|
GRPC_CHTTP2_REF_TRANSPORT(t, "writing");
|
@@ -924,7 +838,6 @@ static const char* begin_writing_desc(bool partial) {
|
|
924
838
|
|
925
839
|
static void write_action_begin_locked(void* gt,
|
926
840
|
grpc_error_handle /*error_ignored*/) {
|
927
|
-
GPR_TIMER_SCOPE("write_action_begin_locked", 0);
|
928
841
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(gt);
|
929
842
|
GPR_ASSERT(t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE);
|
930
843
|
grpc_chttp2_begin_write_result r;
|
@@ -934,9 +847,6 @@ static void write_action_begin_locked(void* gt,
|
|
934
847
|
r = grpc_chttp2_begin_write(t);
|
935
848
|
}
|
936
849
|
if (r.writing) {
|
937
|
-
if (r.partial) {
|
938
|
-
GRPC_STATS_INC_HTTP2_PARTIAL_WRITES();
|
939
|
-
}
|
940
850
|
set_write_state(t,
|
941
851
|
r.partial ? GRPC_CHTTP2_WRITE_STATE_WRITING_WITH_MORE
|
942
852
|
: GRPC_CHTTP2_WRITE_STATE_WRITING,
|
@@ -956,26 +866,22 @@ static void write_action_begin_locked(void* gt,
|
|
956
866
|
continue_read_action_locked(t);
|
957
867
|
}
|
958
868
|
} else {
|
959
|
-
GRPC_STATS_INC_HTTP2_SPURIOUS_WRITES_BEGUN();
|
960
869
|
set_write_state(t, GRPC_CHTTP2_WRITE_STATE_IDLE, "begin writing nothing");
|
961
870
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "writing");
|
962
871
|
}
|
963
872
|
}
|
964
873
|
|
965
874
|
static void write_action(void* gt, grpc_error_handle /*error*/) {
|
966
|
-
GPR_TIMER_SCOPE("write_action", 0);
|
967
|
-
static bool kEnablePeerStateBasedFraming =
|
968
|
-
GPR_GLOBAL_CONFIG_GET(grpc_experimental_enable_peer_state_based_framing);
|
969
875
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(gt);
|
970
876
|
void* cl = t->cl;
|
971
877
|
t->cl = nullptr;
|
972
|
-
// If
|
878
|
+
// If the peer_state_based_framing experiment is set to true,
|
973
879
|
// choose max_frame_size as 2 * max http2 frame size of peer. If peer is under
|
974
880
|
// high memory pressure, then it would advertise a smaller max http2 frame
|
975
881
|
// size. With this logic, the sender would automatically reduce the sending
|
976
882
|
// frame size as well.
|
977
883
|
int max_frame_size =
|
978
|
-
|
884
|
+
grpc_core::IsPeerStateBasedFramingEnabled()
|
979
885
|
? 2 * t->settings[GRPC_PEER_SETTINGS]
|
980
886
|
[GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE]
|
981
887
|
: INT_MAX;
|
@@ -996,7 +902,6 @@ static void write_action_end(void* tp, grpc_error_handle error) {
|
|
996
902
|
// Callback from the grpc_endpoint after bytes have been written by calling
|
997
903
|
// sendmsg
|
998
904
|
static void write_action_end_locked(void* tp, grpc_error_handle error) {
|
999
|
-
GPR_TIMER_SCOPE("terminate_writing_with_lock", 0);
|
1000
905
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
1001
906
|
|
1002
907
|
bool closed = false;
|
@@ -1018,11 +923,9 @@ static void write_action_end_locked(void* tp, grpc_error_handle error) {
|
|
1018
923
|
case GRPC_CHTTP2_WRITE_STATE_IDLE:
|
1019
924
|
GPR_UNREACHABLE_CODE(break);
|
1020
925
|
case GRPC_CHTTP2_WRITE_STATE_WRITING:
|
1021
|
-
GPR_TIMER_MARK("state=writing", 0);
|
1022
926
|
set_write_state(t, GRPC_CHTTP2_WRITE_STATE_IDLE, "finish writing");
|
1023
927
|
break;
|
1024
928
|
case GRPC_CHTTP2_WRITE_STATE_WRITING_WITH_MORE:
|
1025
|
-
GPR_TIMER_MARK("state=writing_stale_no_poller", 0);
|
1026
929
|
set_write_state(t, GRPC_CHTTP2_WRITE_STATE_WRITING, "continue writing");
|
1027
930
|
GRPC_CHTTP2_REF_TRANSPORT(t, "writing");
|
1028
931
|
// If the transport is closed, we will retry writing on the endpoint
|
@@ -1126,8 +1029,10 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
|
|
1126
1029
|
goaway_error == GRPC_HTTP2_ENHANCE_YOUR_CALM &&
|
1127
1030
|
goaway_text == "too_many_pings")) {
|
1128
1031
|
gpr_log(GPR_ERROR,
|
1129
|
-
"Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug "
|
1130
|
-
"data equal to \"too_many_pings\""
|
1032
|
+
"%s: Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug "
|
1033
|
+
"data equal to \"too_many_pings\". Current keepalive time (before "
|
1034
|
+
"throttling): %s",
|
1035
|
+
t->peer_string.c_str(), t->keepalive_time.ToString().c_str());
|
1131
1036
|
constexpr int max_keepalive_time_millis =
|
1132
1037
|
INT_MAX / KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
|
1133
1038
|
int throttled_keepalive_time =
|
@@ -1251,8 +1156,11 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
|
|
1251
1156
|
grpc_error_handle cl_err =
|
1252
1157
|
grpc_core::internal::StatusMoveFromHeapPtr(closure->error_data.error);
|
1253
1158
|
if (GRPC_ERROR_IS_NONE(cl_err)) {
|
1254
|
-
cl_err =
|
1255
|
-
"Error in HTTP transport completing operation"
|
1159
|
+
cl_err = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
|
1160
|
+
"Error in HTTP transport completing operation: ", desc,
|
1161
|
+
" write_state=", write_state_name(t->write_state), " refs=",
|
1162
|
+
closure->next_data.scratch / CLOSURE_BARRIER_FIRST_REF_BIT, " flags=",
|
1163
|
+
closure->next_data.scratch % CLOSURE_BARRIER_FIRST_REF_BIT));
|
1256
1164
|
cl_err = grpc_error_set_str(cl_err, GRPC_ERROR_STR_TARGET_ADDRESS,
|
1257
1165
|
t->peer_string);
|
1258
1166
|
}
|
@@ -1290,8 +1198,6 @@ static void log_metadata(const grpc_metadata_batch* md_batch, uint32_t id,
|
|
1290
1198
|
|
1291
1199
|
static void perform_stream_op_locked(void* stream_op,
|
1292
1200
|
grpc_error_handle /*error_ignored*/) {
|
1293
|
-
GPR_TIMER_SCOPE("perform_stream_op_locked", 0);
|
1294
|
-
|
1295
1201
|
grpc_transport_stream_op_batch* op =
|
1296
1202
|
static_cast<grpc_transport_stream_op_batch*>(stream_op);
|
1297
1203
|
grpc_chttp2_stream* s =
|
@@ -1299,8 +1205,6 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1299
1205
|
grpc_transport_stream_op_batch_payload* op_payload = op->payload;
|
1300
1206
|
grpc_chttp2_transport* t = s->t;
|
1301
1207
|
|
1302
|
-
GRPC_STATS_INC_HTTP2_OP_BATCHES();
|
1303
|
-
|
1304
1208
|
s->context = op->payload->context;
|
1305
1209
|
s->traced = op->is_traced;
|
1306
1210
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
|
@@ -1328,7 +1232,6 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1328
1232
|
}
|
1329
1233
|
|
1330
1234
|
if (op->cancel_stream) {
|
1331
|
-
GRPC_STATS_INC_HTTP2_OP_CANCEL();
|
1332
1235
|
grpc_chttp2_cancel_stream(t, s, op_payload->cancel_stream.cancel_error);
|
1333
1236
|
}
|
1334
1237
|
|
@@ -1336,7 +1239,6 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1336
1239
|
if (t->is_client && t->channelz_socket != nullptr) {
|
1337
1240
|
t->channelz_socket->RecordStreamStartedFromLocal();
|
1338
1241
|
}
|
1339
|
-
GRPC_STATS_INC_HTTP2_OP_SEND_INITIAL_METADATA();
|
1340
1242
|
GPR_ASSERT(s->send_initial_metadata_finished == nullptr);
|
1341
1243
|
on_complete->next_data.scratch |= CLOSURE_BARRIER_MAY_COVER_WRITE;
|
1342
1244
|
|
@@ -1394,7 +1296,6 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1394
1296
|
}
|
1395
1297
|
|
1396
1298
|
if (op->send_message) {
|
1397
|
-
GRPC_STATS_INC_HTTP2_OP_SEND_MESSAGE();
|
1398
1299
|
t->num_messages_in_next_write++;
|
1399
1300
|
GRPC_STATS_INC_HTTP2_SEND_MESSAGE_SIZE(
|
1400
1301
|
op->payload->send_message.send_message->Length());
|
@@ -1471,7 +1372,6 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1471
1372
|
}
|
1472
1373
|
|
1473
1374
|
if (op->send_trailing_metadata) {
|
1474
|
-
GRPC_STATS_INC_HTTP2_OP_SEND_TRAILING_METADATA();
|
1475
1375
|
GPR_ASSERT(s->send_trailing_metadata_finished == nullptr);
|
1476
1376
|
on_complete->next_data.scratch |= CLOSURE_BARRIER_MAY_COVER_WRITE;
|
1477
1377
|
s->send_trailing_metadata_finished = add_closure_barrier(on_complete);
|
@@ -1503,7 +1403,6 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1503
1403
|
}
|
1504
1404
|
|
1505
1405
|
if (op->recv_initial_metadata) {
|
1506
|
-
GRPC_STATS_INC_HTTP2_OP_RECV_INITIAL_METADATA();
|
1507
1406
|
GPR_ASSERT(s->recv_initial_metadata_ready == nullptr);
|
1508
1407
|
s->recv_initial_metadata_ready =
|
1509
1408
|
op_payload->recv_initial_metadata.recv_initial_metadata_ready;
|
@@ -1519,7 +1418,6 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1519
1418
|
}
|
1520
1419
|
|
1521
1420
|
if (op->recv_message) {
|
1522
|
-
GRPC_STATS_INC_HTTP2_OP_RECV_MESSAGE();
|
1523
1421
|
GPR_ASSERT(s->recv_message_ready == nullptr);
|
1524
1422
|
s->recv_message_ready = op_payload->recv_message.recv_message_ready;
|
1525
1423
|
s->recv_message = op_payload->recv_message.recv_message;
|
@@ -1531,7 +1429,6 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1531
1429
|
}
|
1532
1430
|
|
1533
1431
|
if (op->recv_trailing_metadata) {
|
1534
|
-
GRPC_STATS_INC_HTTP2_OP_RECV_TRAILING_METADATA();
|
1535
1432
|
GPR_ASSERT(s->collecting_stats == nullptr);
|
1536
1433
|
s->collecting_stats = op_payload->recv_trailing_metadata.collect_stats;
|
1537
1434
|
GPR_ASSERT(s->recv_trailing_metadata_finished == nullptr);
|
@@ -1553,7 +1450,6 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1553
1450
|
|
1554
1451
|
static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
1555
1452
|
grpc_transport_stream_op_batch* op) {
|
1556
|
-
GPR_TIMER_SCOPE("perform_stream_op", 0);
|
1557
1453
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>(gt);
|
1558
1454
|
grpc_chttp2_stream* s = reinterpret_cast<grpc_chttp2_stream*>(gs);
|
1559
1455
|
|
@@ -1706,8 +1602,7 @@ class GracefulGoaway : public grpc_core::RefCounted<GracefulGoaway> {
|
|
1706
1602
|
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT);
|
1707
1603
|
Ref().release(); // Ref for the timer
|
1708
1604
|
grpc_timer_init(
|
1709
|
-
&timer_,
|
1710
|
-
grpc_core::ExecCtx::Get()->Now() + grpc_core::Duration::Seconds(20),
|
1605
|
+
&timer_, grpc_core::Timestamp::Now() + grpc_core::Duration::Seconds(20),
|
1711
1606
|
GRPC_CLOSURE_INIT(&on_timer_, OnTimer, this, nullptr));
|
1712
1607
|
}
|
1713
1608
|
|
@@ -2418,7 +2313,7 @@ void grpc_chttp2_act_on_flowctl_action(
|
|
2418
2313
|
grpc_chttp2_transport* t, grpc_chttp2_stream* s) {
|
2419
2314
|
WithUrgency(t, action.send_stream_update(),
|
2420
2315
|
GRPC_CHTTP2_INITIATE_WRITE_STREAM_FLOW_CONTROL, [t, s]() {
|
2421
|
-
if (s->id != 0) {
|
2316
|
+
if (s->id != 0 && !s->read_closed) {
|
2422
2317
|
grpc_chttp2_mark_stream_writable(t, s);
|
2423
2318
|
}
|
2424
2319
|
});
|
@@ -2474,8 +2369,6 @@ static void read_action(void* tp, grpc_error_handle error) {
|
|
2474
2369
|
}
|
2475
2370
|
|
2476
2371
|
static void read_action_locked(void* tp, grpc_error_handle error) {
|
2477
|
-
GPR_TIMER_SCOPE("reading_action_locked", 0);
|
2478
|
-
|
2479
2372
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
2480
2373
|
|
2481
2374
|
(void)GRPC_ERROR_REF(error);
|
@@ -2490,7 +2383,6 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
|
|
2490
2383
|
std::swap(err, error);
|
2491
2384
|
GRPC_ERROR_UNREF(err);
|
2492
2385
|
if (GRPC_ERROR_IS_NONE(t->closed_with_error)) {
|
2493
|
-
GPR_TIMER_SCOPE("reading_action.parse", 0);
|
2494
2386
|
size_t i = 0;
|
2495
2387
|
grpc_error_handle errors[3] = {GRPC_ERROR_REF(error), GRPC_ERROR_NONE,
|
2496
2388
|
GRPC_ERROR_NONE};
|
@@ -2507,7 +2399,6 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
|
|
2507
2399
|
GRPC_ERROR_UNREF(errors[i]);
|
2508
2400
|
}
|
2509
2401
|
|
2510
|
-
GPR_TIMER_SCOPE("post_parse_locked", 0);
|
2511
2402
|
if (t->initial_window_update != 0) {
|
2512
2403
|
if (t->initial_window_update > 0) {
|
2513
2404
|
grpc_chttp2_stream* s;
|
@@ -2521,7 +2412,6 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
|
|
2521
2412
|
}
|
2522
2413
|
}
|
2523
2414
|
|
2524
|
-
GPR_TIMER_SCOPE("post_reading_action_locked", 0);
|
2525
2415
|
bool keep_reading = false;
|
2526
2416
|
if (GRPC_ERROR_IS_NONE(error) && !GRPC_ERROR_IS_NONE(t->closed_with_error)) {
|
2527
2417
|
error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
|
@@ -2568,7 +2458,7 @@ static void continue_read_action_locked(grpc_chttp2_transport* t) {
|
|
2568
2458
|
GRPC_CLOSURE_INIT(&t->read_action_locked, read_action, t,
|
2569
2459
|
grpc_schedule_on_exec_ctx);
|
2570
2460
|
grpc_endpoint_read(t->ep, &t->read_buffer, &t->read_action_locked, urgent,
|
2571
|
-
|
2461
|
+
grpc_chttp2_min_read_progress_size(t));
|
2572
2462
|
}
|
2573
2463
|
|
2574
2464
|
// t is reffed prior to calling the first time, and once the callback chain
|
@@ -2756,16 +2646,21 @@ static void init_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
|
2756
2646
|
GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked, init_keepalive_ping, t,
|
2757
2647
|
grpc_schedule_on_exec_ctx);
|
2758
2648
|
grpc_timer_init(&t->keepalive_ping_timer,
|
2759
|
-
grpc_core::
|
2649
|
+
grpc_core::Timestamp::Now() + t->keepalive_time,
|
2760
2650
|
&t->init_keepalive_ping_locked);
|
2761
2651
|
}
|
2762
2652
|
} else if (error == GRPC_ERROR_CANCELLED) {
|
2763
2653
|
// The keepalive ping timer may be cancelled by bdp
|
2654
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
|
2655
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
|
2656
|
+
gpr_log(GPR_INFO, "%s: Keepalive ping cancelled. Resetting timer.",
|
2657
|
+
t->peer_string.c_str());
|
2658
|
+
}
|
2764
2659
|
GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping");
|
2765
2660
|
GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked, init_keepalive_ping, t,
|
2766
2661
|
grpc_schedule_on_exec_ctx);
|
2767
2662
|
grpc_timer_init(&t->keepalive_ping_timer,
|
2768
|
-
grpc_core::
|
2663
|
+
grpc_core::Timestamp::Now() + t->keepalive_time,
|
2769
2664
|
&t->init_keepalive_ping_locked);
|
2770
2665
|
}
|
2771
2666
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "init keepalive ping");
|
@@ -2794,7 +2689,7 @@ static void start_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
|
2794
2689
|
GRPC_CLOSURE_INIT(&t->keepalive_watchdog_fired_locked,
|
2795
2690
|
keepalive_watchdog_fired, t, grpc_schedule_on_exec_ctx);
|
2796
2691
|
grpc_timer_init(&t->keepalive_watchdog_timer,
|
2797
|
-
grpc_core::
|
2692
|
+
grpc_core::Timestamp::Now() + t->keepalive_timeout,
|
2798
2693
|
&t->keepalive_watchdog_fired_locked);
|
2799
2694
|
t->keepalive_ping_started = true;
|
2800
2695
|
}
|
@@ -2830,7 +2725,7 @@ static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
|
2830
2725
|
GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked, init_keepalive_ping, t,
|
2831
2726
|
grpc_schedule_on_exec_ctx);
|
2832
2727
|
grpc_timer_init(&t->keepalive_ping_timer,
|
2833
|
-
grpc_core::
|
2728
|
+
grpc_core::Timestamp::Now() + t->keepalive_time,
|
2834
2729
|
&t->init_keepalive_ping_locked);
|
2835
2730
|
}
|
2836
2731
|
}
|