Merge branch 'pid++' into flow++

pull/12915/head
Craig Tiller 7 years ago
commit 31c258a549
  1. 69
      CMakeLists.txt
  2. 84
      Makefile
  3. 113
      build.yaml
  4. 6
      include/grpc++/impl/codegen/call.h
  5. 20
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  6. 15
      src/core/lib/http/httpcli_security_connector.cc
  7. 6
      src/core/lib/iomgr/call_combiner.cc
  8. 5
      src/core/lib/security/credentials/fake/fake_credentials.cc
  9. 6
      src/core/lib/security/credentials/ssl/ssl_credentials.cc
  10. 126
      src/core/lib/security/transport/security_connector.cc
  11. 34
      src/core/lib/security/transport/security_connector.h
  12. 2
      src/core/lib/transport/bdp_estimator.h
  13. 5
      src/cpp/server/server_cc.cc
  14. 2
      src/objective-c/tests/GRPCClientTests.m
  15. 1
      test/core/end2end/tests/shutdown_finishes_calls.c
  16. 8
      test/core/transport/bdp_estimator_test.cc
  17. 8
      test/cpp/end2end/end2end_test.cc
  18. 8
      test/cpp/qps/gen_build_yaml.py
  19. 34
      tools/run_tests/generated/sources_and_headers.json
  20. 559
      tools/run_tests/generated/tests.json
  21. 33
      tools/run_tests/performance/scenario_config.py
  22. 2
      tools/run_tests/python_utils/jobset.py
  23. 4
      tools/run_tests/run_interop_tests.py
  24. 24
      tools/run_tests/run_tests.py

@ -542,6 +542,7 @@ add_dependencies(buildtests_c timeout_encoding_test)
add_dependencies(buildtests_c timer_heap_test)
add_dependencies(buildtests_c timer_list_test)
add_dependencies(buildtests_c transport_connectivity_state_test)
add_dependencies(buildtests_c transport_metadata_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_c transport_security_test)
endif()
@ -756,7 +757,6 @@ endif()
add_dependencies(buildtests_cxx stress_test)
add_dependencies(buildtests_cxx thread_manager_test)
add_dependencies(buildtests_cxx thread_stress_test)
add_dependencies(buildtests_cxx transport_metadata_test)
add_dependencies(buildtests_cxx transport_pid_controller_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx writes_per_rpc_test)
@ -8946,6 +8946,35 @@ target_link_libraries(transport_connectivity_state_test
gpr
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(transport_metadata_test
test/core/transport/metadata_test.c
)
target_include_directories(transport_metadata_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${BORINGSSL_ROOT_DIR}/include
PRIVATE ${PROTOBUF_ROOT_DIR}/src
PRIVATE ${BENCHMARK_ROOT_DIR}/include
PRIVATE ${ZLIB_ROOT_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
PRIVATE ${CARES_INCLUDE_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
)
target_link_libraries(transport_metadata_test
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr_test_util
gpr
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
@ -12651,44 +12680,6 @@ target_link_libraries(thread_stress_test
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(transport_metadata_test
test/core/transport/metadata_test.c
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
target_include_directories(transport_metadata_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${BORINGSSL_ROOT_DIR}/include
PRIVATE ${PROTOBUF_ROOT_DIR}/src
PRIVATE ${BENCHMARK_ROOT_DIR}/include
PRIVATE ${ZLIB_ROOT_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
PRIVATE ${CARES_INCLUDE_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
PRIVATE third_party/googletest/googlemock
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(transport_metadata_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr_test_util
gpr
${_gRPC_GFLAGS_LIBRARIES}
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(transport_pid_controller_test
test/core/transport/pid_controller_test.cc
third_party/googletest/googletest/src/gtest-all.cc

@ -1090,6 +1090,7 @@ timeout_encoding_test: $(BINDIR)/$(CONFIG)/timeout_encoding_test
timer_heap_test: $(BINDIR)/$(CONFIG)/timer_heap_test
timer_list_test: $(BINDIR)/$(CONFIG)/timer_list_test
transport_connectivity_state_test: $(BINDIR)/$(CONFIG)/transport_connectivity_state_test
transport_metadata_test: $(BINDIR)/$(CONFIG)/transport_metadata_test
transport_security_test: $(BINDIR)/$(CONFIG)/transport_security_test
udp_server_test: $(BINDIR)/$(CONFIG)/udp_server_test
uri_fuzzer_test: $(BINDIR)/$(CONFIG)/uri_fuzzer_test
@ -1178,7 +1179,6 @@ streaming_throughput_test: $(BINDIR)/$(CONFIG)/streaming_throughput_test
stress_test: $(BINDIR)/$(CONFIG)/stress_test
thread_manager_test: $(BINDIR)/$(CONFIG)/thread_manager_test
thread_stress_test: $(BINDIR)/$(CONFIG)/thread_stress_test
transport_metadata_test: $(BINDIR)/$(CONFIG)/transport_metadata_test
transport_pid_controller_test: $(BINDIR)/$(CONFIG)/transport_pid_controller_test
writes_per_rpc_test: $(BINDIR)/$(CONFIG)/writes_per_rpc_test
public_headers_must_be_c89: $(BINDIR)/$(CONFIG)/public_headers_must_be_c89
@ -1471,6 +1471,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/timer_heap_test \
$(BINDIR)/$(CONFIG)/timer_list_test \
$(BINDIR)/$(CONFIG)/transport_connectivity_state_test \
$(BINDIR)/$(CONFIG)/transport_metadata_test \
$(BINDIR)/$(CONFIG)/transport_security_test \
$(BINDIR)/$(CONFIG)/udp_server_test \
$(BINDIR)/$(CONFIG)/uri_parser_test \
@ -1615,7 +1616,6 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/stress_test \
$(BINDIR)/$(CONFIG)/thread_manager_test \
$(BINDIR)/$(CONFIG)/thread_stress_test \
$(BINDIR)/$(CONFIG)/transport_metadata_test \
$(BINDIR)/$(CONFIG)/transport_pid_controller_test \
$(BINDIR)/$(CONFIG)/writes_per_rpc_test \
$(BINDIR)/$(CONFIG)/boringssl_aes_test \
@ -1739,7 +1739,6 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/stress_test \
$(BINDIR)/$(CONFIG)/thread_manager_test \
$(BINDIR)/$(CONFIG)/thread_stress_test \
$(BINDIR)/$(CONFIG)/transport_metadata_test \
$(BINDIR)/$(CONFIG)/transport_pid_controller_test \
$(BINDIR)/$(CONFIG)/writes_per_rpc_test \
$(BINDIR)/$(CONFIG)/resolver_component_test_unsecure \
@ -1991,6 +1990,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/timer_list_test || ( echo test timer_list_test failed ; exit 1 )
$(E) "[RUN] Testing transport_connectivity_state_test"
$(Q) $(BINDIR)/$(CONFIG)/transport_connectivity_state_test || ( echo test transport_connectivity_state_test failed ; exit 1 )
$(E) "[RUN] Testing transport_metadata_test"
$(Q) $(BINDIR)/$(CONFIG)/transport_metadata_test || ( echo test transport_metadata_test failed ; exit 1 )
$(E) "[RUN] Testing transport_security_test"
$(Q) $(BINDIR)/$(CONFIG)/transport_security_test || ( echo test transport_security_test failed ; exit 1 )
$(E) "[RUN] Testing udp_server_test"
@ -2153,8 +2154,6 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/thread_manager_test || ( echo test thread_manager_test failed ; exit 1 )
$(E) "[RUN] Testing thread_stress_test"
$(Q) $(BINDIR)/$(CONFIG)/thread_stress_test || ( echo test thread_stress_test failed ; exit 1 )
$(E) "[RUN] Testing transport_metadata_test"
$(Q) $(BINDIR)/$(CONFIG)/transport_metadata_test || ( echo test transport_metadata_test failed ; exit 1 )
$(E) "[RUN] Testing transport_pid_controller_test"
$(Q) $(BINDIR)/$(CONFIG)/transport_pid_controller_test || ( echo test transport_pid_controller_test failed ; exit 1 )
$(E) "[RUN] Testing writes_per_rpc_test"
@ -13389,6 +13388,38 @@ endif
endif
TRANSPORT_METADATA_TEST_SRC = \
test/core/transport/metadata_test.c \
TRANSPORT_METADATA_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TRANSPORT_METADATA_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/transport_metadata_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/transport_metadata_test: $(TRANSPORT_METADATA_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(TRANSPORT_METADATA_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/transport_metadata_test
endif
$(OBJDIR)/$(CONFIG)/test/core/transport/metadata_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_transport_metadata_test: $(TRANSPORT_METADATA_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(TRANSPORT_METADATA_TEST_OBJS:.o=.dep)
endif
endif
TRANSPORT_SECURITY_TEST_SRC = \
test/core/tsi/transport_security_test.c \
@ -17139,49 +17170,6 @@ endif
endif
TRANSPORT_METADATA_TEST_SRC = \
test/core/transport/metadata_test.c \
TRANSPORT_METADATA_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TRANSPORT_METADATA_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/transport_metadata_test: openssl_dep_error
else
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/transport_metadata_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/transport_metadata_test: $(PROTOBUF_DEP) $(TRANSPORT_METADATA_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(TRANSPORT_METADATA_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/transport_metadata_test
endif
endif
$(OBJDIR)/$(CONFIG)/test/core/transport/metadata_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_transport_metadata_test: $(TRANSPORT_METADATA_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(TRANSPORT_METADATA_TEST_OBJS:.o=.dep)
endif
endif
TRANSPORT_PID_CONTROLLER_TEST_SRC = \
test/core/transport/pid_controller_test.cc \

@ -1737,6 +1737,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: alloc_test
build: test
language: c
@ -1745,6 +1746,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: alpn_test
build: test
language: c
@ -1777,6 +1779,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: backoff_test
build: test
language: c
@ -1787,6 +1790,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: bad_server_response_test
build: test
language: c
@ -1808,6 +1812,7 @@ targets:
deps:
- grpc_test_util
- grpc
uses_polling: false
- name: bin_encoder_test
build: test
language: c
@ -1816,6 +1821,7 @@ targets:
deps:
- grpc_test_util
- grpc
uses_polling: false
- name: byte_stream_test
build: test
language: c
@ -1826,6 +1832,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: census_context_test
build: test
language: c
@ -1836,6 +1843,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: census_intrusive_hash_map_test
build: test
language: c
@ -1846,6 +1854,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: census_resource_test
build: test
language: c
@ -1856,6 +1865,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: census_trace_context_test
build: test
language: c
@ -1866,6 +1876,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: channel_create_test
build: test
language: c
@ -1894,6 +1905,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: chttp2_stream_map_test
build: test
language: c
@ -1904,6 +1916,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: chttp2_varint_test
build: test
language: c
@ -1914,6 +1927,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: client_fuzzer
build: fuzzer
language: c
@ -1949,6 +1963,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: concurrent_connectivity_test
cpu_cost: 2.0
build: test
@ -2036,6 +2051,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: ev_epollsig_linux_test
cpu_cost: 3
build: test
@ -2168,6 +2184,7 @@ targets:
deps:
- gpr
- grpc
uses_polling: false
- name: gen_legal_metadata_characters
build: tool
language: c
@ -2180,6 +2197,7 @@ targets:
src:
- tools/codegen/core/gen_percent_encoding_tables.c
deps: []
uses_polling: false
- name: goaway_server_test
cpu_cost: 0.1
build: test
@ -2205,6 +2223,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_cmdline_test
build: test
language: c
@ -2213,6 +2232,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_cpu_test
cpu_cost: 30
build: test
@ -2222,6 +2242,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_env_test
build: test
language: c
@ -2230,6 +2251,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_histogram_test
build: test
language: c
@ -2238,6 +2260,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_host_port_test
build: test
language: c
@ -2246,6 +2269,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_log_test
build: test
language: c
@ -2254,6 +2278,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_mpscq_test
cpu_cost: 30
build: test
@ -2273,6 +2298,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_stack_lockfree_test
cpu_cost: 7
build: test
@ -2282,6 +2308,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_string_test
build: test
language: c
@ -2290,6 +2317,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_sync_test
cpu_cost: 10
build: test
@ -2299,6 +2327,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_thd_test
cpu_cost: 10
build: test
@ -2308,6 +2337,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_time_test
build: test
language: c
@ -2316,6 +2346,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_tls_test
build: test
language: c
@ -2324,6 +2355,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_useful_test
build: test
language: c
@ -2332,6 +2364,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: grpc_auth_context_test
build: test
language: c
@ -2342,6 +2375,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: grpc_b64_test
build: test
language: c
@ -2352,6 +2386,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: grpc_byte_buffer_reader_test
build: test
language: c
@ -2362,6 +2397,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: grpc_channel_args_test
build: test
language: c
@ -2372,6 +2408,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: grpc_channel_stack_builder_test
build: test
language: c
@ -2392,6 +2429,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: grpc_completion_queue_test
build: test
language: c
@ -2423,6 +2461,7 @@ targets:
- grpc
- gpr
secure: true
uses_polling: false
- name: grpc_credentials_test
build: test
language: c
@ -2454,6 +2493,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: grpc_json_token_test
build: test
language: c
@ -2468,6 +2508,7 @@ targets:
- linux
- posix
- mac
uses_polling: false
- name: grpc_jwt_verifier_test
build: test
language: c
@ -2478,6 +2519,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: grpc_print_google_default_creds_token
build: tool
language: c
@ -2486,6 +2528,7 @@ targets:
deps:
- grpc
- gpr
uses_polling: false
- name: grpc_security_connector_test
build: test
language: c
@ -2504,6 +2547,7 @@ targets:
deps:
- grpc
- gpr
uses_polling: false
- name: handshake_client
build: test
language: c
@ -2558,6 +2602,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: hpack_table_test
build: test
language: c
@ -2568,6 +2613,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: http_parser_test
build: test
language: c
@ -2578,6 +2624,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: http_request_fuzzer_test
build: fuzzer
language: c
@ -2652,6 +2699,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: invalid_call_argument_test
cpu_cost: 0.1
build: test
@ -2685,6 +2733,7 @@ targets:
deps:
- grpc
- gpr
uses_polling: false
- name: json_rewrite_test
build: test
language: c
@ -2695,6 +2744,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: json_stream_error_test
build: test
language: c
@ -2705,6 +2755,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: json_test
build: test
language: c
@ -2715,6 +2766,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: lame_client_test
build: test
language: c
@ -2737,6 +2789,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: load_file_test
build: test
language: c
@ -2747,6 +2800,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: low_level_ping_pong_benchmark
build: benchmark
language: c
@ -2772,6 +2826,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: memory_profile_server
build: test
run: false
@ -2808,6 +2863,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: minimal_stack_is_minimal_test
build: test
language: c
@ -2818,6 +2874,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: mlog_test
flaky: true
build: test
@ -2829,6 +2886,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: multiple_server_queues_test
build: test
language: c
@ -2847,6 +2905,7 @@ targets:
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: nanopb_fuzzer_response_test
build: fuzzer
language: c
@ -2906,6 +2965,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: percent_decode_fuzzer
build: fuzzer
language: c
@ -2942,6 +3002,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: pollset_set_test
build: test
language: c
@ -3071,6 +3132,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: slice_hash_table_test
build: test
language: c
@ -3081,6 +3143,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: slice_string_helpers_test
build: test
language: c
@ -3091,6 +3154,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: slice_test
build: test
language: c
@ -3101,6 +3165,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: sockaddr_resolver_test
build: test
language: c
@ -3175,6 +3240,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: stream_compression_test
build: test
language: c
@ -3185,6 +3251,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: stream_owned_slice_test
build: test
language: c
@ -3195,6 +3262,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: tcp_client_posix_test
cpu_cost: 0.5
build: test
@ -3280,6 +3348,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: timeout_encoding_test
build: test
language: c
@ -3290,6 +3359,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: timer_heap_test
build: test
language: c
@ -3302,6 +3372,7 @@ targets:
- gpr
exclude_iomgrs:
- uv
uses_polling: false
- name: timer_list_test
build: test
language: c
@ -3314,6 +3385,7 @@ targets:
- gpr
exclude_iomgrs:
- uv
uses_polling: false
- name: transport_connectivity_state_test
build: test
language: c
@ -3324,6 +3396,16 @@ targets:
- grpc
- gpr_test_util
- gpr
- name: transport_metadata_test
build: test
language: c
src:
- test/core/transport/metadata_test.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
- name: transport_security_test
build: test
language: c
@ -3432,6 +3514,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: bdp_estimator_test
build: test
language: c++
@ -3444,6 +3527,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: bm_arena
build: test
language: c++
@ -3465,6 +3549,7 @@ targets:
- mac
- linux
- posix
uses_polling: false
- name: bm_call_create
build: test
language: c++
@ -3486,6 +3571,7 @@ targets:
- mac
- linux
- posix
uses_polling: false
- name: bm_chttp2_hpack
build: test
language: c++
@ -3507,6 +3593,7 @@ targets:
- mac
- linux
- posix
uses_polling: false
- name: bm_chttp2_transport
build: test
language: c++
@ -3612,6 +3699,7 @@ targets:
- mac
- linux
- posix
uses_polling: false
- name: bm_fullstack_streaming_ping_pong
build: test
language: c++
@ -3740,6 +3828,7 @@ targets:
- mac
- linux
- posix
uses_polling: false
- name: bm_pollset
build: test
language: c++
@ -3771,6 +3860,7 @@ targets:
- grpc++
- grpc
- gpr
uses_polling: false
- name: channel_filter_test
gtest: true
build: test
@ -3781,6 +3871,7 @@ targets:
- grpc++
- grpc
- gpr
uses_polling: false
- name: cli_call_test
gtest: true
build: test
@ -3860,6 +3951,7 @@ targets:
- gpr
filegroups:
- grpc++_codegen_base
uses_polling: false
- name: codegen_test_minimal
gtest: true
build: test
@ -3878,6 +3970,7 @@ targets:
filegroups:
- grpc++_codegen_base
- grpc++_codegen_base_src
uses_polling: false
- name: credentials_test
gtest: true
build: test
@ -3900,6 +3993,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: cxx_slice_test
gtest: true
build: test
@ -3912,6 +4006,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: cxx_string_ref_test
gtest: true
build: test
@ -3921,6 +4016,7 @@ targets:
deps:
- grpc++
- grpc
uses_polling: false
- name: cxx_time_test
gtest: true
build: test
@ -3933,6 +4029,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: end2end_test
gtest: true
cpu_cost: 0.5
@ -3996,6 +4093,7 @@ targets:
- gpr
args:
- --generated_file_path=gens/src/proto/grpc/testing/
uses_polling: false
- name: grpc_cli
build: test
run: false
@ -4288,6 +4386,7 @@ targets:
- gpr
uses:
- grpc++_test
uses_polling: false
- name: metrics_client
build: test
run: false
@ -4352,6 +4451,7 @@ targets:
filegroups:
- grpc++_codegen_base
- grpc++_codegen_proto
uses_polling: false
- name: qps_interarrival_test
build: test
run: false
@ -4371,6 +4471,7 @@ targets:
- mac
- linux
- posix
uses_polling: false
- name: qps_json_driver
build: test
run: false
@ -4607,6 +4708,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: status_test
build: test
language: c++
@ -4618,6 +4720,7 @@ targets:
- grpc
- gpr_test_util
- gpr
uses_polling: false
- name: streaming_throughput_test
gtest: true
build: test
@ -4687,16 +4790,6 @@ targets:
- gpr_test_util
- gpr
timeout_seconds: 1200
- name: transport_metadata_test
build: test
language: c++
src:
- test/core/transport/metadata_test.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
- name: transport_pid_controller_test
build: test
language: c++

@ -318,7 +318,11 @@ template <class M>
Status CallOpSendMessage::SendMessage(const M& message, WriteOptions options) {
write_options_ = options;
bool own_buf;
Status result = SerializationTraits<M>::Serialize(
// TODO(vjpai): Remove the void below when possible
// The void in the template parameter below should not be needed
// (since it should be implicit) but is needed due to an observed
// difference in behavior between clang and gcc for certain internal users
Status result = SerializationTraits<M, void>::Serialize(
message, send_buf_.bbuf_ptr(), &own_buf);
if (!own_buf) {
send_buf_.Duplicate();

@ -603,7 +603,7 @@ static void close_transport_locked(grpc_exec_ctx *exec_ctx,
grpc_error *error) {
end_all_the_calls(exec_ctx, t, GRPC_ERROR_REF(error));
cancel_pings(exec_ctx, t, GRPC_ERROR_REF(error));
if (t->closed_with_error == nullptr) {
if (t->closed_with_error == GRPC_ERROR_NONE) {
if (!grpc_error_has_clear_grpc_status(error)) {
error = grpc_error_set_int(error, GRPC_ERROR_INT_GRPC_STATUS,
GRPC_STATUS_UNAVAILABLE);
@ -647,9 +647,8 @@ static void close_transport_locked(grpc_exec_ctx *exec_ctx,
while (grpc_chttp2_list_pop_writable_stream(t, &s)) {
GRPC_CHTTP2_STREAM_UNREF(exec_ctx, s, "chttp2_writing:close");
}
if (t->write_state == GRPC_CHTTP2_WRITE_STATE_IDLE) {
grpc_endpoint_shutdown(exec_ctx, t->ep, GRPC_ERROR_REF(error));
}
GPR_ASSERT(t->write_state == GRPC_CHTTP2_WRITE_STATE_IDLE);
grpc_endpoint_shutdown(exec_ctx, t->ep, GRPC_ERROR_REF(error));
}
GRPC_ERROR_UNREF(error);
}
@ -845,10 +844,6 @@ static void set_write_state(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
t->close_transport_on_writes_finished = NULL;
close_transport_locked(exec_ctx, t, err);
}
if (t->closed_with_error != GRPC_ERROR_NONE) {
grpc_endpoint_shutdown(exec_ctx, t->ep,
GRPC_ERROR_REF(t->closed_with_error));
}
}
}
@ -1701,6 +1696,7 @@ static void cancel_pings(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
/* callback remaining pings: they're not allowed to call into the transpot,
and maybe they hold resources that need to be freed */
grpc_chttp2_ping_queue *pq = &t->ping_queue;
GPR_ASSERT(error != GRPC_ERROR_NONE);
for (size_t j = 0; j < GRPC_CHTTP2_PCL_COUNT; j++) {
grpc_closure_list_fail_all(&pq->lists[j], GRPC_ERROR_REF(error));
GRPC_CLOSURE_LIST_SCHED(exec_ctx, &pq->lists[j]);
@ -1710,6 +1706,12 @@ static void cancel_pings(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
static void send_ping_locked(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
grpc_closure *on_initiate, grpc_closure *on_ack) {
if (t->closed_with_error != GRPC_ERROR_NONE) {
GRPC_CLOSURE_SCHED(exec_ctx, on_initiate,
GRPC_ERROR_REF(t->closed_with_error));
GRPC_CLOSURE_SCHED(exec_ctx, on_ack, GRPC_ERROR_REF(t->closed_with_error));
return;
}
grpc_chttp2_ping_queue *pq = &t->ping_queue;
grpc_closure_list_append(&pq->lists[GRPC_CHTTP2_PCL_INITIATE], on_initiate,
GRPC_ERROR_NONE);
@ -2563,6 +2565,8 @@ static void read_action_locked(grpc_exec_ctx *exec_ctx, void *tp,
GPR_TIMER_END("reading_action_locked", 0);
}
// t is reffed prior to calling the first time, and once the callback chain
// that kicks off finishes, it's unreffed
static void schedule_bdp_ping_locked(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport *t) {
t->flow_control->bdp_estimator()->SchedulePing();

@ -91,8 +91,17 @@ static void httpcli_ssl_check_peer(grpc_exec_ctx *exec_ctx,
tsi_peer_destruct(&peer);
}
static int httpcli_ssl_cmp(grpc_security_connector *sc1,
grpc_security_connector *sc2) {
grpc_httpcli_ssl_channel_security_connector *c1 =
(grpc_httpcli_ssl_channel_security_connector *)sc1;
grpc_httpcli_ssl_channel_security_connector *c2 =
(grpc_httpcli_ssl_channel_security_connector *)sc2;
return strcmp(c1->secure_peer_name, c2->secure_peer_name);
}
static grpc_security_connector_vtable httpcli_ssl_vtable = {
httpcli_ssl_destroy, httpcli_ssl_check_peer};
httpcli_ssl_destroy, httpcli_ssl_check_peer, httpcli_ssl_cmp};
static grpc_security_status httpcli_ssl_channel_security_connector_create(
grpc_exec_ctx *exec_ctx, const char *pem_root_certs,
@ -123,6 +132,10 @@ static grpc_security_status httpcli_ssl_channel_security_connector_create(
*sc = NULL;
return GRPC_SECURITY_ERROR;
}
// We don't actually need a channel credentials object in this case,
// but we set it to a non-NULL address so that we don't trigger
// assertions in grpc_channel_security_connector_cmp().
c->base.channel_creds = (grpc_channel_credentials *)1;
c->base.add_handshakers = httpcli_ssl_add_handshakers;
*sc = &c->base;
return GRPC_SECURITY_OK;

@ -22,6 +22,7 @@
#include <grpc/support/log.h>
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/profiling/timers.h"
grpc_tracer_flag grpc_call_combiner_trace =
GRPC_TRACER_INITIALIZER(false, "call_combiner");
@ -61,6 +62,7 @@ void grpc_call_combiner_start(grpc_exec_ctx* exec_ctx,
grpc_closure* closure,
grpc_error* error DEBUG_ARGS,
const char* reason) {
GPR_TIMER_BEGIN("call_combiner_start", 0);
if (GRPC_TRACER_ON(grpc_call_combiner_trace)) {
gpr_log(GPR_DEBUG,
"==> grpc_call_combiner_start() [%p] closure=%p [" DEBUG_FMT_STR
@ -77,6 +79,7 @@ void grpc_call_combiner_start(grpc_exec_ctx* exec_ctx,
GRPC_STATS_INC_CALL_COMBINER_LOCKS_SCHEDULED_ITEMS(exec_ctx);
if (prev_size == 0) {
GRPC_STATS_INC_CALL_COMBINER_LOCKS_INITIATED(exec_ctx);
GPR_TIMER_MARK("call_combiner_initiate", 0);
if (GRPC_TRACER_ON(grpc_call_combiner_trace)) {
gpr_log(GPR_DEBUG, " EXECUTING IMMEDIATELY");
}
@ -90,11 +93,13 @@ void grpc_call_combiner_start(grpc_exec_ctx* exec_ctx,
closure->error_data.error = error;
gpr_mpscq_push(&call_combiner->queue, (gpr_mpscq_node*)closure);
}
GPR_TIMER_END("call_combiner_start", 0);
}
void grpc_call_combiner_stop(grpc_exec_ctx* exec_ctx,
grpc_call_combiner* call_combiner DEBUG_ARGS,
const char* reason) {
GPR_TIMER_BEGIN("call_combiner_stop", 0);
if (GRPC_TRACER_ON(grpc_call_combiner_trace)) {
gpr_log(GPR_DEBUG,
"==> grpc_call_combiner_stop() [%p] [" DEBUG_FMT_STR "%s]",
@ -133,6 +138,7 @@ void grpc_call_combiner_stop(grpc_exec_ctx* exec_ctx,
} else if (GRPC_TRACER_ON(grpc_call_combiner_trace)) {
gpr_log(GPR_DEBUG, " queue empty");
}
GPR_TIMER_END("call_combiner_stop", 0);
}
void grpc_call_combiner_set_notify_on_cancel(grpc_exec_ctx* exec_ctx,

@ -38,7 +38,8 @@ static grpc_security_status fake_transport_security_create_security_connector(
grpc_call_credentials *call_creds, const char *target,
const grpc_channel_args *args, grpc_channel_security_connector **sc,
grpc_channel_args **new_args) {
*sc = grpc_fake_channel_security_connector_create(call_creds, target, args);
*sc =
grpc_fake_channel_security_connector_create(c, call_creds, target, args);
return GRPC_SECURITY_OK;
}
@ -46,7 +47,7 @@ static grpc_security_status
fake_transport_security_server_create_security_connector(
grpc_exec_ctx *exec_ctx, grpc_server_credentials *c,
grpc_server_security_connector **sc) {
*sc = grpc_fake_server_security_connector_create();
*sc = grpc_fake_server_security_connector_create(c);
return GRPC_SECURITY_OK;
}

@ -62,7 +62,8 @@ static grpc_security_status ssl_create_security_connector(
}
}
status = grpc_ssl_channel_security_connector_create(
exec_ctx, call_creds, &c->config, target, overridden_target_name, sc);
exec_ctx, creds, call_creds, &c->config, target, overridden_target_name,
sc);
if (status != GRPC_SECURITY_OK) {
return status;
}
@ -128,7 +129,8 @@ static grpc_security_status ssl_server_create_security_connector(
grpc_exec_ctx *exec_ctx, grpc_server_credentials *creds,
grpc_server_security_connector **sc) {
grpc_ssl_server_credentials *c = (grpc_ssl_server_credentials *)creds;
return grpc_ssl_server_security_connector_create(exec_ctx, &c->config, sc);
return grpc_ssl_server_security_connector_create(exec_ctx, creds, &c->config,
sc);
}
static grpc_server_credentials_vtable ssl_server_vtable = {

@ -136,6 +136,39 @@ void grpc_security_connector_check_peer(grpc_exec_ctx *exec_ctx,
}
}
int grpc_security_connector_cmp(grpc_security_connector *sc,
grpc_security_connector *other) {
if (sc == NULL || other == NULL) return GPR_ICMP(sc, other);
int c = GPR_ICMP(sc->vtable, other->vtable);
if (c != 0) return c;
return sc->vtable->cmp(sc, other);
}
int grpc_channel_security_connector_cmp(grpc_channel_security_connector *sc1,
grpc_channel_security_connector *sc2) {
GPR_ASSERT(sc1->channel_creds != NULL);
GPR_ASSERT(sc2->channel_creds != NULL);
int c = GPR_ICMP(sc1->channel_creds, sc2->channel_creds);
if (c != 0) return c;
c = GPR_ICMP(sc1->request_metadata_creds, sc2->request_metadata_creds);
if (c != 0) return c;
c = GPR_ICMP((void *)sc1->check_call_host, (void *)sc2->check_call_host);
if (c != 0) return c;
c = GPR_ICMP((void *)sc1->cancel_check_call_host,
(void *)sc2->cancel_check_call_host);
if (c != 0) return c;
return GPR_ICMP((void *)sc1->add_handshakers, (void *)sc2->add_handshakers);
}
int grpc_server_security_connector_cmp(grpc_server_security_connector *sc1,
grpc_server_security_connector *sc2) {
GPR_ASSERT(sc1->server_creds != NULL);
GPR_ASSERT(sc2->server_creds != NULL);
int c = GPR_ICMP(sc1->server_creds, sc2->server_creds);
if (c != 0) return c;
return GPR_ICMP((void *)sc1->add_handshakers, (void *)sc2->add_handshakers);
}
bool grpc_channel_security_connector_check_call_host(
grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *sc,
const char *host, grpc_auth_context *auth_context,
@ -199,25 +232,27 @@ void grpc_security_connector_unref(grpc_exec_ctx *exec_ctx,
if (gpr_unref(&sc->refcount)) sc->vtable->destroy(exec_ctx, sc);
}
static void connector_pointer_arg_destroy(grpc_exec_ctx *exec_ctx, void *p) {
static void connector_arg_destroy(grpc_exec_ctx *exec_ctx, void *p) {
GRPC_SECURITY_CONNECTOR_UNREF(exec_ctx, (grpc_security_connector *)p,
"connector_pointer_arg_destroy");
"connector_arg_destroy");
}
static void *connector_pointer_arg_copy(void *p) {
static void *connector_arg_copy(void *p) {
return GRPC_SECURITY_CONNECTOR_REF((grpc_security_connector *)p,
"connector_pointer_arg_copy");
"connector_arg_copy");
}
static int connector_pointer_cmp(void *a, void *b) { return GPR_ICMP(a, b); }
static int connector_cmp(void *a, void *b) {
return grpc_security_connector_cmp((grpc_security_connector *)a,
(grpc_security_connector *)b);
}
static const grpc_arg_pointer_vtable connector_pointer_vtable = {
connector_pointer_arg_copy, connector_pointer_arg_destroy,
connector_pointer_cmp};
static const grpc_arg_pointer_vtable connector_arg_vtable = {
connector_arg_copy, connector_arg_destroy, connector_cmp};
grpc_arg grpc_security_connector_to_arg(grpc_security_connector *sc) {
return grpc_channel_arg_pointer_create((char *)GRPC_ARG_SECURITY_CONNECTOR,
sc, &connector_pointer_vtable);
sc, &connector_arg_vtable);
}
grpc_security_connector *grpc_security_connector_from_arg(const grpc_arg *arg) {
@ -382,6 +417,32 @@ static void fake_server_check_peer(grpc_exec_ctx *exec_ctx,
fake_check_peer(exec_ctx, sc, peer, auth_context, on_peer_checked);
}
static int fake_channel_cmp(grpc_security_connector *sc1,
grpc_security_connector *sc2) {
grpc_fake_channel_security_connector *c1 =
(grpc_fake_channel_security_connector *)sc1;
grpc_fake_channel_security_connector *c2 =
(grpc_fake_channel_security_connector *)sc2;
int c = grpc_channel_security_connector_cmp(&c1->base, &c2->base);
if (c != 0) return c;
c = strcmp(c1->target, c2->target);
if (c != 0) return c;
if (c1->expected_targets == NULL || c2->expected_targets == NULL) {
c = GPR_ICMP(c1->expected_targets, c2->expected_targets);
} else {
c = strcmp(c1->expected_targets, c2->expected_targets);
}
if (c != 0) return c;
return GPR_ICMP(c1->is_lb_channel, c2->is_lb_channel);
}
static int fake_server_cmp(grpc_security_connector *sc1,
grpc_security_connector *sc2) {
return grpc_server_security_connector_cmp(
(grpc_server_security_connector *)sc1,
(grpc_server_security_connector *)sc2);
}
static bool fake_channel_check_call_host(grpc_exec_ctx *exec_ctx,
grpc_channel_security_connector *sc,
const char *host,
@ -418,12 +479,13 @@ static void fake_server_add_handshakers(grpc_exec_ctx *exec_ctx,
}
static grpc_security_connector_vtable fake_channel_vtable = {
fake_channel_destroy, fake_channel_check_peer};
fake_channel_destroy, fake_channel_check_peer, fake_channel_cmp};
static grpc_security_connector_vtable fake_server_vtable = {
fake_server_destroy, fake_server_check_peer};
fake_server_destroy, fake_server_check_peer, fake_server_cmp};
grpc_channel_security_connector *grpc_fake_channel_security_connector_create(
grpc_channel_credentials *channel_creds,
grpc_call_credentials *request_metadata_creds, const char *target,
const grpc_channel_args *args) {
grpc_fake_channel_security_connector *c =
@ -431,6 +493,7 @@ grpc_channel_security_connector *grpc_fake_channel_security_connector_create(
gpr_ref_init(&c->base.base.refcount, 1);
c->base.base.url_scheme = GRPC_FAKE_SECURITY_URL_SCHEME;
c->base.base.vtable = &fake_channel_vtable;
c->base.channel_creds = channel_creds;
c->base.request_metadata_creds =
grpc_call_credentials_ref(request_metadata_creds);
c->base.check_call_host = fake_channel_check_call_host;
@ -444,13 +507,14 @@ grpc_channel_security_connector *grpc_fake_channel_security_connector_create(
}
grpc_server_security_connector *grpc_fake_server_security_connector_create(
void) {
grpc_server_credentials *server_creds) {
grpc_server_security_connector *c =
(grpc_server_security_connector *)gpr_zalloc(
sizeof(grpc_server_security_connector));
gpr_ref_init(&c->base.refcount, 1);
c->base.vtable = &fake_server_vtable;
c->base.url_scheme = GRPC_FAKE_SECURITY_URL_SCHEME;
c->server_creds = server_creds;
c->add_handshakers = fake_server_add_handshakers;
return c;
}
@ -473,6 +537,7 @@ static void ssl_channel_destroy(grpc_exec_ctx *exec_ctx,
grpc_security_connector *sc) {
grpc_ssl_channel_security_connector *c =
(grpc_ssl_channel_security_connector *)sc;
grpc_channel_credentials_unref(exec_ctx, c->base.channel_creds);
grpc_call_credentials_unref(exec_ctx, c->base.request_metadata_creds);
tsi_ssl_client_handshaker_factory_unref(c->client_handshaker_factory);
c->client_handshaker_factory = NULL;
@ -485,6 +550,7 @@ static void ssl_server_destroy(grpc_exec_ctx *exec_ctx,
grpc_security_connector *sc) {
grpc_ssl_server_security_connector *c =
(grpc_ssl_server_security_connector *)sc;
grpc_server_credentials_unref(exec_ctx, c->base.server_creds);
tsi_ssl_server_handshaker_factory_unref(c->server_handshaker_factory);
c->server_handshaker_factory = NULL;
gpr_free(sc);
@ -641,6 +707,29 @@ static void ssl_server_check_peer(grpc_exec_ctx *exec_ctx,
GRPC_CLOSURE_SCHED(exec_ctx, on_peer_checked, error);
}
static int ssl_channel_cmp(grpc_security_connector *sc1,
grpc_security_connector *sc2) {
grpc_ssl_channel_security_connector *c1 =
(grpc_ssl_channel_security_connector *)sc1;
grpc_ssl_channel_security_connector *c2 =
(grpc_ssl_channel_security_connector *)sc2;
int c = grpc_channel_security_connector_cmp(&c1->base, &c2->base);
if (c != 0) return c;
c = strcmp(c1->target_name, c2->target_name);
if (c != 0) return c;
return (c1->overridden_target_name == NULL ||
c2->overridden_target_name == NULL)
? GPR_ICMP(c1->overridden_target_name, c2->overridden_target_name)
: strcmp(c1->overridden_target_name, c2->overridden_target_name);
}
static int ssl_server_cmp(grpc_security_connector *sc1,
grpc_security_connector *sc2) {
return grpc_server_security_connector_cmp(
(grpc_server_security_connector *)sc1,
(grpc_server_security_connector *)sc2);
}
static void add_shallow_auth_property_to_peer(tsi_peer *peer,
const grpc_auth_property *prop,
const char *tsi_prop_name) {
@ -717,10 +806,10 @@ static void ssl_channel_cancel_check_call_host(
}
static grpc_security_connector_vtable ssl_channel_vtable = {
ssl_channel_destroy, ssl_channel_check_peer};
ssl_channel_destroy, ssl_channel_check_peer, ssl_channel_cmp};
static grpc_security_connector_vtable ssl_server_vtable = {
ssl_server_destroy, ssl_server_check_peer};
ssl_server_destroy, ssl_server_check_peer, ssl_server_cmp};
/* returns a NULL terminated slice. */
static grpc_slice compute_default_pem_root_certs_once(void) {
@ -804,7 +893,8 @@ const char *grpc_get_default_ssl_roots(void) {
}
grpc_security_status grpc_ssl_channel_security_connector_create(
grpc_exec_ctx *exec_ctx, grpc_call_credentials *request_metadata_creds,
grpc_exec_ctx *exec_ctx, grpc_channel_credentials *channel_creds,
grpc_call_credentials *request_metadata_creds,
const grpc_ssl_config *config, const char *target_name,
const char *overridden_target_name, grpc_channel_security_connector **sc) {
size_t num_alpn_protocols = grpc_chttp2_num_alpn_versions();
@ -840,6 +930,7 @@ grpc_security_status grpc_ssl_channel_security_connector_create(
gpr_ref_init(&c->base.base.refcount, 1);
c->base.base.vtable = &ssl_channel_vtable;
c->base.base.url_scheme = GRPC_SSL_URL_SCHEME;
c->base.channel_creds = grpc_channel_credentials_ref(channel_creds);
c->base.request_metadata_creds =
grpc_call_credentials_ref(request_metadata_creds);
c->base.check_call_host = ssl_channel_check_call_host;
@ -874,8 +965,8 @@ error:
}
grpc_security_status grpc_ssl_server_security_connector_create(
grpc_exec_ctx *exec_ctx, const grpc_ssl_server_config *config,
grpc_server_security_connector **sc) {
grpc_exec_ctx *exec_ctx, grpc_server_credentials *server_creds,
const grpc_ssl_server_config *config, grpc_server_security_connector **sc) {
size_t num_alpn_protocols = grpc_chttp2_num_alpn_versions();
const char **alpn_protocol_strings =
(const char **)gpr_malloc(sizeof(const char *) * num_alpn_protocols);
@ -897,6 +988,7 @@ grpc_security_status grpc_ssl_server_security_connector_create(
gpr_ref_init(&c->base.base.refcount, 1);
c->base.base.url_scheme = GRPC_SSL_URL_SCHEME;
c->base.base.vtable = &ssl_server_vtable;
c->base.server_creds = grpc_server_credentials_ref(server_creds);
result = tsi_create_ssl_server_handshaker_factory_ex(
config->pem_key_cert_pairs, config->num_key_cert_pairs,
config->pem_root_certs, get_tsi_client_certificate_request_type(

@ -60,13 +60,9 @@ typedef struct {
void (*check_peer)(grpc_exec_ctx *exec_ctx, grpc_security_connector *sc,
tsi_peer peer, grpc_auth_context **auth_context,
grpc_closure *on_peer_checked);
int (*cmp)(grpc_security_connector *sc, grpc_security_connector *other);
} grpc_security_connector_vtable;
typedef struct grpc_security_connector_handshake_list {
void *handshake;
struct grpc_security_connector_handshake_list *next;
} grpc_security_connector_handshake_list;
struct grpc_security_connector {
const grpc_security_connector_vtable *vtable;
gpr_refcount refcount;
@ -104,6 +100,10 @@ void grpc_security_connector_check_peer(grpc_exec_ctx *exec_ctx,
grpc_auth_context **auth_context,
grpc_closure *on_peer_checked);
/* Compares two security connectors. */
int grpc_security_connector_cmp(grpc_security_connector *sc,
grpc_security_connector *other);
/* Util to encapsulate the connector in a channel arg. */
grpc_arg grpc_security_connector_to_arg(grpc_security_connector *sc);
@ -116,13 +116,14 @@ grpc_security_connector *grpc_security_connector_find_in_args(
/* --- channel_security_connector object. ---
A channel security connector object represents away to configure the
A channel security connector object represents a way to configure the
underlying transport security mechanism on the client side. */
typedef struct grpc_channel_security_connector grpc_channel_security_connector;
struct grpc_channel_security_connector {
grpc_security_connector base;
grpc_channel_credentials *channel_creds;
grpc_call_credentials *request_metadata_creds;
bool (*check_call_host)(grpc_exec_ctx *exec_ctx,
grpc_channel_security_connector *sc, const char *host,
@ -138,6 +139,10 @@ struct grpc_channel_security_connector {
grpc_handshake_manager *handshake_mgr);
};
/// A helper function for use in grpc_security_connector_cmp() implementations.
int grpc_channel_security_connector_cmp(grpc_channel_security_connector *sc1,
grpc_channel_security_connector *sc2);
/// Checks that the host that will be set for a call is acceptable.
/// Returns true if completed synchronously, in which case \a error will
/// be set to indicate the result. Otherwise, \a on_call_host_checked
@ -161,18 +166,23 @@ void grpc_channel_security_connector_add_handshakers(
/* --- server_security_connector object. ---
A server security connector object represents away to configure the
A server security connector object represents a way to configure the
underlying transport security mechanism on the server side. */
typedef struct grpc_server_security_connector grpc_server_security_connector;
struct grpc_server_security_connector {
grpc_security_connector base;
grpc_server_credentials *server_creds;
void (*add_handshakers)(grpc_exec_ctx *exec_ctx,
grpc_server_security_connector *sc,
grpc_handshake_manager *handshake_mgr);
};
/// A helper function for use in grpc_security_connector_cmp() implementations.
int grpc_server_security_connector_cmp(grpc_server_security_connector *sc1,
grpc_server_security_connector *sc2);
void grpc_server_security_connector_add_handshakers(
grpc_exec_ctx *exec_ctx, grpc_server_security_connector *sc,
grpc_handshake_manager *handshake_mgr);
@ -182,13 +192,14 @@ void grpc_server_security_connector_add_handshakers(
/* For TESTING ONLY!
Creates a fake connector that emulates real channel security. */
grpc_channel_security_connector *grpc_fake_channel_security_connector_create(
grpc_channel_credentials *channel_creds,
grpc_call_credentials *request_metadata_creds, const char *target,
const grpc_channel_args *args);
/* For TESTING ONLY!
Creates a fake connector that emulates real server security. */
grpc_server_security_connector *grpc_fake_server_security_connector_create(
void);
grpc_server_credentials *server_creds);
/* Config for ssl clients. */
@ -211,7 +222,8 @@ typedef struct {
specific error code otherwise.
*/
grpc_security_status grpc_ssl_channel_security_connector_create(
grpc_exec_ctx *exec_ctx, grpc_call_credentials *request_metadata_creds,
grpc_exec_ctx *exec_ctx, grpc_channel_credentials *channel_creds,
grpc_call_credentials *request_metadata_creds,
const grpc_ssl_config *config, const char *target_name,
const char *overridden_target_name, grpc_channel_security_connector **sc);
@ -236,8 +248,8 @@ typedef struct {
specific error code otherwise.
*/
grpc_security_status grpc_ssl_server_security_connector_create(
grpc_exec_ctx *exec_ctx, const grpc_ssl_server_config *config,
grpc_server_security_connector **sc);
grpc_exec_ctx *exec_ctx, grpc_server_credentials *server_creds,
const grpc_ssl_server_config *config, grpc_server_security_connector **sc);
/* Util. */
const tsi_peer_property *tsi_peer_get_property_by_name(const tsi_peer *peer,

@ -19,6 +19,8 @@
#ifndef GRPC_CORE_LIB_TRANSPORT_BDP_ESTIMATOR_H
#define GRPC_CORE_LIB_TRANSPORT_BDP_ESTIMATOR_H
#include <grpc/support/port_platform.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>

@ -266,8 +266,11 @@ class Server::SyncRequestThreadManager : public ThreadManager {
WorkStatus PollForWork(void** tag, bool* ok) override {
*tag = nullptr;
// TODO(ctiller): workaround for GPR_TIMESPAN based deadlines not working
// right now
gpr_timespec deadline =
gpr_time_from_millis(cq_timeout_msec_, GPR_TIMESPAN);
gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
gpr_time_from_millis(cq_timeout_msec_, GPR_TIMESPAN));
switch (server_cq_->AsyncNext(tag, ok, deadline)) {
case CompletionQueue::TIMEOUT:

@ -289,7 +289,7 @@ static GRPCProtoMethod *kFullDuplexCallMethod;
XCTAssertEqualObjects(userAgent, expectedUserAgent);
// Change in format of user-agent field in a direction that does not match the regex will likely
// cause problem for certain gRPC users. @muxi for details.
// cause problem for certain gRPC users. For details, refer to internal doc https://goo.gl/c2diBc
NSRegularExpression *regex =
[NSRegularExpression regularExpressionWithPattern:@" grpc-[a-zA-Z0-9]+(-[a-zA-Z0-9]+)?/[^ ,]+( \\([^)]*\\))?"
options:0

@ -159,6 +159,7 @@ static void test_early_server_shutdown_finishes_inflight_calls(
grpc_server_destroy(f.server);
// new code should give INTERNAL, some older code will give UNAVAILABLE
GPR_ASSERT(status == GRPC_STATUS_INTERNAL ||
status == GRPC_STATUS_UNAVAILABLE);
GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));

@ -37,9 +37,11 @@ namespace {
int g_clock = 0;
gpr_timespec fake_gpr_now(gpr_clock_type clock_type) {
return (gpr_timespec){
.tv_sec = g_clock, .tv_nsec = 0, .clock_type = clock_type,
};
gpr_timespec ts;
ts.tv_sec = g_clock;
ts.tv_nsec = 0;
ts.clock_type = clock_type;
return ts;
}
void inc_time(void) { g_clock += 30; }

@ -220,7 +220,8 @@ class End2endTest : public ::testing::TestWithParam<TestScenario> {
End2endTest()
: is_server_started_(false),
kMaxMessageSize_(8192),
special_service_("special") {
special_service_("special"),
first_picked_port_(0) {
GetParam().Log();
}
@ -229,10 +230,14 @@ class End2endTest : public ::testing::TestWithParam<TestScenario> {
server_->Shutdown();
if (proxy_server_) proxy_server_->Shutdown();
}
if (first_picked_port_ > 0) {
grpc_recycle_unused_port(first_picked_port_);
}
}
void StartServer(const std::shared_ptr<AuthMetadataProcessor>& processor) {
int port = grpc_pick_unused_port_or_die();
first_picked_port_ = port;
server_address_ << "127.0.0.1:" << port;
// Setup server
BuildAndStartServer(processor);
@ -328,6 +333,7 @@ class End2endTest : public ::testing::TestWithParam<TestScenario> {
TestServiceImpl special_service_;
TestServiceImplDupPkg dup_pkg_service_;
grpc::string user_agent_prefix_;
int first_picked_port_;
};
static void SendRpc(grpc::testing::EchoTestService::Stub* stub, int num_rpcs,

@ -78,7 +78,8 @@ print yaml.dump({
'cpu_cost': guess_cpu(scenario_json, False),
'exclude_configs': ['tsan', 'asan'],
'timeout_seconds': 2*60,
'excluded_poll_engines': scenario_json.get('EXCLUDED_POLL_ENGINES', [])
'excluded_poll_engines': scenario_json.get('EXCLUDED_POLL_ENGINES', []),
'auto_timeout_scaling': False
}
for scenario_json in scenario_config.CXXLanguage().scenarios()
if 'scalable' in scenario_json.get('CATEGORIES', [])
@ -95,8 +96,9 @@ print yaml.dump({
'defaults': 'boringssl',
'cpu_cost': guess_cpu(scenario_json, True),
'exclude_configs': sorted(c for c in configs_from_yaml if c not in ('tsan', 'asan')),
'timeout_seconds': 2*60,
'excluded_poll_engines': scenario_json.get('EXCLUDED_POLL_ENGINES', [])
'timeout_seconds': 10*60,
'excluded_poll_engines': scenario_json.get('EXCLUDED_POLL_ENGINES', []),
'auto_timeout_scaling': False
}
for scenario_json in scenario_config.CXXLanguage().scenarios()
if 'scalable' in scenario_json.get('CATEGORIES', [])

@ -2420,6 +2420,23 @@
"third_party": false,
"type": "target"
},
{
"deps": [
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"is_filegroup": false,
"language": "c",
"name": "transport_metadata_test",
"src": [
"test/core/transport/metadata_test.c"
],
"third_party": false,
"type": "target"
},
{
"deps": [
"gpr",
@ -4208,23 +4225,6 @@
"third_party": false,
"type": "target"
},
{
"deps": [
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"is_filegroup": false,
"language": "c++",
"name": "transport_metadata_test",
"src": [
"test/core/transport/metadata_test.c"
],
"third_party": false,
"type": "target"
},
{
"deps": [
"gpr",

File diff suppressed because it is too large Load Diff

@ -82,6 +82,16 @@ def _payload_type(use_generic_payload, req_size, resp_size):
r['simple_params'] = sizes
return r
def _load_params(offered_load):
r = {}
if offered_load is None:
r['closed_loop'] = {}
else:
load = {}
load['offered_load'] = offered_load
r['poisson'] = load
return r
def _add_channel_arg(config, key, value):
if 'channel_args' in config:
channel_args = config['channel_args']
@ -115,7 +125,8 @@ def _ping_pong_scenario(name, rpc_type,
resource_quota_size=None,
messages_per_stream=None,
excluded_poll_engines=[],
minimal_stack=False):
minimal_stack=False,
offered_load=None):
"""Creates a basic ping pong scenario."""
scenario = {
'name': name,
@ -129,9 +140,6 @@ def _ping_pong_scenario(name, rpc_type,
'async_client_threads': 1,
'threads_per_cq': client_threads_per_cq,
'rpc_type': rpc_type,
'load_params': {
'closed_loop': {}
},
'histogram_params': HISTOGRAM_PARAMS,
'channel_args': [],
},
@ -171,12 +179,16 @@ def _ping_pong_scenario(name, rpc_type,
scenario['client_config']['outstanding_rpcs_per_channel'] = deep
scenario['client_config']['client_channels'] = wide
scenario['client_config']['async_client_threads'] = 0
if offered_load is not None:
optimization_target = 'latency'
else:
scenario['client_config']['outstanding_rpcs_per_channel'] = 1
scenario['client_config']['client_channels'] = 1
scenario['client_config']['async_client_threads'] = 1
optimization_target = 'latency'
scenario['client_config']['load_params'] = _load_params(offered_load)
optimization_channel_arg = {
'name': 'grpc.optimization_target',
'str_value': optimization_target
@ -235,6 +247,15 @@ class CXXLanguage:
secure=False,
categories=[SMOKETEST] + [SCALABLE])
yield _ping_pong_scenario(
'cpp_protobuf_async_unary_75Kqps_600channel_60Krpcs_300Breq_50Bresp',
rpc_type='UNARY', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
req_size=300, resp_size=50,
unconstrained_client='async', outstanding=30000, channels=300,
offered_load=37500, secure=False,
async_server_threads=16, server_threads_per_cq=16,
categories=[SMOKETEST] + [SCALABLE])
for secure in [True, False]:
secstr = 'secure' if secure else 'insecure'
smoketest_categories = ([SMOKETEST] if secure else []) + [SCALABLE]
@ -809,7 +830,7 @@ class Php7Language:
def worker_cmdline(self):
if self.php7_protobuf_c:
return ['tools/run_tests/performance/run_worker_php.sh --use_protobuf_c_extension']
return ['tools/run_tests/performance/run_worker_php.sh', '--use_protobuf_c_extension']
return ['tools/run_tests/performance/run_worker_php.sh']
def worker_port_offset(self):
@ -821,7 +842,7 @@ class Php7Language:
php7_extension_mode='php7_protobuf_php_extension'
if self.php7_protobuf_c:
php7_extension_mode='php7_protobuf_c_extension'
yield _ping_pong_scenario(
'%s_to_cpp_protobuf_sync_unary_ping_pong' % php7_extension_mode,
rpc_type='UNARY', client_type='SYNC_CLIENT', server_type='SYNC_SERVER',

@ -302,6 +302,7 @@ class Job(object):
self._retries += 1
self.result.num_failures += 1
self.result.retries = self._timeout_retries + self._retries
# NOTE: job is restarted regardless of jobset's max_time setting
self.start()
else:
self._state = _FAILURE
@ -344,6 +345,7 @@ class Job(object):
if self._spec.kill_handler:
self._spec.kill_handler(self)
self._process.terminate()
# NOTE: job is restarted regardless of jobset's max_time setting
self.start()
else:
message('TIMEOUT', '%s [pid=%d, time=%.1fsec]' % (self._spec.shortname, self._process.pid, elapsed), stdout(), do_newline=True)

@ -680,7 +680,7 @@ def cloud_to_prod_jobspec(language, test_case, server_host_name,
shortname='%s:%s:%s:%s' % (suite_name, language, server_host_name,
test_case),
timeout_seconds=_TEST_TIMEOUT,
flake_retries=5 if args.allow_flakes else 0,
flake_retries=4 if args.allow_flakes else 0,
timeout_retries=2 if args.allow_flakes else 0,
kill_handler=_job_kill_handler)
if docker_image:
@ -746,7 +746,7 @@ def cloud_to_cloud_jobspec(language, test_case, server_name, server_host,
shortname='cloud_to_cloud:%s:%s_server:%s' % (language, server_name,
test_case),
timeout_seconds=_TEST_TIMEOUT,
flake_retries=5 if args.allow_flakes else 0,
flake_retries=4 if args.allow_flakes else 0,
timeout_retries=2 if args.allow_flakes else 0,
kill_handler=_job_kill_handler)
if docker_image:

@ -122,7 +122,7 @@ def max_parallel_tests_for_current_platform():
# so far on windows.
if jobset.platform_string() == 'windows':
return 64
return 128
return 1024
# SimpleConfig: just compile with CONFIG=config, and run the binary to test
class Config(object):
@ -159,8 +159,8 @@ class Config(object):
environ=actual_environ,
cpu_cost=cpu_cost,
timeout_seconds=(self.timeout_multiplier * timeout_seconds if timeout_seconds else None),
flake_retries=5 if flaky or args.allow_flakes else 0,
timeout_retries=3 if flaky or args.allow_flakes else 0)
flake_retries=4 if flaky or args.allow_flakes else 0,
timeout_retries=1 if flaky or args.allow_flakes else 0)
def get_c_tests(travis, test_lang) :
@ -284,6 +284,7 @@ class CLanguage(object):
if self._use_cmake and target.get('boringssl', False):
# cmake doesn't build boringssl tests
continue
auto_timeout_scaling = target.get('auto_timeout_scaling', True)
polling_strategies = (_POLLING_STRATEGIES.get(self.platform, ['all'])
if target.get('uses_polling', True)
else ['none'])
@ -299,7 +300,8 @@ class CLanguage(object):
env['GRPC_DNS_RESOLVER'] = resolver
shortname_ext = '' if polling_strategy=='all' else ' GRPC_POLL_STRATEGY=%s' % polling_strategy
timeout_scaling = 1
if polling_strategy == 'poll-cv':
if auto_timeout_scaling and polling_strategy == 'poll-cv':
timeout_scaling *= 5
if polling_strategy in target.get('excluded_poll_engines', []):
@ -307,12 +309,12 @@ class CLanguage(object):
# Scale overall test timeout if running under various sanitizers.
config = self.args.config
if ('asan' in config
or config == 'msan'
or config == 'tsan'
or config == 'ubsan'
or config == 'helgrind'
or config == 'memcheck'):
if auto_timeout_scaling and ('asan' in config
or config == 'msan'
or config == 'tsan'
or config == 'ubsan'
or config == 'helgrind'
or config == 'memcheck'):
timeout_scaling *= 20
if self.config.build_config in target['exclude_configs']:
@ -1493,7 +1495,7 @@ def build_step_environ(cfg):
return environ
build_steps = list(set(
jobset.JobSpec(cmdline, environ=build_step_environ(build_config), flake_retries=5)
jobset.JobSpec(cmdline, environ=build_step_environ(build_config), flake_retries=2)
for l in languages
for cmdline in l.pre_build_steps()))
if make_targets:

Loading…
Cancel
Save