grpc 1.49.1-x86_64-linux → 1.50.0.pre1-x86_64-linux
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/2.6/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.7/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/3.0/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/3.1/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/grpc_c.so +0 -0
- 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
@@ -52,7 +52,6 @@
|
|
52
52
|
#include "src/core/lib/iomgr/executor.h"
|
53
53
|
#include "src/core/lib/iomgr/iomgr.h"
|
54
54
|
#include "src/core/lib/iomgr/pollset.h"
|
55
|
-
#include "src/core/lib/profiling/timers.h"
|
56
55
|
#include "src/core/lib/surface/api_trace.h"
|
57
56
|
#include "src/core/lib/surface/event_string.h"
|
58
57
|
|
@@ -489,17 +488,9 @@ grpc_cq_completion* CqEventQueue::Pop() {
|
|
489
488
|
grpc_cq_completion* c = nullptr;
|
490
489
|
|
491
490
|
if (gpr_spinlock_trylock(&queue_lock_)) {
|
492
|
-
GRPC_STATS_INC_CQ_EV_QUEUE_TRYLOCK_SUCCESSES();
|
493
|
-
|
494
491
|
bool is_empty = false;
|
495
492
|
c = reinterpret_cast<grpc_cq_completion*>(queue_.PopAndCheckEnd(&is_empty));
|
496
493
|
gpr_spinlock_unlock(&queue_lock_);
|
497
|
-
|
498
|
-
if (c == nullptr && !is_empty) {
|
499
|
-
GRPC_STATS_INC_CQ_EV_QUEUE_TRANSIENT_POP_FAILURES();
|
500
|
-
}
|
501
|
-
} else {
|
502
|
-
GRPC_STATS_INC_CQ_EV_QUEUE_TRYLOCK_FAILURES();
|
503
494
|
}
|
504
495
|
|
505
496
|
if (c) {
|
@@ -512,8 +503,6 @@ grpc_cq_completion* CqEventQueue::Pop() {
|
|
512
503
|
grpc_completion_queue* grpc_completion_queue_create_internal(
|
513
504
|
grpc_cq_completion_type completion_type, grpc_cq_polling_type polling_type,
|
514
505
|
grpc_completion_queue_functor* shutdown_callback) {
|
515
|
-
GPR_TIMER_SCOPE("grpc_completion_queue_create_internal", 0);
|
516
|
-
|
517
506
|
grpc_completion_queue* cq;
|
518
507
|
|
519
508
|
GRPC_API_TRACE(
|
@@ -521,12 +510,23 @@ grpc_completion_queue* grpc_completion_queue_create_internal(
|
|
521
510
|
"polling_type=%d)",
|
522
511
|
2, (completion_type, polling_type));
|
523
512
|
|
513
|
+
switch (completion_type) {
|
514
|
+
case GRPC_CQ_NEXT:
|
515
|
+
GRPC_STATS_INC_CQ_NEXT_CREATES();
|
516
|
+
break;
|
517
|
+
case GRPC_CQ_PLUCK:
|
518
|
+
GRPC_STATS_INC_CQ_PLUCK_CREATES();
|
519
|
+
break;
|
520
|
+
case GRPC_CQ_CALLBACK:
|
521
|
+
GRPC_STATS_INC_CQ_CALLBACK_CREATES();
|
522
|
+
break;
|
523
|
+
}
|
524
|
+
|
524
525
|
const cq_vtable* vtable = &g_cq_vtable[completion_type];
|
525
526
|
const cq_poller_vtable* poller_vtable =
|
526
527
|
&g_poller_vtable_by_poller_type[polling_type];
|
527
528
|
|
528
529
|
grpc_core::ExecCtx exec_ctx;
|
529
|
-
GRPC_STATS_INC_CQS_CREATED();
|
530
530
|
|
531
531
|
cq = static_cast<grpc_completion_queue*>(
|
532
532
|
gpr_zalloc(sizeof(grpc_completion_queue) + vtable->data_size +
|
@@ -690,8 +690,6 @@ static void cq_end_op_for_next(
|
|
690
690
|
grpc_completion_queue* cq, void* tag, grpc_error_handle error,
|
691
691
|
void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg,
|
692
692
|
grpc_cq_completion* storage, bool /*internal*/) {
|
693
|
-
GPR_TIMER_SCOPE("cq_end_op_for_next", 0);
|
694
|
-
|
695
693
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) ||
|
696
694
|
(GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) &&
|
697
695
|
!GRPC_ERROR_IS_NONE(error))) {
|
@@ -768,8 +766,6 @@ static void cq_end_op_for_pluck(
|
|
768
766
|
grpc_completion_queue* cq, void* tag, grpc_error_handle error,
|
769
767
|
void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg,
|
770
768
|
grpc_cq_completion* storage, bool /*internal*/) {
|
771
|
-
GPR_TIMER_SCOPE("cq_end_op_for_pluck", 0);
|
772
|
-
|
773
769
|
cq_pluck_data* cqd = static_cast<cq_pluck_data*> DATA_FROM_CQ(cq);
|
774
770
|
int is_success = (GRPC_ERROR_IS_NONE(error));
|
775
771
|
|
@@ -838,8 +834,6 @@ static void cq_end_op_for_callback(
|
|
838
834
|
grpc_completion_queue* cq, void* tag, grpc_error_handle error,
|
839
835
|
void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg,
|
840
836
|
grpc_cq_completion* storage, bool internal) {
|
841
|
-
GPR_TIMER_SCOPE("cq_end_op_for_callback", 0);
|
842
|
-
|
843
837
|
cq_callback_data* cqd = static_cast<cq_callback_data*> DATA_FROM_CQ(cq);
|
844
838
|
|
845
839
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) ||
|
@@ -935,7 +929,7 @@ class ExecCtxNext : public grpc_core::ExecCtx {
|
|
935
929
|
return true;
|
936
930
|
}
|
937
931
|
}
|
938
|
-
return !a->first_loop && a->deadline < grpc_core::
|
932
|
+
return !a->first_loop && a->deadline < grpc_core::Timestamp::Now();
|
939
933
|
}
|
940
934
|
|
941
935
|
private:
|
@@ -960,8 +954,6 @@ static void dump_pending_tags(grpc_completion_queue* /*cq*/) {}
|
|
960
954
|
|
961
955
|
static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
|
962
956
|
void* reserved) {
|
963
|
-
GPR_TIMER_SCOPE("grpc_completion_queue_next", 0);
|
964
|
-
|
965
957
|
grpc_event ret;
|
966
958
|
cq_next_data* cqd = static_cast<cq_next_data*> DATA_FROM_CQ(cq);
|
967
959
|
|
@@ -1041,7 +1033,7 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
|
|
1041
1033
|
}
|
1042
1034
|
|
1043
1035
|
if (!is_finished_arg.first_loop &&
|
1044
|
-
grpc_core::
|
1036
|
+
grpc_core::Timestamp::Now() >= deadline_millis) {
|
1045
1037
|
ret.type = GRPC_QUEUE_TIMEOUT;
|
1046
1038
|
ret.success = 0;
|
1047
1039
|
dump_pending_tags(cq);
|
@@ -1196,7 +1188,7 @@ class ExecCtxPluck : public grpc_core::ExecCtx {
|
|
1196
1188
|
}
|
1197
1189
|
gpr_mu_unlock(cq->mu);
|
1198
1190
|
}
|
1199
|
-
return !a->first_loop && a->deadline < grpc_core::
|
1191
|
+
return !a->first_loop && a->deadline < grpc_core::Timestamp::Now();
|
1200
1192
|
}
|
1201
1193
|
|
1202
1194
|
private:
|
@@ -1205,8 +1197,6 @@ class ExecCtxPluck : public grpc_core::ExecCtx {
|
|
1205
1197
|
|
1206
1198
|
static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
|
1207
1199
|
gpr_timespec deadline, void* reserved) {
|
1208
|
-
GPR_TIMER_SCOPE("grpc_completion_queue_pluck", 0);
|
1209
|
-
|
1210
1200
|
grpc_event ret;
|
1211
1201
|
grpc_cq_completion* c;
|
1212
1202
|
grpc_cq_completion* prev;
|
@@ -1289,7 +1279,7 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
|
|
1289
1279
|
break;
|
1290
1280
|
}
|
1291
1281
|
if (!is_finished_arg.first_loop &&
|
1292
|
-
grpc_core::
|
1282
|
+
grpc_core::Timestamp::Now() >= deadline_millis) {
|
1293
1283
|
del_plucker(cq, tag, &worker);
|
1294
1284
|
gpr_mu_unlock(cq->mu);
|
1295
1285
|
ret.type = GRPC_QUEUE_TIMEOUT;
|
@@ -1412,7 +1402,6 @@ static void cq_shutdown_callback(grpc_completion_queue* cq) {
|
|
1412
1402
|
/* Shutdown simply drops a ref that we reserved at creation time; if we drop
|
1413
1403
|
to zero here, then enter shutdown mode and wake up any waiters */
|
1414
1404
|
void grpc_completion_queue_shutdown(grpc_completion_queue* cq) {
|
1415
|
-
GPR_TIMER_SCOPE("grpc_completion_queue_shutdown", 0);
|
1416
1405
|
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
1417
1406
|
grpc_core::ExecCtx exec_ctx;
|
1418
1407
|
GRPC_API_TRACE("grpc_completion_queue_shutdown(cq=%p)", 1, (cq));
|
@@ -1420,7 +1409,6 @@ void grpc_completion_queue_shutdown(grpc_completion_queue* cq) {
|
|
1420
1409
|
}
|
1421
1410
|
|
1422
1411
|
void grpc_completion_queue_destroy(grpc_completion_queue* cq) {
|
1423
|
-
GPR_TIMER_SCOPE("grpc_completion_queue_destroy", 0);
|
1424
1412
|
GRPC_API_TRACE("grpc_completion_queue_destroy(cq=%p)", 1, (cq));
|
1425
1413
|
grpc_completion_queue_shutdown(cq);
|
1426
1414
|
|
@@ -31,7 +31,7 @@
|
|
31
31
|
#include "src/core/lib/gprpp/manual_constructor.h"
|
32
32
|
#include "src/core/lib/gprpp/mpscq.h"
|
33
33
|
#include "src/core/lib/iomgr/error.h"
|
34
|
-
#include "src/core/lib/iomgr/
|
34
|
+
#include "src/core/lib/iomgr/iomgr_fwd.h"
|
35
35
|
|
36
36
|
/* These trace flags default to 1. The corresponding lines are only traced
|
37
37
|
if grpc_api_trace is also truthy */
|
@@ -23,6 +23,7 @@
|
|
23
23
|
#include <grpc/grpc.h>
|
24
24
|
#include <grpc/support/log.h>
|
25
25
|
|
26
|
+
#include "src/core/lib/iomgr/exec_ctx.h"
|
26
27
|
#include "src/core/lib/surface/completion_queue.h"
|
27
28
|
|
28
29
|
/*
|
@@ -60,6 +61,7 @@ const grpc_completion_queue_factory* grpc_completion_queue_factory_lookup(
|
|
60
61
|
*/
|
61
62
|
|
62
63
|
grpc_completion_queue* grpc_completion_queue_create_for_next(void* reserved) {
|
64
|
+
grpc_core::ExecCtx exec_ctx;
|
63
65
|
GPR_ASSERT(!reserved);
|
64
66
|
grpc_completion_queue_attributes attr = {1, GRPC_CQ_NEXT,
|
65
67
|
GRPC_CQ_DEFAULT_POLLING, nullptr};
|
@@ -67,6 +69,7 @@ grpc_completion_queue* grpc_completion_queue_create_for_next(void* reserved) {
|
|
67
69
|
}
|
68
70
|
|
69
71
|
grpc_completion_queue* grpc_completion_queue_create_for_pluck(void* reserved) {
|
72
|
+
grpc_core::ExecCtx exec_ctx;
|
70
73
|
GPR_ASSERT(!reserved);
|
71
74
|
grpc_completion_queue_attributes attr = {1, GRPC_CQ_PLUCK,
|
72
75
|
GRPC_CQ_DEFAULT_POLLING, nullptr};
|
@@ -75,6 +78,7 @@ grpc_completion_queue* grpc_completion_queue_create_for_pluck(void* reserved) {
|
|
75
78
|
|
76
79
|
grpc_completion_queue* grpc_completion_queue_create_for_callback(
|
77
80
|
grpc_completion_queue_functor* shutdown_callback, void* reserved) {
|
81
|
+
grpc_core::ExecCtx exec_ctx;
|
78
82
|
GPR_ASSERT(!reserved);
|
79
83
|
grpc_completion_queue_attributes attr = {
|
80
84
|
2, GRPC_CQ_CALLBACK, GRPC_CQ_DEFAULT_POLLING, shutdown_callback};
|
@@ -84,6 +88,7 @@ grpc_completion_queue* grpc_completion_queue_create_for_callback(
|
|
84
88
|
grpc_completion_queue* grpc_completion_queue_create(
|
85
89
|
const grpc_completion_queue_factory* factory,
|
86
90
|
const grpc_completion_queue_attributes* attr, void* reserved) {
|
91
|
+
grpc_core::ExecCtx exec_ctx;
|
87
92
|
GPR_ASSERT(!reserved);
|
88
93
|
return factory->vtable->create(factory, attr);
|
89
94
|
}
|
@@ -33,18 +33,21 @@
|
|
33
33
|
#include <grpc/support/sync.h>
|
34
34
|
#include <grpc/support/time.h>
|
35
35
|
|
36
|
+
#include "src/core/ext/filters/client_channel/backup_poller.h"
|
36
37
|
#include "src/core/lib/channel/channel_args.h"
|
37
38
|
#include "src/core/lib/channel/channel_stack_builder.h"
|
38
39
|
#include "src/core/lib/config/core_configuration.h"
|
39
40
|
#include "src/core/lib/debug/trace.h"
|
41
|
+
#include "src/core/lib/event_engine/default_event_engine.h"
|
40
42
|
#include "src/core/lib/event_engine/forkable.h"
|
43
|
+
#include "src/core/lib/event_engine/posix_engine/timer_manager.h"
|
44
|
+
#include "src/core/lib/experiments/config.h"
|
41
45
|
#include "src/core/lib/gprpp/fork.h"
|
42
46
|
#include "src/core/lib/gprpp/sync.h"
|
43
47
|
#include "src/core/lib/gprpp/thd.h"
|
44
48
|
#include "src/core/lib/iomgr/exec_ctx.h"
|
45
49
|
#include "src/core/lib/iomgr/iomgr.h"
|
46
50
|
#include "src/core/lib/iomgr/timer_manager.h"
|
47
|
-
#include "src/core/lib/profiling/timers.h"
|
48
51
|
#include "src/core/lib/security/authorization/grpc_server_authz_filter.h"
|
49
52
|
#include "src/core/lib/security/credentials/credentials.h"
|
50
53
|
#include "src/core/lib/security/security_connector/security_connector.h"
|
@@ -52,6 +55,7 @@
|
|
52
55
|
#include "src/core/lib/surface/api_trace.h"
|
53
56
|
#include "src/core/lib/surface/channel_init.h"
|
54
57
|
#include "src/core/lib/surface/channel_stack_type.h"
|
58
|
+
#include "src/core/lib/surface/init_internally.h"
|
55
59
|
|
56
60
|
/* (generated) built in registry of plugins */
|
57
61
|
extern void grpc_register_built_in_plugins(void);
|
@@ -114,11 +118,19 @@ void RegisterSecurityFilters(CoreConfiguration::Builder* builder) {
|
|
114
118
|
} // namespace grpc_core
|
115
119
|
|
116
120
|
static void do_basic_init(void) {
|
121
|
+
grpc_core::InitInternally = grpc_init;
|
122
|
+
grpc_core::ShutdownInternally = grpc_shutdown;
|
117
123
|
gpr_log_verbosity_init();
|
118
124
|
g_init_mu = new grpc_core::Mutex();
|
119
125
|
g_shutting_down_cv = new grpc_core::CondVar();
|
120
126
|
grpc_register_built_in_plugins();
|
121
127
|
gpr_time_init();
|
128
|
+
grpc_core::PrintExperimentsList();
|
129
|
+
grpc_core::Fork::GlobalInit();
|
130
|
+
grpc_event_engine::experimental::RegisterForkHandlers();
|
131
|
+
grpc_fork_handlers_auto_register();
|
132
|
+
grpc_tracer_init();
|
133
|
+
grpc_client_channel_global_init_backup_polling();
|
122
134
|
}
|
123
135
|
|
124
136
|
typedef struct grpc_plugin {
|
@@ -147,18 +159,12 @@ void grpc_init(void) {
|
|
147
159
|
g_shutting_down = false;
|
148
160
|
g_shutting_down_cv->SignalAll();
|
149
161
|
}
|
150
|
-
grpc_core::Fork::GlobalInit();
|
151
|
-
grpc_event_engine::experimental::RegisterForkHandlers();
|
152
|
-
grpc_fork_handlers_auto_register();
|
153
|
-
grpc_core::ApplicationCallbackExecCtx::GlobalInit();
|
154
162
|
grpc_iomgr_init();
|
155
|
-
gpr_timers_global_init();
|
156
163
|
for (int i = 0; i < g_number_of_plugins; i++) {
|
157
164
|
if (g_all_of_the_plugins[i].init != nullptr) {
|
158
165
|
g_all_of_the_plugins[i].init();
|
159
166
|
}
|
160
167
|
}
|
161
|
-
grpc_tracer_init();
|
162
168
|
grpc_iomgr_start();
|
163
169
|
}
|
164
170
|
|
@@ -179,12 +185,9 @@ void grpc_shutdown_internal_locked(void)
|
|
179
185
|
}
|
180
186
|
}
|
181
187
|
}
|
188
|
+
grpc_event_engine::experimental::ResetDefaultEventEngine();
|
182
189
|
grpc_iomgr_shutdown();
|
183
|
-
gpr_timers_global_destroy();
|
184
|
-
grpc_tracer_shutdown();
|
185
|
-
grpc_core::Fork::GlobalShutdown();
|
186
190
|
}
|
187
|
-
grpc_core::ApplicationCallbackExecCtx::GlobalShutdown();
|
188
191
|
g_shutting_down = false;
|
189
192
|
g_shutting_down_cv->SignalAll();
|
190
193
|
}
|
@@ -208,6 +211,8 @@ void grpc_shutdown(void) {
|
|
208
211
|
grpc_core::ApplicationCallbackExecCtx* acec =
|
209
212
|
grpc_core::ApplicationCallbackExecCtx::Get();
|
210
213
|
if (!grpc_iomgr_is_any_background_poller_thread() &&
|
214
|
+
!grpc_event_engine::posix_engine::TimerManager::
|
215
|
+
IsTimerManagerThread() &&
|
211
216
|
(acec == nullptr ||
|
212
217
|
(acec->Flags() & GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD) ==
|
213
218
|
0)) {
|
@@ -0,0 +1,24 @@
|
|
1
|
+
// Copyright 2022 gRPC authors.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
#include <grpc/support/port_platform.h>
|
16
|
+
|
17
|
+
#include "src/core/lib/surface/init_internally.h"
|
18
|
+
|
19
|
+
namespace grpc_core {
|
20
|
+
|
21
|
+
void (*InitInternally)();
|
22
|
+
void (*ShutdownInternally)();
|
23
|
+
|
24
|
+
} // namespace grpc_core
|
@@ -0,0 +1,28 @@
|
|
1
|
+
// Copyright 2022 gRPC authors.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
#ifndef GRPC_CORE_LIB_SURFACE_INIT_INTERNALLY_H
|
16
|
+
#define GRPC_CORE_LIB_SURFACE_INIT_INTERNALLY_H
|
17
|
+
|
18
|
+
namespace grpc_core {
|
19
|
+
|
20
|
+
// Function pointers that should be used in preference to grpc_init,
|
21
|
+
// grpc_shutdown from within core, but otherwise do the same thing.
|
22
|
+
// Avoids a build dependency cycle between grpc and grpc_base (and friends).
|
23
|
+
extern void (*InitInternally)();
|
24
|
+
extern void (*ShutdownInternally)();
|
25
|
+
|
26
|
+
} // namespace grpc_core
|
27
|
+
|
28
|
+
#endif // GRPC_CORE_LIB_SURFACE_INIT_INTERNALLY_H
|
@@ -45,7 +45,6 @@
|
|
45
45
|
#include "src/core/lib/channel/channel_trace.h"
|
46
46
|
#include "src/core/lib/channel/channelz.h"
|
47
47
|
#include "src/core/lib/config/core_configuration.h"
|
48
|
-
#include "src/core/lib/debug/stats.h"
|
49
48
|
#include "src/core/lib/gpr/useful.h"
|
50
49
|
#include "src/core/lib/gprpp/debug_location.h"
|
51
50
|
#include "src/core/lib/gprpp/mpscq.h"
|
@@ -275,14 +274,12 @@ class Server::RealRequestMatcher : public RequestMatcherInterface {
|
|
275
274
|
RequestedCall* rc =
|
276
275
|
reinterpret_cast<RequestedCall*>(requests_per_cq_[cq_idx].TryPop());
|
277
276
|
if (rc != nullptr) {
|
278
|
-
GRPC_STATS_INC_SERVER_CQS_CHECKED(i);
|
279
277
|
calld->SetState(CallData::CallState::ACTIVATED);
|
280
278
|
calld->Publish(cq_idx, rc);
|
281
279
|
return;
|
282
280
|
}
|
283
281
|
}
|
284
282
|
// No cq to take the request found; queue it on the slow list.
|
285
|
-
GRPC_STATS_INC_SERVER_SLOWPATH_REQUESTS_QUEUED();
|
286
283
|
// We need to ensure that all the queues are empty. We do this under
|
287
284
|
// the server mu_call_ lock to ensure that if something is added to
|
288
285
|
// an empty request queue, it will block until the call is actually
|
@@ -306,7 +303,6 @@ class Server::RealRequestMatcher : public RequestMatcherInterface {
|
|
306
303
|
return;
|
307
304
|
}
|
308
305
|
}
|
309
|
-
GRPC_STATS_INC_SERVER_CQS_CHECKED(loop_count + requests_per_cq_.size());
|
310
306
|
calld->SetState(CallData::CallState::ACTIVATED);
|
311
307
|
calld->Publish(cq_idx, rc);
|
312
308
|
}
|
@@ -794,7 +790,7 @@ void DonePublishedShutdown(void* /*done_arg*/, grpc_cq_completion* storage) {
|
|
794
790
|
// connection is NOT closed until the server is done with all those calls.
|
795
791
|
// -- Once there are no more calls in progress, the channel is closed.
|
796
792
|
void Server::ShutdownAndNotify(grpc_completion_queue* cq, void* tag) {
|
797
|
-
|
793
|
+
Notification* await_requests = nullptr;
|
798
794
|
ChannelBroadcaster broadcaster;
|
799
795
|
{
|
800
796
|
// Wait for startup to be finished. Locks mu_global.
|
@@ -1525,7 +1521,6 @@ grpc_call_error grpc_server_request_call(
|
|
1525
1521
|
grpc_completion_queue* cq_for_notification, void* tag) {
|
1526
1522
|
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
1527
1523
|
grpc_core::ExecCtx exec_ctx;
|
1528
|
-
GRPC_STATS_INC_SERVER_REQUESTED_CALLS();
|
1529
1524
|
GRPC_API_TRACE(
|
1530
1525
|
"grpc_server_request_call("
|
1531
1526
|
"server=%p, call=%p, details=%p, initial_metadata=%p, "
|
@@ -1546,7 +1541,6 @@ grpc_call_error grpc_server_request_registered_call(
|
|
1546
1541
|
grpc_completion_queue* cq_for_notification, void* tag_new) {
|
1547
1542
|
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
1548
1543
|
grpc_core::ExecCtx exec_ctx;
|
1549
|
-
GRPC_STATS_INC_SERVER_REQUESTED_CALLS();
|
1550
1544
|
auto* rm =
|
1551
1545
|
static_cast<grpc_core::Server::RegisteredMethod*>(registered_method);
|
1552
1546
|
GRPC_API_TRACE(
|
@@ -33,7 +33,6 @@
|
|
33
33
|
#include "absl/base/thread_annotations.h"
|
34
34
|
#include "absl/memory/memory.h"
|
35
35
|
#include "absl/status/statusor.h"
|
36
|
-
#include "absl/synchronization/notification.h"
|
37
36
|
#include "absl/types/optional.h"
|
38
37
|
|
39
38
|
#include <grpc/grpc.h>
|
@@ -49,6 +48,7 @@
|
|
49
48
|
#include "src/core/lib/debug/trace.h"
|
50
49
|
#include "src/core/lib/gprpp/cpp_impl_of.h"
|
51
50
|
#include "src/core/lib/gprpp/dual_ref_counted.h"
|
51
|
+
#include "src/core/lib/gprpp/notification.h"
|
52
52
|
#include "src/core/lib/gprpp/orphanable.h"
|
53
53
|
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
54
54
|
#include "src/core/lib/gprpp/sync.h"
|
@@ -58,7 +58,6 @@
|
|
58
58
|
#include "src/core/lib/iomgr/endpoint.h"
|
59
59
|
#include "src/core/lib/iomgr/error.h"
|
60
60
|
#include "src/core/lib/iomgr/iomgr_fwd.h"
|
61
|
-
#include "src/core/lib/iomgr/pollset.h"
|
62
61
|
#include "src/core/lib/slice/slice.h"
|
63
62
|
#include "src/core/lib/surface/channel.h"
|
64
63
|
#include "src/core/lib/surface/completion_queue.h"
|
@@ -420,14 +419,14 @@ class Server : public InternallyRefCounted<Server>,
|
|
420
419
|
}
|
421
420
|
// Returns a notification pointer to wait on if there are requests in-flight,
|
422
421
|
// or null.
|
423
|
-
|
422
|
+
Notification* ShutdownUnrefOnShutdownCall()
|
424
423
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_global_) GRPC_MUST_USE_RESULT {
|
425
424
|
if (shutdown_refs_.fetch_sub(1, std::memory_order_acq_rel) == 1) {
|
426
425
|
// There is no request in-flight.
|
427
426
|
MaybeFinishShutdown();
|
428
427
|
return nullptr;
|
429
428
|
}
|
430
|
-
requests_complete_ = absl::make_unique<
|
429
|
+
requests_complete_ = absl::make_unique<Notification>();
|
431
430
|
return requests_complete_.get();
|
432
431
|
}
|
433
432
|
|
@@ -479,8 +478,7 @@ class Server : public InternallyRefCounted<Server>,
|
|
479
478
|
std::atomic<int> shutdown_refs_{1};
|
480
479
|
bool shutdown_published_ ABSL_GUARDED_BY(mu_global_) = false;
|
481
480
|
std::vector<ShutdownTag> shutdown_tags_ ABSL_GUARDED_BY(mu_global_);
|
482
|
-
std::unique_ptr<
|
483
|
-
ABSL_GUARDED_BY(mu_global_);
|
481
|
+
std::unique_ptr<Notification> requests_complete_ ABSL_GUARDED_BY(mu_global_);
|
484
482
|
|
485
483
|
std::list<ChannelData*> channels_;
|
486
484
|
|
@@ -23,6 +23,6 @@
|
|
23
23
|
|
24
24
|
#include <grpc/grpc.h>
|
25
25
|
|
26
|
-
const char* grpc_version_string(void) { return "
|
26
|
+
const char* grpc_version_string(void) { return "28.0.0"; }
|
27
27
|
|
28
|
-
const char* grpc_g_stands_for(void) { return "
|
28
|
+
const char* grpc_g_stands_for(void) { return "galley"; }
|
@@ -25,8 +25,6 @@
|
|
25
25
|
|
26
26
|
#include <algorithm>
|
27
27
|
|
28
|
-
#include "src/core/lib/iomgr/exec_ctx.h"
|
29
|
-
|
30
28
|
grpc_core::TraceFlag grpc_bdp_estimator_trace(false, "bdp_estimator");
|
31
29
|
|
32
30
|
namespace grpc_core {
|
@@ -82,7 +80,7 @@ Timestamp BdpEstimator::CompletePing() {
|
|
82
80
|
}
|
83
81
|
ping_state_ = PingState::UNSCHEDULED;
|
84
82
|
accumulator_ = 0;
|
85
|
-
return
|
83
|
+
return Timestamp::Now() + inter_ping_delay_;
|
86
84
|
}
|
87
85
|
|
88
86
|
} // namespace grpc_core
|
@@ -24,7 +24,6 @@
|
|
24
24
|
#include "absl/strings/match.h"
|
25
25
|
#include "absl/strings/str_cat.h"
|
26
26
|
|
27
|
-
#include "src/core/lib/iomgr/exec_ctx.h"
|
28
27
|
#include "src/core/lib/transport/timeout_encoding.h"
|
29
28
|
|
30
29
|
namespace grpc_core {
|
@@ -120,11 +119,11 @@ GrpcTimeoutMetadata::ValueType GrpcTimeoutMetadata::MementoToValue(
|
|
120
119
|
if (timeout == Duration::Infinity()) {
|
121
120
|
return Timestamp::InfFuture();
|
122
121
|
}
|
123
|
-
return
|
122
|
+
return Timestamp::Now() + timeout;
|
124
123
|
}
|
125
124
|
|
126
125
|
Slice GrpcTimeoutMetadata::Encode(ValueType x) {
|
127
|
-
return Timeout::FromDuration(x -
|
126
|
+
return Timeout::FromDuration(x - Timestamp::Now()).Encode();
|
128
127
|
}
|
129
128
|
|
130
129
|
TeMetadata::MementoType TeMetadata::ParseMemento(
|
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
#include "src/core/lib/compression/compression_internal.h"
|
42
42
|
#include "src/core/lib/gprpp/chunked_vector.h"
|
43
|
-
#include "src/core/lib/gprpp/
|
43
|
+
#include "src/core/lib/gprpp/packed_table.h"
|
44
44
|
#include "src/core/lib/gprpp/time.h"
|
45
45
|
#include "src/core/lib/resource_quota/arena.h"
|
46
46
|
#include "src/core/lib/slice/slice.h"
|
@@ -93,7 +93,7 @@ struct ContentTypeMetadata {
|
|
93
93
|
// gRPC says that content-type can be application/grpc[;something]
|
94
94
|
// Core has only ever verified the prefix.
|
95
95
|
// IF we want to start verifying more, we can expand this type.
|
96
|
-
enum ValueType {
|
96
|
+
enum ValueType : uint8_t {
|
97
97
|
kApplicationGrpc,
|
98
98
|
kEmpty,
|
99
99
|
kInvalid,
|
@@ -112,7 +112,7 @@ struct ContentTypeMetadata {
|
|
112
112
|
// scheme metadata trait.
|
113
113
|
struct HttpSchemeMetadata {
|
114
114
|
static constexpr bool kRepeatable = false;
|
115
|
-
enum ValueType {
|
115
|
+
enum ValueType : uint8_t {
|
116
116
|
kHttp,
|
117
117
|
kHttps,
|
118
118
|
kInvalid,
|
@@ -134,7 +134,7 @@ struct HttpSchemeMetadata {
|
|
134
134
|
// method metadata trait.
|
135
135
|
struct HttpMethodMetadata {
|
136
136
|
static constexpr bool kRepeatable = false;
|
137
|
-
enum ValueType {
|
137
|
+
enum ValueType : uint8_t {
|
138
138
|
kPost,
|
139
139
|
kGet,
|
140
140
|
kPut,
|
@@ -498,7 +498,7 @@ class ParseHelper {
|
|
498
498
|
return ParsedMetadata<Container>(
|
499
499
|
trait,
|
500
500
|
ParseValueToMemento<typename Trait::MementoType, Trait::ParseMemento>(),
|
501
|
-
transport_size_);
|
501
|
+
static_cast<uint32_t>(transport_size_));
|
502
502
|
}
|
503
503
|
|
504
504
|
GPR_ATTRIBUTE_NOINLINE ParsedMetadata<Container> NotFound(
|
@@ -1045,7 +1045,9 @@ class MetadataMap {
|
|
1045
1045
|
// void Encode(string_view key, Slice value);
|
1046
1046
|
template <typename Encoder>
|
1047
1047
|
void Encode(Encoder* encoder) const {
|
1048
|
-
table_.
|
1048
|
+
table_.template ForEachIn<metadata_detail::EncodeWrapper<Encoder>,
|
1049
|
+
Value<Traits>...>(
|
1050
|
+
metadata_detail::EncodeWrapper<Encoder>{encoder});
|
1049
1051
|
for (const auto& unk : unknown_) {
|
1050
1052
|
encoder->Encode(unk.first, unk.second);
|
1051
1053
|
}
|
@@ -1222,7 +1224,7 @@ class MetadataMap {
|
|
1222
1224
|
using Value = metadata_detail::Value<Which>;
|
1223
1225
|
|
1224
1226
|
// Table of known metadata types.
|
1225
|
-
|
1227
|
+
PackedTable<Value<Traits>...> table_;
|
1226
1228
|
metadata_detail::UnknownMap unknown_;
|
1227
1229
|
};
|
1228
1230
|
|
@@ -152,7 +152,7 @@ class ParsedMetadata {
|
|
152
152
|
// Construct metadata from a string key, slice value pair.
|
153
153
|
ParsedMetadata(Slice key, Slice value)
|
154
154
|
: vtable_(ParsedMetadata::KeyValueVTable(key.as_string_view())),
|
155
|
-
transport_size_(key.size() + value.size() + 32) {
|
155
|
+
transport_size_(static_cast<uint32_t>(key.size() + value.size() + 32)) {
|
156
156
|
value_.pointer =
|
157
157
|
new std::pair<Slice, Slice>(std::move(key), std::move(value));
|
158
158
|
}
|
@@ -191,7 +191,9 @@ class ParsedMetadata {
|
|
191
191
|
ParsedMetadata result;
|
192
192
|
result.vtable_ = vtable_;
|
193
193
|
result.value_ = value_;
|
194
|
-
result.transport_size_ =
|
194
|
+
result.transport_size_ =
|
195
|
+
TransportSize(static_cast<uint32_t>(key().length()),
|
196
|
+
static_cast<uint32_t>(value.length()));
|
195
197
|
vtable_->with_new_value(&value, on_error, &result);
|
196
198
|
return result;
|
197
199
|
}
|
@@ -20,8 +20,6 @@
|
|
20
20
|
|
21
21
|
#include "src/core/lib/transport/status_conversion.h"
|
22
22
|
|
23
|
-
#include "src/core/lib/iomgr/exec_ctx.h"
|
24
|
-
|
25
23
|
grpc_http2_error_code grpc_status_to_http2_error(grpc_status_code status) {
|
26
24
|
switch (status) {
|
27
25
|
case GRPC_STATUS_OK:
|
@@ -50,7 +48,7 @@ grpc_status_code grpc_http2_error_to_grpc_status(
|
|
50
48
|
case GRPC_HTTP2_CANCEL:
|
51
49
|
/* http2 cancel translates to STATUS_CANCELLED iff deadline hasn't been
|
52
50
|
* exceeded */
|
53
|
-
return grpc_core::
|
51
|
+
return grpc_core::Timestamp::Now() > deadline
|
54
52
|
? GRPC_STATUS_DEADLINE_EXCEEDED
|
55
53
|
: GRPC_STATUS_CANCELLED;
|
56
54
|
case GRPC_HTTP2_ENHANCE_YOUR_CALM:
|
@@ -35,6 +35,7 @@
|
|
35
35
|
#include "src/core/lib/address_utils/parse_address.h"
|
36
36
|
#include "src/core/lib/channel/channel_args.h"
|
37
37
|
#include "src/core/lib/config/core_configuration.h"
|
38
|
+
#include "src/core/lib/event_engine/channel_args_endpoint_config.h"
|
38
39
|
#include "src/core/lib/gprpp/debug_location.h"
|
39
40
|
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
40
41
|
#include "src/core/lib/gprpp/sync.h"
|
@@ -154,9 +155,11 @@ void TCPConnectHandshaker::DoHandshake(grpc_tcp_server_acceptor* /*acceptor*/,
|
|
154
155
|
// we don't want to pass args->endpoint directly.
|
155
156
|
// Instead pass endpoint_ and swap this endpoint to
|
156
157
|
// args endpoint on success.
|
157
|
-
|
158
|
-
|
159
|
-
|
158
|
+
// TODO(hork): use EventEngine::Connect if(IsEventEngineClientEnabled())
|
159
|
+
grpc_tcp_client_connect(
|
160
|
+
&connected_, &endpoint_to_destroy_, interested_parties_,
|
161
|
+
grpc_event_engine::experimental::ChannelArgsEndpointConfig(args->args),
|
162
|
+
&addr_, args->deadline);
|
160
163
|
}
|
161
164
|
|
162
165
|
void TCPConnectHandshaker::Connected(void* arg, grpc_error_handle error) {
|
@@ -179,8 +182,9 @@ void TCPConnectHandshaker::Connected(void* arg, grpc_error_handle error) {
|
|
179
182
|
self->shutdown_ = true;
|
180
183
|
self->FinishLocked(error);
|
181
184
|
} else {
|
182
|
-
// The on_handshake_done_ is already as part of shutdown when
|
183
|
-
// So nothing to be done here other than unrefing the
|
185
|
+
// The on_handshake_done_ is already as part of shutdown when
|
186
|
+
// connecting So nothing to be done here other than unrefing the
|
187
|
+
// error.
|
184
188
|
GRPC_ERROR_UNREF(error);
|
185
189
|
}
|
186
190
|
return;
|
@@ -49,7 +49,6 @@
|
|
49
49
|
#include "src/core/lib/iomgr/error.h"
|
50
50
|
#include "src/core/lib/iomgr/iomgr_fwd.h"
|
51
51
|
#include "src/core/lib/iomgr/polling_entity.h"
|
52
|
-
#include "src/core/lib/iomgr/pollset.h"
|
53
52
|
#include "src/core/lib/promise/arena_promise.h"
|
54
53
|
#include "src/core/lib/promise/context.h"
|
55
54
|
#include "src/core/lib/promise/latch.h"
|
@@ -28,7 +28,6 @@
|
|
28
28
|
#include "src/core/lib/iomgr/closure.h"
|
29
29
|
#include "src/core/lib/iomgr/endpoint.h"
|
30
30
|
#include "src/core/lib/iomgr/iomgr_fwd.h"
|
31
|
-
#include "src/core/lib/iomgr/pollset.h"
|
32
31
|
#include "src/core/lib/promise/arena_promise.h"
|
33
32
|
#include "src/core/lib/resource_quota/arena.h"
|
34
33
|
#include "src/core/lib/transport/transport.h"
|