Skip to content

Commit f85fd02

Browse files
committed
Client-side health checking support.
1 parent 55906e4 commit f85fd02

38 files changed

+1791
-508
lines changed

.clang_complete

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
-Ithird_party/cares
1515
-Ithird_party/googletest/googletest/include
1616
-Ithird_party/googletest/googlemock/include
17+
-Ithird_party/nanopb
1718

BUILD

+19-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ GRPCXX_SRCS = [
131131
"src/cpp/server/create_default_thread_pool.cc",
132132
"src/cpp/server/dynamic_thread_pool.cc",
133133
"src/cpp/server/health/default_health_check_service.cc",
134-
"src/cpp/server/health/health.pb.c",
135134
"src/cpp/server/health/health_check_service.cc",
136135
"src/cpp/server/health/health_check_service_server_builder_option.cc",
137136
"src/cpp/server/server_builder.cc",
@@ -151,7 +150,6 @@ GRPCXX_HDRS = [
151150
"src/cpp/common/channel_filter.h",
152151
"src/cpp/server/dynamic_thread_pool.h",
153152
"src/cpp/server/health/default_health_check_service.h",
154-
"src/cpp/server/health/health.pb.h",
155153
"src/cpp/server/thread_pool_interface.h",
156154
"src/cpp/thread_manager/thread_manager.h",
157155
]
@@ -1040,6 +1038,7 @@ grpc_cc_library(
10401038
"src/core/ext/filters/client_channel/client_channel_factory.cc",
10411039
"src/core/ext/filters/client_channel/client_channel_plugin.cc",
10421040
"src/core/ext/filters/client_channel/connector.cc",
1041+
"src/core/ext/filters/client_channel/health/health_check_client.cc",
10431042
"src/core/ext/filters/client_channel/http_connect_handshaker.cc",
10441043
"src/core/ext/filters/client_channel/http_proxy.cc",
10451044
"src/core/ext/filters/client_channel/lb_policy.cc",
@@ -1062,6 +1061,7 @@ grpc_cc_library(
10621061
"src/core/ext/filters/client_channel/client_channel_channelz.h",
10631062
"src/core/ext/filters/client_channel/client_channel_factory.h",
10641063
"src/core/ext/filters/client_channel/connector.h",
1064+
"src/core/ext/filters/client_channel/health/health_check_client.h",
10651065
"src/core/ext/filters/client_channel/http_connect_handshaker.h",
10661066
"src/core/ext/filters/client_channel/http_proxy.h",
10671067
"src/core/ext/filters/client_channel/lb_policy.h",
@@ -1089,6 +1089,7 @@ grpc_cc_library(
10891089
"orphanable",
10901090
"ref_counted",
10911091
"ref_counted_ptr",
1092+
"health_proto",
10921093
],
10931094
)
10941095

@@ -1200,6 +1201,20 @@ grpc_cc_library(
12001201
],
12011202
)
12021203

1204+
grpc_cc_library(
1205+
name = "health_proto",
1206+
srcs = [
1207+
"src/core/ext/filters/client_channel/health/health.pb.c",
1208+
],
1209+
hdrs = [
1210+
"src/core/ext/filters/client_channel/health/health.pb.h",
1211+
],
1212+
external_deps = [
1213+
"nanopb",
1214+
],
1215+
language = "c++",
1216+
)
1217+
12031218
grpc_cc_library(
12041219
name = "grpclb_proto",
12051220
srcs = [
@@ -1987,6 +2002,7 @@ grpc_cc_library(
19872002
deps = [
19882003
"grpc",
19892004
"grpc++_codegen_base",
2005+
"health_proto",
19902006
],
19912007
)
19922008

@@ -1999,6 +2015,7 @@ grpc_cc_library(
19992015
deps = [
20002016
"grpc++_codegen_base",
20012017
"grpc_unsecure",
2018+
"health_proto",
20022019
],
20032020
)
20042021

CMakeLists.txt

+35-9
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,7 @@ add_library(grpc
12291229
src/core/ext/filters/client_channel/client_channel_factory.cc
12301230
src/core/ext/filters/client_channel/client_channel_plugin.cc
12311231
src/core/ext/filters/client_channel/connector.cc
1232+
src/core/ext/filters/client_channel/health/health_check_client.cc
12321233
src/core/ext/filters/client_channel/http_connect_handshaker.cc
12331234
src/core/ext/filters/client_channel/http_proxy.cc
12341235
src/core/ext/filters/client_channel/lb_policy.cc
@@ -1245,6 +1246,7 @@ add_library(grpc
12451246
src/core/ext/filters/client_channel/subchannel_index.cc
12461247
src/core/ext/filters/client_channel/uri_parser.cc
12471248
src/core/ext/filters/deadline/deadline_filter.cc
1249+
src/core/ext/filters/client_channel/health/health.pb.c
12481250
src/core/tsi/alts_transport_security.cc
12491251
src/core/tsi/fake_transport_security.cc
12501252
src/core/tsi/local_transport_security.cc
@@ -1579,6 +1581,7 @@ add_library(grpc_cronet
15791581
src/core/ext/filters/client_channel/client_channel_factory.cc
15801582
src/core/ext/filters/client_channel/client_channel_plugin.cc
15811583
src/core/ext/filters/client_channel/connector.cc
1584+
src/core/ext/filters/client_channel/health/health_check_client.cc
15821585
src/core/ext/filters/client_channel/http_connect_handshaker.cc
15831586
src/core/ext/filters/client_channel/http_proxy.cc
15841587
src/core/ext/filters/client_channel/lb_policy.cc
@@ -1595,6 +1598,10 @@ add_library(grpc_cronet
15951598
src/core/ext/filters/client_channel/subchannel_index.cc
15961599
src/core/ext/filters/client_channel/uri_parser.cc
15971600
src/core/ext/filters/deadline/deadline_filter.cc
1601+
src/core/ext/filters/client_channel/health/health.pb.c
1602+
third_party/nanopb/pb_common.c
1603+
third_party/nanopb/pb_decode.c
1604+
third_party/nanopb/pb_encode.c
15981605
src/core/lib/http/httpcli_security_connector.cc
15991606
src/core/lib/security/context/security_context.cc
16001607
src/core/lib/security/credentials/alts/alts_credentials.cc
@@ -1656,9 +1663,6 @@ add_library(grpc_cronet
16561663
src/core/tsi/alts/handshaker/altscontext.pb.c
16571664
src/core/tsi/alts/handshaker/handshaker.pb.c
16581665
src/core/tsi/alts/handshaker/transport_security_common.pb.c
1659-
third_party/nanopb/pb_common.c
1660-
third_party/nanopb/pb_decode.c
1661-
third_party/nanopb/pb_encode.c
16621666
src/core/tsi/transport_security.cc
16631667
src/core/ext/transport/chttp2/client/insecure/channel_create.cc
16641668
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
@@ -1946,6 +1950,7 @@ add_library(grpc_test_util
19461950
src/core/ext/filters/client_channel/client_channel_factory.cc
19471951
src/core/ext/filters/client_channel/client_channel_plugin.cc
19481952
src/core/ext/filters/client_channel/connector.cc
1953+
src/core/ext/filters/client_channel/health/health_check_client.cc
19491954
src/core/ext/filters/client_channel/http_connect_handshaker.cc
19501955
src/core/ext/filters/client_channel/http_proxy.cc
19511956
src/core/ext/filters/client_channel/lb_policy.cc
@@ -1962,6 +1967,10 @@ add_library(grpc_test_util
19621967
src/core/ext/filters/client_channel/subchannel_index.cc
19631968
src/core/ext/filters/client_channel/uri_parser.cc
19641969
src/core/ext/filters/deadline/deadline_filter.cc
1970+
src/core/ext/filters/client_channel/health/health.pb.c
1971+
third_party/nanopb/pb_common.c
1972+
third_party/nanopb/pb_decode.c
1973+
third_party/nanopb/pb_encode.c
19651974
src/core/ext/transport/chttp2/transport/bin_decoder.cc
19661975
src/core/ext/transport/chttp2/transport/bin_encoder.cc
19671976
src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
@@ -2260,6 +2269,7 @@ add_library(grpc_test_util_unsecure
22602269
src/core/ext/filters/client_channel/client_channel_factory.cc
22612270
src/core/ext/filters/client_channel/client_channel_plugin.cc
22622271
src/core/ext/filters/client_channel/connector.cc
2272+
src/core/ext/filters/client_channel/health/health_check_client.cc
22632273
src/core/ext/filters/client_channel/http_connect_handshaker.cc
22642274
src/core/ext/filters/client_channel/http_proxy.cc
22652275
src/core/ext/filters/client_channel/lb_policy.cc
@@ -2276,6 +2286,10 @@ add_library(grpc_test_util_unsecure
22762286
src/core/ext/filters/client_channel/subchannel_index.cc
22772287
src/core/ext/filters/client_channel/uri_parser.cc
22782288
src/core/ext/filters/deadline/deadline_filter.cc
2289+
src/core/ext/filters/client_channel/health/health.pb.c
2290+
third_party/nanopb/pb_common.c
2291+
third_party/nanopb/pb_decode.c
2292+
third_party/nanopb/pb_encode.c
22792293
src/core/ext/transport/chttp2/transport/bin_decoder.cc
22802294
src/core/ext/transport/chttp2/transport/bin_encoder.cc
22812295
src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
@@ -2587,6 +2601,7 @@ add_library(grpc_unsecure
25872601
src/core/ext/filters/client_channel/client_channel_factory.cc
25882602
src/core/ext/filters/client_channel/client_channel_plugin.cc
25892603
src/core/ext/filters/client_channel/connector.cc
2604+
src/core/ext/filters/client_channel/health/health_check_client.cc
25902605
src/core/ext/filters/client_channel/http_connect_handshaker.cc
25912606
src/core/ext/filters/client_channel/http_proxy.cc
25922607
src/core/ext/filters/client_channel/lb_policy.cc
@@ -2603,6 +2618,10 @@ add_library(grpc_unsecure
26032618
src/core/ext/filters/client_channel/subchannel_index.cc
26042619
src/core/ext/filters/client_channel/uri_parser.cc
26052620
src/core/ext/filters/deadline/deadline_filter.cc
2621+
src/core/ext/filters/client_channel/health/health.pb.c
2622+
third_party/nanopb/pb_common.c
2623+
third_party/nanopb/pb_decode.c
2624+
third_party/nanopb/pb_encode.c
26062625
src/core/ext/transport/inproc/inproc_plugin.cc
26072626
src/core/ext/transport/inproc/inproc_transport.cc
26082627
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
@@ -2621,9 +2640,6 @@ add_library(grpc_unsecure
26212640
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
26222641
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
26232642
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
2624-
third_party/nanopb/pb_common.c
2625-
third_party/nanopb/pb_decode.c
2626-
third_party/nanopb/pb_encode.c
26272643
src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c
26282644
src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c
26292645
src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c
@@ -2857,7 +2873,6 @@ add_library(grpc++
28572873
src/cpp/server/create_default_thread_pool.cc
28582874
src/cpp/server/dynamic_thread_pool.cc
28592875
src/cpp/server/health/default_health_check_service.cc
2860-
src/cpp/server/health/health.pb.c
28612876
src/cpp/server/health/health_check_service.cc
28622877
src/cpp/server/health/health_check_service_server_builder_option.cc
28632878
src/cpp/server/server_builder.cc
@@ -2870,6 +2885,10 @@ add_library(grpc++
28702885
src/cpp/util/status.cc
28712886
src/cpp/util/string_ref.cc
28722887
src/cpp/util/time_cc.cc
2888+
src/core/ext/filters/client_channel/health/health.pb.c
2889+
third_party/nanopb/pb_common.c
2890+
third_party/nanopb/pb_decode.c
2891+
third_party/nanopb/pb_encode.c
28732892
src/cpp/codegen/codegen_init.cc
28742893
)
28752894

@@ -3218,7 +3237,6 @@ add_library(grpc++_cronet
32183237
src/cpp/server/create_default_thread_pool.cc
32193238
src/cpp/server/dynamic_thread_pool.cc
32203239
src/cpp/server/health/default_health_check_service.cc
3221-
src/cpp/server/health/health.pb.c
32223240
src/cpp/server/health/health_check_service.cc
32233241
src/cpp/server/health/health_check_service_server_builder_option.cc
32243242
src/cpp/server/server_builder.cc
@@ -3231,6 +3249,10 @@ add_library(grpc++_cronet
32313249
src/cpp/util/status.cc
32323250
src/cpp/util/string_ref.cc
32333251
src/cpp/util/time_cc.cc
3252+
src/core/ext/filters/client_channel/health/health.pb.c
3253+
third_party/nanopb/pb_common.c
3254+
third_party/nanopb/pb_decode.c
3255+
third_party/nanopb/pb_encode.c
32343256
src/cpp/codegen/codegen_init.cc
32353257
src/core/ext/transport/chttp2/client/insecure/channel_create.cc
32363258
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
@@ -3421,6 +3443,7 @@ add_library(grpc++_cronet
34213443
src/core/ext/filters/client_channel/client_channel_factory.cc
34223444
src/core/ext/filters/client_channel/client_channel_plugin.cc
34233445
src/core/ext/filters/client_channel/connector.cc
3446+
src/core/ext/filters/client_channel/health/health_check_client.cc
34243447
src/core/ext/filters/client_channel/http_connect_handshaker.cc
34253448
src/core/ext/filters/client_channel/http_proxy.cc
34263449
src/core/ext/filters/client_channel/lb_policy.cc
@@ -4341,7 +4364,6 @@ add_library(grpc++_unsecure
43414364
src/cpp/server/create_default_thread_pool.cc
43424365
src/cpp/server/dynamic_thread_pool.cc
43434366
src/cpp/server/health/default_health_check_service.cc
4344-
src/cpp/server/health/health.pb.c
43454367
src/cpp/server/health/health_check_service.cc
43464368
src/cpp/server/health/health_check_service_server_builder_option.cc
43474369
src/cpp/server/server_builder.cc
@@ -4354,6 +4376,10 @@ add_library(grpc++_unsecure
43544376
src/cpp/util/status.cc
43554377
src/cpp/util/string_ref.cc
43564378
src/cpp/util/time_cc.cc
4379+
src/core/ext/filters/client_channel/health/health.pb.c
4380+
third_party/nanopb/pb_common.c
4381+
third_party/nanopb/pb_decode.c
4382+
third_party/nanopb/pb_encode.c
43574383
src/cpp/codegen/codegen_init.cc
43584384
)
43594385

0 commit comments

Comments
 (0)