grpc 1.25.0 → 1.26.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 +782 -291
- data/include/grpc/impl/codegen/grpc_types.h +4 -0
- data/include/grpc/impl/codegen/port_platform.h +7 -0
- data/include/grpc/support/alloc.h +0 -16
- data/src/core/ext/filters/client_channel/backend_metric.cc +2 -2
- data/src/core/ext/filters/client_channel/backup_poller.cc +1 -1
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +2 -2
- data/src/core/ext/filters/client_channel/client_channel.cc +95 -88
- data/src/core/ext/filters/client_channel/client_channel_channelz.cc +7 -7
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +4 -2
- data/src/core/ext/filters/client_channel/client_channel_factory.cc +1 -1
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +3 -3
- data/src/core/ext/filters/client_channel/connector.h +40 -45
- data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +10 -10
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +16 -13
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +66 -37
- data/src/core/ext/filters/client_channel/http_proxy.cc +107 -116
- data/src/core/ext/filters/client_channel/http_proxy.h +5 -1
- data/src/core/ext/filters/client_channel/lb_policy.cc +3 -3
- data/src/core/ext/filters/client_channel/lb_policy.h +9 -5
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +10 -8
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +18 -19
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +4 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +4 -4
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +6 -9
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +368 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +157 -77
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +5 -5
- data/src/core/ext/filters/client_channel/lb_policy_registry.h +1 -1
- data/src/core/ext/filters/client_channel/local_subchannel_pool.cc +8 -8
- data/src/core/ext/filters/client_channel/proxy_mapper.h +14 -34
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.cc +46 -79
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +23 -17
- data/src/core/ext/filters/client_channel/resolver.cc +2 -1
- data/src/core/ext/filters/client_channel/resolver.h +2 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +4 -4
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +13 -10
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +3 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +9 -8
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +17 -16
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +2 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +4 -4
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +9 -9
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +5 -3
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver_factory.h +3 -3
- data/src/core/ext/filters/client_channel/resolver_registry.cc +14 -12
- data/src/core/ext/filters/client_channel/resolver_registry.h +6 -4
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +6 -6
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +6 -6
- data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +5 -5
- data/src/core/ext/filters/client_channel/resolving_lb_policy.h +3 -3
- data/src/core/ext/filters/client_channel/service_config.cc +15 -14
- data/src/core/ext/filters/client_channel/service_config.h +14 -19
- data/src/core/ext/filters/client_channel/subchannel.cc +38 -36
- data/src/core/ext/filters/client_channel/subchannel.h +11 -12
- data/src/core/ext/filters/client_channel/subchannel_interface.h +1 -1
- data/src/core/ext/filters/client_channel/xds/xds_api.cc +19 -9
- data/src/core/ext/filters/client_channel/xds/xds_api.h +19 -9
- data/src/core/ext/filters/client_channel/xds/xds_bootstrap.cc +3 -3
- data/src/core/ext/filters/client_channel/xds/xds_bootstrap.h +6 -5
- data/src/core/ext/filters/client_channel/xds/xds_client.cc +58 -31
- data/src/core/ext/filters/client_channel/xds/xds_client.h +20 -15
- data/src/core/ext/filters/client_channel/xds/xds_client_stats.cc +5 -3
- data/src/core/ext/filters/client_channel/xds/xds_client_stats.h +18 -15
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +10 -10
- data/src/core/ext/filters/deadline/deadline_filter.cc +15 -13
- data/src/core/ext/filters/http/client/http_client_filter.cc +12 -12
- data/src/core/ext/filters/http/client_authority_filter.cc +3 -3
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +13 -7
- data/src/core/ext/filters/http/server/http_server_filter.cc +14 -13
- data/src/core/ext/filters/max_age/max_age_filter.cc +16 -14
- data/src/core/ext/filters/message_size/message_size_filter.cc +10 -8
- data/src/core/ext/filters/message_size/message_size_filter.h +1 -1
- data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +9 -8
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +141 -174
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +31 -1
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +7 -6
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +14 -12
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +8 -5
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +46 -38
- data/src/core/ext/transport/chttp2/transport/context_list.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/flow_control.h +0 -5
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +6 -7
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +4 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +5 -5
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +11 -8
- data/src/core/ext/transport/chttp2/transport/internal.h +3 -3
- data/src/core/ext/transport/chttp2/transport/parsing.cc +4 -4
- data/src/core/ext/transport/chttp2/transport/writing.cc +3 -2
- data/src/core/ext/transport/inproc/inproc_transport.cc +65 -41
- data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.c +141 -70
- data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h +352 -118
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c +8 -4
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h +65 -0
- data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c +16 -2
- data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h +36 -0
- data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c +12 -5
- data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h +34 -0
- data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c +1 -2
- data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c +13 -12
- data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h +28 -24
- data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c +5 -4
- data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h +13 -0
- data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.c +23 -23
- data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.h +48 -44
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/type/http.upb.c +16 -0
- data/src/core/ext/upb-generated/envoy/type/http.upb.h +36 -0
- data/src/core/ext/upb-generated/envoy/type/percent.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/type/range.upb.c +0 -1
- data/src/core/lib/avl/avl.cc +1 -1
- data/src/core/lib/channel/channel_stack.cc +1 -1
- data/src/core/lib/channel/channel_stack.h +16 -4
- data/src/core/lib/channel/channel_trace.cc +4 -4
- data/src/core/lib/channel/channelz.cc +46 -46
- data/src/core/lib/channel/channelz.h +37 -35
- data/src/core/lib/channel/channelz_registry.cc +2 -2
- data/src/core/lib/channel/channelz_registry.h +1 -1
- data/src/core/lib/channel/connected_channel.cc +3 -2
- data/src/core/lib/channel/handshaker.cc +1 -1
- data/src/core/lib/channel/handshaker_registry.cc +5 -5
- data/src/core/lib/channel/handshaker_registry.h +3 -3
- data/src/core/lib/compression/message_compress.cc +3 -2
- data/src/core/lib/compression/stream_compression_identity.cc +5 -7
- data/src/core/lib/gpr/alloc.cc +4 -29
- data/src/core/lib/gpr/cpu_linux.cc +1 -1
- data/src/core/lib/gprpp/fork.cc +4 -4
- data/src/core/lib/gprpp/global_config_env.cc +7 -7
- data/src/core/lib/gprpp/global_config_env.h +2 -2
- data/src/core/lib/gprpp/host_port.cc +8 -8
- data/src/core/lib/gprpp/host_port.h +3 -3
- data/src/core/lib/gprpp/inlined_vector.h +13 -0
- data/src/core/lib/gprpp/map.h +2 -9
- data/src/core/lib/gprpp/memory.h +12 -98
- data/src/core/lib/gprpp/orphanable.h +3 -3
- data/src/core/lib/gprpp/ref_counted.h +3 -3
- data/src/core/lib/gprpp/ref_counted_ptr.h +1 -1
- data/src/core/lib/gprpp/string_view.h +45 -23
- data/src/core/lib/gprpp/thd.h +1 -1
- data/src/core/lib/gprpp/thd_posix.cc +6 -5
- data/src/core/lib/gprpp/thd_windows.cc +3 -3
- data/src/core/lib/http/httpcli.cc +1 -1
- data/src/core/lib/http/httpcli_security_connector.cc +3 -3
- data/src/core/lib/iomgr/buffer_list.cc +10 -5
- data/src/core/lib/iomgr/call_combiner.cc +7 -6
- data/src/core/lib/iomgr/call_combiner.h +4 -3
- data/src/core/lib/iomgr/cfstream_handle.cc +2 -2
- data/src/core/lib/iomgr/closure.h +33 -135
- data/src/core/lib/iomgr/combiner.cc +10 -17
- data/src/core/lib/iomgr/combiner.h +0 -2
- data/src/core/lib/iomgr/endpoint_cfstream.cc +2 -2
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +1 -1
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +3 -2
- data/src/core/lib/iomgr/ev_epollex_linux.cc +23 -13
- data/src/core/lib/iomgr/ev_poll_posix.cc +30 -17
- data/src/core/lib/iomgr/exec_ctx.cc +52 -5
- data/src/core/lib/iomgr/exec_ctx.h +6 -2
- data/src/core/lib/iomgr/executor.cc +16 -37
- data/src/core/lib/iomgr/executor.h +4 -7
- data/src/core/lib/iomgr/executor/threadpool.cc +4 -4
- data/src/core/lib/iomgr/iomgr_custom.cc +1 -1
- data/src/core/lib/iomgr/lockfree_event.cc +9 -8
- data/src/core/lib/iomgr/logical_thread.cc +103 -0
- data/src/core/lib/iomgr/logical_thread.h +52 -0
- data/src/core/lib/iomgr/pollset_custom.cc +5 -5
- data/src/core/lib/iomgr/pollset_set_custom.cc +9 -9
- data/src/core/lib/iomgr/pollset_windows.cc +16 -2
- data/src/core/lib/iomgr/port.h +3 -0
- data/src/core/lib/iomgr/resolve_address_custom.cc +4 -4
- data/src/core/lib/iomgr/resolve_address_posix.cc +8 -9
- data/src/core/lib/iomgr/resolve_address_windows.cc +4 -6
- data/src/core/lib/iomgr/resource_quota.cc +26 -21
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +11 -0
- data/src/core/lib/iomgr/socket_windows.cc +2 -2
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +2 -2
- data/src/core/lib/iomgr/tcp_client_custom.cc +2 -2
- data/src/core/lib/iomgr/tcp_client_posix.cc +5 -4
- data/src/core/lib/iomgr/tcp_client_windows.cc +2 -2
- data/src/core/lib/iomgr/tcp_custom.cc +10 -9
- data/src/core/lib/iomgr/tcp_posix.cc +19 -15
- data/src/core/lib/iomgr/tcp_server_custom.cc +3 -2
- data/src/core/lib/iomgr/tcp_server_posix.cc +5 -4
- data/src/core/lib/iomgr/tcp_server_windows.cc +5 -3
- data/src/core/lib/iomgr/tcp_windows.cc +16 -13
- data/src/core/lib/iomgr/timer_custom.cc +4 -3
- data/src/core/lib/iomgr/timer_generic.cc +11 -9
- data/src/core/lib/iomgr/udp_server.cc +16 -13
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +8 -5
- data/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +45 -57
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +7 -6
- data/src/core/lib/security/credentials/credentials.cc +8 -8
- data/src/core/lib/security/credentials/credentials.h +5 -5
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +5 -5
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +1 -1
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +4 -4
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +4 -4
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +2 -2
- data/src/core/lib/security/credentials/local/local_credentials.cc +3 -3
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +13 -11
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +6 -5
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +4 -4
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +5 -5
- data/src/core/lib/security/credentials/tls/spiffe_credentials.cc +2 -2
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +28 -22
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +5 -0
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +10 -10
- data/src/core/lib/security/security_connector/load_system_roots_linux.cc +2 -1
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +8 -8
- data/src/core/lib/security/security_connector/security_connector.h +1 -1
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +9 -9
- data/src/core/lib/security/security_connector/ssl_utils.cc +5 -4
- data/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc +14 -15
- data/src/core/lib/security/transport/client_auth_filter.cc +4 -3
- data/src/core/lib/security/transport/secure_endpoint.cc +9 -8
- data/src/core/lib/security/transport/security_handshaker.cc +67 -23
- data/src/core/lib/security/transport/server_auth_filter.cc +6 -5
- data/src/core/lib/security/transport/target_authority_table.h +1 -1
- data/src/core/lib/slice/b64.cc +3 -4
- data/src/core/lib/slice/b64.h +1 -2
- data/src/core/lib/slice/slice.cc +8 -13
- data/src/core/lib/surface/call.cc +19 -19
- data/src/core/lib/surface/call.h +6 -7
- data/src/core/lib/surface/call_log_batch.cc +1 -2
- data/src/core/lib/surface/channel.cc +17 -18
- data/src/core/lib/surface/channel.h +4 -19
- data/src/core/lib/surface/channel_ping.cc +1 -1
- data/src/core/lib/surface/completion_queue.cc +21 -22
- data/src/core/lib/surface/completion_queue_factory.cc +1 -1
- data/src/core/lib/surface/init.cc +1 -1
- data/src/core/lib/surface/init_secure.cc +2 -2
- data/src/core/lib/surface/lame_client.cc +10 -12
- data/src/core/lib/surface/server.cc +24 -18
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/byte_stream.cc +2 -2
- data/src/core/lib/transport/byte_stream.h +2 -1
- data/src/core/lib/transport/connectivity_state.cc +4 -4
- data/src/core/lib/transport/connectivity_state.h +2 -2
- data/src/core/lib/transport/metadata.cc +8 -10
- data/src/core/lib/transport/metadata.h +5 -8
- data/src/core/lib/transport/metadata_batch.cc +6 -0
- data/src/core/lib/transport/static_metadata.cc +2 -4
- data/src/core/lib/transport/status_metadata.cc +7 -0
- data/src/core/lib/transport/status_metadata.h +18 -0
- data/src/core/lib/transport/transport.cc +9 -7
- data/src/core/plugin_registry/grpc_plugin_registry.cc +4 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +292 -43
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +197 -46
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +4 -2
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +5 -0
- data/src/core/tsi/ssl/session_cache/ssl_session.h +1 -1
- data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +1 -1
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +4 -4
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +1 -1
- data/src/core/tsi/ssl_transport_security.cc +2 -1
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +0 -4
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +0 -6
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/upb/upb/decode.c +1 -0
- metadata +34 -32
- data/src/core/ext/filters/client_channel/connector.cc +0 -41
- data/src/core/ext/filters/client_channel/proxy_mapper.cc +0 -48
- data/src/core/lib/gprpp/set.h +0 -33
@@ -32,6 +32,7 @@
|
|
32
32
|
#include "src/core/lib/channel/status_util.h"
|
33
33
|
#include "src/core/lib/gpr/string.h"
|
34
34
|
#include "src/core/lib/gpr/useful.h"
|
35
|
+
#include "src/core/lib/gprpp/atomic.h"
|
35
36
|
#include "src/core/lib/gprpp/host_port.h"
|
36
37
|
#include "src/core/lib/gprpp/memory.h"
|
37
38
|
#include "src/core/lib/iomgr/error.h"
|
@@ -54,7 +55,7 @@ namespace channelz {
|
|
54
55
|
namespace {
|
55
56
|
|
56
57
|
void* parent_uuid_copy(void* p) { return p; }
|
57
|
-
void parent_uuid_destroy(void* p) {}
|
58
|
+
void parent_uuid_destroy(void* /*p*/) {}
|
58
59
|
int parent_uuid_cmp(void* p1, void* p2) { return GPR_ICMP(p1, p2); }
|
59
60
|
const grpc_arg_pointer_vtable parent_uuid_vtable = {
|
60
61
|
parent_uuid_copy, parent_uuid_destroy, parent_uuid_cmp};
|
@@ -85,7 +86,7 @@ intptr_t GetParentUuidFromArgs(const grpc_channel_args& args) {
|
|
85
86
|
// BaseNode
|
86
87
|
//
|
87
88
|
|
88
|
-
BaseNode::BaseNode(EntityType type,
|
89
|
+
BaseNode::BaseNode(EntityType type, std::string name)
|
89
90
|
: type_(type), uuid_(-1), name_(std::move(name)) {
|
90
91
|
// The registry will set uuid_ under its lock.
|
91
92
|
ChannelzRegistry::Register(this);
|
@@ -180,11 +181,11 @@ void CallCountingHelper::PopulateCallCounts(grpc_json* json) {
|
|
180
181
|
// ChannelNode
|
181
182
|
//
|
182
183
|
|
183
|
-
ChannelNode::ChannelNode(
|
184
|
-
|
184
|
+
ChannelNode::ChannelNode(std::string target, size_t channel_tracer_max_nodes,
|
185
|
+
intptr_t parent_uuid)
|
185
186
|
: BaseNode(parent_uuid == 0 ? EntityType::kTopLevelChannel
|
186
187
|
: EntityType::kInternalChannel,
|
187
|
-
|
188
|
+
target),
|
188
189
|
target_(std::move(target)),
|
189
190
|
trace_(channel_tracer_max_nodes),
|
190
191
|
parent_uuid_(parent_uuid) {}
|
@@ -239,8 +240,8 @@ grpc_json* ChannelNode::RenderJson() {
|
|
239
240
|
json = data;
|
240
241
|
}
|
241
242
|
// populate the target.
|
242
|
-
GPR_ASSERT(target_.
|
243
|
-
grpc_json_create_child(nullptr, json, "target", target_.
|
243
|
+
GPR_ASSERT(!target_.empty());
|
244
|
+
grpc_json_create_child(nullptr, json, "target", target_.c_str(),
|
244
245
|
GRPC_JSON_STRING, false);
|
245
246
|
// fill in the channel trace if applicable
|
246
247
|
grpc_json* trace_json = trace_.RenderJson();
|
@@ -315,9 +316,8 @@ void ChannelNode::RemoveChildSubchannel(intptr_t child_uuid) {
|
|
315
316
|
// ServerNode
|
316
317
|
//
|
317
318
|
|
318
|
-
ServerNode::ServerNode(grpc_server* server
|
319
|
-
: BaseNode(EntityType::kServer,
|
320
|
-
trace_(channel_tracer_max_nodes) {}
|
319
|
+
ServerNode::ServerNode(grpc_server* /*server*/, size_t channel_tracer_max_nodes)
|
320
|
+
: BaseNode(EntityType::kServer, ""), trace_(channel_tracer_max_nodes) {}
|
321
321
|
|
322
322
|
ServerNode::~ServerNode() {}
|
323
323
|
|
@@ -363,7 +363,8 @@ char* ServerNode::RenderServerSockets(intptr_t start_socket_id,
|
|
363
363
|
json_iterator = grpc_json_add_number_string_child(
|
364
364
|
socket_ref_json, nullptr, "socketId", it->first);
|
365
365
|
grpc_json_create_child(json_iterator, socket_ref_json, "name",
|
366
|
-
it->second->name(), GRPC_JSON_STRING,
|
366
|
+
it->second->name().c_str(), GRPC_JSON_STRING,
|
367
|
+
false);
|
367
368
|
}
|
368
369
|
}
|
369
370
|
if (sockets_rendered == child_sockets_.size()) {
|
@@ -416,7 +417,8 @@ grpc_json* ServerNode::RenderJson() {
|
|
416
417
|
grpc_json* sibling_iterator = grpc_json_add_number_string_child(
|
417
418
|
json_iterator, nullptr, "socketId", it.first);
|
418
419
|
grpc_json_create_child(sibling_iterator, json_iterator, "name",
|
419
|
-
it.second->name(), GRPC_JSON_STRING,
|
420
|
+
it.second->name().c_str(), GRPC_JSON_STRING,
|
421
|
+
false);
|
420
422
|
}
|
421
423
|
}
|
422
424
|
return top_level_json;
|
@@ -441,8 +443,8 @@ void PopulateSocketAddressJson(grpc_json* json, const char* name,
|
|
441
443
|
(strcmp(uri->scheme, "ipv6") == 0))) {
|
442
444
|
const char* host_port = uri->path;
|
443
445
|
if (*host_port == '/') ++host_port;
|
444
|
-
UniquePtr<char> host;
|
445
|
-
UniquePtr<char> port;
|
446
|
+
grpc_core::UniquePtr<char> host;
|
447
|
+
grpc_core::UniquePtr<char> port;
|
446
448
|
GPR_ASSERT(SplitHostPort(host_port, &host, &port));
|
447
449
|
int port_num = -1;
|
448
450
|
if (port != nullptr) {
|
@@ -479,33 +481,32 @@ void PopulateSocketAddressJson(grpc_json* json, const char* name,
|
|
479
481
|
|
480
482
|
} // namespace
|
481
483
|
|
482
|
-
SocketNode::SocketNode(
|
483
|
-
UniquePtr<char> name)
|
484
|
+
SocketNode::SocketNode(std::string local, std::string remote, std::string name)
|
484
485
|
: BaseNode(EntityType::kSocket, std::move(name)),
|
485
486
|
local_(std::move(local)),
|
486
487
|
remote_(std::move(remote)) {}
|
487
488
|
|
488
489
|
void SocketNode::RecordStreamStartedFromLocal() {
|
489
|
-
|
490
|
-
|
491
|
-
|
490
|
+
streams_started_.FetchAdd(1, MemoryOrder::RELAXED);
|
491
|
+
last_local_stream_created_cycle_.Store(gpr_get_cycle_counter(),
|
492
|
+
MemoryOrder::RELAXED);
|
492
493
|
}
|
493
494
|
|
494
495
|
void SocketNode::RecordStreamStartedFromRemote() {
|
495
|
-
|
496
|
-
|
497
|
-
|
496
|
+
streams_started_.FetchAdd(1, MemoryOrder::RELAXED);
|
497
|
+
last_remote_stream_created_cycle_.Store(gpr_get_cycle_counter(),
|
498
|
+
MemoryOrder::RELAXED);
|
498
499
|
}
|
499
500
|
|
500
501
|
void SocketNode::RecordMessagesSent(uint32_t num_sent) {
|
501
|
-
|
502
|
-
|
502
|
+
messages_sent_.FetchAdd(num_sent, MemoryOrder::RELAXED);
|
503
|
+
last_message_sent_cycle_.Store(gpr_get_cycle_counter(), MemoryOrder::RELAXED);
|
503
504
|
}
|
504
505
|
|
505
506
|
void SocketNode::RecordMessageReceived() {
|
506
|
-
|
507
|
-
|
508
|
-
|
507
|
+
messages_received_.FetchAdd(1, MemoryOrder::RELAXED);
|
508
|
+
last_message_received_cycle_.Store(gpr_get_cycle_counter(),
|
509
|
+
MemoryOrder::RELAXED);
|
509
510
|
}
|
510
511
|
|
511
512
|
grpc_json* SocketNode::RenderJson() {
|
@@ -520,11 +521,11 @@ grpc_json* SocketNode::RenderJson() {
|
|
520
521
|
json_iterator = nullptr;
|
521
522
|
json_iterator = grpc_json_add_number_string_child(json, json_iterator,
|
522
523
|
"socketId", uuid());
|
523
|
-
json_iterator = grpc_json_create_child(
|
524
|
-
|
524
|
+
json_iterator = grpc_json_create_child(
|
525
|
+
json_iterator, json, "name", name().c_str(), GRPC_JSON_STRING, false);
|
525
526
|
json = top_level_json;
|
526
|
-
PopulateSocketAddressJson(json, "remote", remote_.
|
527
|
-
PopulateSocketAddressJson(json, "local", local_.
|
527
|
+
PopulateSocketAddressJson(json, "remote", remote_.c_str());
|
528
|
+
PopulateSocketAddressJson(json, "local", local_.c_str());
|
528
529
|
// reset json iterators to top level object
|
529
530
|
json = top_level_json;
|
530
531
|
json_iterator = nullptr;
|
@@ -534,12 +535,12 @@ grpc_json* SocketNode::RenderJson() {
|
|
534
535
|
json = data;
|
535
536
|
json_iterator = nullptr;
|
536
537
|
gpr_timespec ts;
|
537
|
-
|
538
|
+
int64_t streams_started = streams_started_.Load(MemoryOrder::RELAXED);
|
538
539
|
if (streams_started != 0) {
|
539
540
|
json_iterator = grpc_json_add_number_string_child(
|
540
541
|
json, json_iterator, "streamsStarted", streams_started);
|
541
542
|
gpr_cycle_counter last_local_stream_created_cycle =
|
542
|
-
|
543
|
+
last_local_stream_created_cycle_.Load(MemoryOrder::RELAXED);
|
543
544
|
if (last_local_stream_created_cycle != 0) {
|
544
545
|
ts = gpr_convert_clock_type(
|
545
546
|
gpr_cycle_counter_to_time(last_local_stream_created_cycle),
|
@@ -549,7 +550,7 @@ grpc_json* SocketNode::RenderJson() {
|
|
549
550
|
gpr_format_timespec(ts), GRPC_JSON_STRING, true);
|
550
551
|
}
|
551
552
|
gpr_cycle_counter last_remote_stream_created_cycle =
|
552
|
-
|
553
|
+
last_remote_stream_created_cycle_.Load(MemoryOrder::RELAXED);
|
553
554
|
if (last_remote_stream_created_cycle != 0) {
|
554
555
|
ts = gpr_convert_clock_type(
|
555
556
|
gpr_cycle_counter_to_time(last_remote_stream_created_cycle),
|
@@ -559,41 +560,41 @@ grpc_json* SocketNode::RenderJson() {
|
|
559
560
|
gpr_format_timespec(ts), GRPC_JSON_STRING, true);
|
560
561
|
}
|
561
562
|
}
|
562
|
-
|
563
|
+
int64_t streams_succeeded = streams_succeeded_.Load(MemoryOrder::RELAXED);
|
563
564
|
if (streams_succeeded != 0) {
|
564
565
|
json_iterator = grpc_json_add_number_string_child(
|
565
566
|
json, json_iterator, "streamsSucceeded", streams_succeeded);
|
566
567
|
}
|
567
|
-
|
568
|
+
int64_t streams_failed = streams_failed_.Load(MemoryOrder::RELAXED);
|
568
569
|
if (streams_failed) {
|
569
570
|
json_iterator = grpc_json_add_number_string_child(
|
570
571
|
json, json_iterator, "streamsFailed", streams_failed);
|
571
572
|
}
|
572
|
-
|
573
|
+
int64_t messages_sent = messages_sent_.Load(MemoryOrder::RELAXED);
|
573
574
|
if (messages_sent != 0) {
|
574
575
|
json_iterator = grpc_json_add_number_string_child(
|
575
576
|
json, json_iterator, "messagesSent", messages_sent);
|
576
577
|
ts = gpr_convert_clock_type(
|
577
578
|
gpr_cycle_counter_to_time(
|
578
|
-
|
579
|
+
last_message_sent_cycle_.Load(MemoryOrder::RELAXED)),
|
579
580
|
GPR_CLOCK_REALTIME);
|
580
581
|
json_iterator =
|
581
582
|
grpc_json_create_child(json_iterator, json, "lastMessageSentTimestamp",
|
582
583
|
gpr_format_timespec(ts), GRPC_JSON_STRING, true);
|
583
584
|
}
|
584
|
-
|
585
|
+
int64_t messages_received = messages_received_.Load(MemoryOrder::RELAXED);
|
585
586
|
if (messages_received != 0) {
|
586
587
|
json_iterator = grpc_json_add_number_string_child(
|
587
588
|
json, json_iterator, "messagesReceived", messages_received);
|
588
589
|
ts = gpr_convert_clock_type(
|
589
590
|
gpr_cycle_counter_to_time(
|
590
|
-
|
591
|
+
last_message_received_cycle_.Load(MemoryOrder::RELAXED)),
|
591
592
|
GPR_CLOCK_REALTIME);
|
592
593
|
json_iterator = grpc_json_create_child(
|
593
594
|
json_iterator, json, "lastMessageReceivedTimestamp",
|
594
595
|
gpr_format_timespec(ts), GRPC_JSON_STRING, true);
|
595
596
|
}
|
596
|
-
|
597
|
+
int64_t keepalives_sent = keepalives_sent_.Load(MemoryOrder::RELAXED);
|
597
598
|
if (keepalives_sent != 0) {
|
598
599
|
json_iterator = grpc_json_add_number_string_child(
|
599
600
|
json, json_iterator, "keepAlivesSent", keepalives_sent);
|
@@ -605,8 +606,7 @@ grpc_json* SocketNode::RenderJson() {
|
|
605
606
|
// ListenSocketNode
|
606
607
|
//
|
607
608
|
|
608
|
-
ListenSocketNode::ListenSocketNode(
|
609
|
-
UniquePtr<char> name)
|
609
|
+
ListenSocketNode::ListenSocketNode(std::string local_addr, std::string name)
|
610
610
|
: BaseNode(EntityType::kSocket, std::move(name)),
|
611
611
|
local_addr_(std::move(local_addr)) {}
|
612
612
|
|
@@ -622,10 +622,10 @@ grpc_json* ListenSocketNode::RenderJson() {
|
|
622
622
|
json_iterator = nullptr;
|
623
623
|
json_iterator = grpc_json_add_number_string_child(json, json_iterator,
|
624
624
|
"socketId", uuid());
|
625
|
-
json_iterator = grpc_json_create_child(
|
626
|
-
|
625
|
+
json_iterator = grpc_json_create_child(
|
626
|
+
json_iterator, json, "name", name().c_str(), GRPC_JSON_STRING, false);
|
627
627
|
json = top_level_json;
|
628
|
-
PopulateSocketAddressJson(json, "local", local_addr_.
|
628
|
+
PopulateSocketAddressJson(json, "local", local_addr_.c_str());
|
629
629
|
|
630
630
|
return top_level_json;
|
631
631
|
}
|
@@ -23,8 +23,11 @@
|
|
23
23
|
|
24
24
|
#include <grpc/grpc.h>
|
25
25
|
|
26
|
+
#include <string>
|
27
|
+
|
26
28
|
#include "src/core/lib/channel/channel_trace.h"
|
27
29
|
#include "src/core/lib/gpr/time_precise.h"
|
30
|
+
#include "src/core/lib/gprpp/atomic.h"
|
28
31
|
#include "src/core/lib/gprpp/inlined_vector.h"
|
29
32
|
#include "src/core/lib/gprpp/manual_constructor.h"
|
30
33
|
#include "src/core/lib/gprpp/map.h"
|
@@ -82,7 +85,7 @@ class BaseNode : public RefCounted<BaseNode> {
|
|
82
85
|
};
|
83
86
|
|
84
87
|
protected:
|
85
|
-
BaseNode(EntityType type,
|
88
|
+
BaseNode(EntityType type, std::string name);
|
86
89
|
|
87
90
|
public:
|
88
91
|
virtual ~BaseNode();
|
@@ -96,14 +99,14 @@ class BaseNode : public RefCounted<BaseNode> {
|
|
96
99
|
|
97
100
|
EntityType type() const { return type_; }
|
98
101
|
intptr_t uuid() const { return uuid_; }
|
99
|
-
const
|
102
|
+
const std::string& name() const { return name_; }
|
100
103
|
|
101
104
|
private:
|
102
105
|
// to allow the ChannelzRegistry to set uuid_ under its lock.
|
103
106
|
friend class ChannelzRegistry;
|
104
107
|
const EntityType type_;
|
105
108
|
intptr_t uuid_;
|
106
|
-
|
109
|
+
std::string name_;
|
107
110
|
};
|
108
111
|
|
109
112
|
// This class is a helper class for channelz entities that deal with Channels,
|
@@ -138,9 +141,9 @@ class CallCountingHelper {
|
|
138
141
|
last_call_started_cycle(
|
139
142
|
that.last_call_started_cycle.Load(MemoryOrder::RELAXED)) {}
|
140
143
|
|
141
|
-
Atomic<
|
142
|
-
Atomic<
|
143
|
-
Atomic<
|
144
|
+
Atomic<int64_t> calls_started{0};
|
145
|
+
Atomic<int64_t> calls_succeeded{0};
|
146
|
+
Atomic<int64_t> calls_failed{0};
|
144
147
|
Atomic<gpr_cycle_counter> last_call_started_cycle{0};
|
145
148
|
// Make sure the size is exactly one cache line.
|
146
149
|
uint8_t padding[GPR_CACHELINE_SIZE - 3 * sizeof(Atomic<intptr_t>) -
|
@@ -148,9 +151,9 @@ class CallCountingHelper {
|
|
148
151
|
} GPR_ALIGN_STRUCT(GPR_CACHELINE_SIZE);
|
149
152
|
|
150
153
|
struct CounterData {
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
+
int64_t calls_started = 0;
|
155
|
+
int64_t calls_succeeded = 0;
|
156
|
+
int64_t calls_failed = 0;
|
154
157
|
gpr_cycle_counter last_call_started_cycle = 0;
|
155
158
|
};
|
156
159
|
|
@@ -165,7 +168,7 @@ class CallCountingHelper {
|
|
165
168
|
// Handles channelz bookkeeping for channels
|
166
169
|
class ChannelNode : public BaseNode {
|
167
170
|
public:
|
168
|
-
ChannelNode(
|
171
|
+
ChannelNode(std::string target, size_t channel_tracer_max_nodes,
|
169
172
|
intptr_t parent_uuid);
|
170
173
|
|
171
174
|
// Returns the string description of the given connectivity state.
|
@@ -208,7 +211,7 @@ class ChannelNode : public BaseNode {
|
|
208
211
|
// to allow the channel trace test to access trace_.
|
209
212
|
friend class testing::ChannelNodePeer;
|
210
213
|
|
211
|
-
|
214
|
+
std::string target_;
|
212
215
|
CallCountingHelper call_counter_;
|
213
216
|
ChannelTrace trace_;
|
214
217
|
const intptr_t parent_uuid_;
|
@@ -221,8 +224,8 @@ class ChannelNode : public BaseNode {
|
|
221
224
|
// TODO(roth): We don't actually use the values here, only the keys, so
|
222
225
|
// these should be sets instead of maps, but we don't currently have a set
|
223
226
|
// implementation. Change this if/when we have one.
|
224
|
-
|
225
|
-
|
227
|
+
std::map<intptr_t, bool> child_channels_;
|
228
|
+
std::map<intptr_t, bool> child_subchannels_;
|
226
229
|
};
|
227
230
|
|
228
231
|
// Handles channelz bookkeeping for servers
|
@@ -262,15 +265,14 @@ class ServerNode : public BaseNode {
|
|
262
265
|
CallCountingHelper call_counter_;
|
263
266
|
ChannelTrace trace_;
|
264
267
|
Mutex child_mu_; // Guards child maps below.
|
265
|
-
|
266
|
-
|
268
|
+
std::map<intptr_t, RefCountedPtr<SocketNode>> child_sockets_;
|
269
|
+
std::map<intptr_t, RefCountedPtr<ListenSocketNode>> child_listen_sockets_;
|
267
270
|
};
|
268
271
|
|
269
272
|
// Handles channelz bookkeeping for sockets
|
270
273
|
class SocketNode : public BaseNode {
|
271
274
|
public:
|
272
|
-
SocketNode(
|
273
|
-
UniquePtr<char> name);
|
275
|
+
SocketNode(std::string local, std::string remote, std::string name);
|
274
276
|
~SocketNode() override {}
|
275
277
|
|
276
278
|
grpc_json* RenderJson() override;
|
@@ -278,44 +280,44 @@ class SocketNode : public BaseNode {
|
|
278
280
|
void RecordStreamStartedFromLocal();
|
279
281
|
void RecordStreamStartedFromRemote();
|
280
282
|
void RecordStreamSucceeded() {
|
281
|
-
|
283
|
+
streams_succeeded_.FetchAdd(1, MemoryOrder::RELAXED);
|
282
284
|
}
|
283
285
|
void RecordStreamFailed() {
|
284
|
-
|
286
|
+
streams_failed_.FetchAdd(1, MemoryOrder::RELAXED);
|
285
287
|
}
|
286
288
|
void RecordMessagesSent(uint32_t num_sent);
|
287
289
|
void RecordMessageReceived();
|
288
290
|
void RecordKeepaliveSent() {
|
289
|
-
|
291
|
+
keepalives_sent_.FetchAdd(1, MemoryOrder::RELAXED);
|
290
292
|
}
|
291
293
|
|
292
|
-
const
|
294
|
+
const std::string& remote() { return remote_; }
|
293
295
|
|
294
296
|
private:
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
297
|
+
Atomic<int64_t> streams_started_{0};
|
298
|
+
Atomic<int64_t> streams_succeeded_{0};
|
299
|
+
Atomic<int64_t> streams_failed_{0};
|
300
|
+
Atomic<int64_t> messages_sent_{0};
|
301
|
+
Atomic<int64_t> messages_received_{0};
|
302
|
+
Atomic<int64_t> keepalives_sent_{0};
|
303
|
+
Atomic<gpr_cycle_counter> last_local_stream_created_cycle_{0};
|
304
|
+
Atomic<gpr_cycle_counter> last_remote_stream_created_cycle_{0};
|
305
|
+
Atomic<gpr_cycle_counter> last_message_sent_cycle_{0};
|
306
|
+
Atomic<gpr_cycle_counter> last_message_received_cycle_{0};
|
307
|
+
std::string local_;
|
308
|
+
std::string remote_;
|
307
309
|
};
|
308
310
|
|
309
311
|
// Handles channelz bookkeeping for listen sockets
|
310
312
|
class ListenSocketNode : public BaseNode {
|
311
313
|
public:
|
312
|
-
ListenSocketNode(
|
314
|
+
ListenSocketNode(std::string local_addr, std::string name);
|
313
315
|
~ListenSocketNode() override {}
|
314
316
|
|
315
317
|
grpc_json* RenderJson() override;
|
316
318
|
|
317
319
|
private:
|
318
|
-
|
320
|
+
std::string local_addr_;
|
319
321
|
};
|
320
322
|
|
321
323
|
} // namespace channelz
|
@@ -43,9 +43,9 @@ const int kPaginationLimit = 100;
|
|
43
43
|
|
44
44
|
} // anonymous namespace
|
45
45
|
|
46
|
-
void ChannelzRegistry::Init() { g_channelz_registry =
|
46
|
+
void ChannelzRegistry::Init() { g_channelz_registry = new ChannelzRegistry(); }
|
47
47
|
|
48
|
-
void ChannelzRegistry::Shutdown() {
|
48
|
+
void ChannelzRegistry::Shutdown() { delete g_channelz_registry; }
|
49
49
|
|
50
50
|
ChannelzRegistry* ChannelzRegistry::Default() {
|
51
51
|
GPR_DEBUG_ASSERT(g_channelz_registry != nullptr);
|
@@ -167,7 +167,7 @@ static void set_pollset_or_pollset_set(grpc_call_element* elem,
|
|
167
167
|
|
168
168
|
/* Destructor for call_data */
|
169
169
|
static void connected_channel_destroy_call_elem(
|
170
|
-
grpc_call_element* elem, const grpc_call_final_info* final_info
|
170
|
+
grpc_call_element* elem, const grpc_call_final_info* /*final_info*/,
|
171
171
|
grpc_closure* then_schedule_closure) {
|
172
172
|
call_data* calld = static_cast<call_data*>(elem->call_data);
|
173
173
|
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
|
@@ -195,7 +195,8 @@ static void connected_channel_destroy_channel_elem(grpc_channel_element* elem) {
|
|
195
195
|
|
196
196
|
/* No-op. */
|
197
197
|
static void connected_channel_get_channel_info(
|
198
|
-
grpc_channel_element* elem
|
198
|
+
grpc_channel_element* /*elem*/, const grpc_channel_info* /*channel_info*/) {
|
199
|
+
}
|
199
200
|
|
200
201
|
const grpc_channel_filter grpc_connected_filter = {
|
201
202
|
connected_channel_start_transport_stream_op_batch,
|