Merge remote-tracking branch 'upstream/master' into spiffe1

pull/19778/head
Matthew Stevenson 5 years ago
commit 726f0b68a1
  1. 2
      .github/ISSUE_TEMPLATE/bug_report.md
  2. 2
      .github/ISSUE_TEMPLATE/cleanup_request.md
  3. 2
      .github/ISSUE_TEMPLATE/feature_request.md
  4. 2
      .github/pull_request_template.md
  5. 4
      BUILD
  6. 6
      BUILD.gn
  7. 75
      CMakeLists.txt
  8. 86
      Makefile
  9. 26
      build.yaml
  10. 2
      config.m4
  11. 2
      config.w32
  12. 9
      doc/server_reflection_tutorial.md
  13. 2
      gRPC-C++.podspec
  14. 10
      gRPC-Core.podspec
  15. 52
      gRPC.podspec
  16. 4
      grpc.gemspec
  17. 2
      grpc.gyp
  18. 20
      include/grpc/impl/codegen/port_platform.h
  19. 4
      package.xml
  20. 61
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
  21. 40
      src/core/lib/channel/connected_channel.cc
  22. 117
      src/core/lib/gpr/mpscq.cc
  23. 88
      src/core/lib/gpr/mpscq.h
  24. 108
      src/core/lib/gprpp/mpscq.cc
  25. 98
      src/core/lib/gprpp/mpscq.h
  26. 9
      src/core/lib/iomgr/call_combiner.cc
  27. 4
      src/core/lib/iomgr/call_combiner.h
  28. 11
      src/core/lib/iomgr/closure.h
  29. 17
      src/core/lib/iomgr/combiner.cc
  30. 1
      src/core/lib/iomgr/combiner.h
  31. 23
      src/core/lib/surface/completion_queue.cc
  32. 5
      src/core/lib/surface/completion_queue.h
  33. 57
      src/core/lib/surface/server.cc
  34. 11
      src/objective-c/!ProtoCompiler-gRPCPlugin.podspec
  35. 7
      src/objective-c/!ProtoCompiler.podspec
  36. 2
      src/objective-c/BoringSSL-GRPC.podspec
  37. 2
      src/python/grpcio/grpc_core_dependencies.py
  38. 4
      templates/gRPC-Core.podspec.template
  39. 52
      templates/gRPC.podspec.template
  40. 11
      templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template
  41. 2
      templates/src/objective-c/BoringSSL-GRPC.podspec.template
  42. 1
      test/core/end2end/generate_tests.bzl
  43. 11
      test/core/gpr/BUILD
  44. 11
      test/core/gprpp/BUILD
  45. 37
      test/core/gprpp/mpscq_test.cc
  46. 3
      third_party/objective_c/google_toolbox_for_mac/BUILD
  47. 2
      tools/doxygen/Doxyfile.c++.internal
  48. 4
      tools/doxygen/Doxyfile.core.internal
  49. 48
      tools/run_tests/generated/tests.json
  50. 24
      tools/run_tests/run_tests.py

@ -2,7 +2,7 @@
name: Report a bug
about: Create a report to help us improve
labels: kind/bug, priority/P2
assignees: karthikravis
assignees: veblush
---

@ -2,7 +2,7 @@
name: Request a cleanup
about: Suggest a cleanup in our repository
labels: kind/internal cleanup
assignees: karthikravis
assignees: veblush
---

@ -2,7 +2,7 @@
name: Request a feature
about: Suggest an idea for this project
labels: kind/enhancement
assignees: karthikravis
assignees: veblush
---

@ -8,4 +8,4 @@ If you know who should review your pull request, please remove the mentioning be
-->
@karthikravis
@veblush

@ -476,7 +476,6 @@ grpc_cc_library(
"src/core/lib/gpr/log_linux.cc",
"src/core/lib/gpr/log_posix.cc",
"src/core/lib/gpr/log_windows.cc",
"src/core/lib/gpr/mpscq.cc",
"src/core/lib/gpr/murmur_hash.cc",
"src/core/lib/gpr/string.cc",
"src/core/lib/gpr/string_posix.cc",
@ -498,6 +497,7 @@ grpc_cc_library(
"src/core/lib/gprpp/fork.cc",
"src/core/lib/gprpp/global_config_env.cc",
"src/core/lib/gprpp/host_port.cc",
"src/core/lib/gprpp/mpscq.cc",
"src/core/lib/gprpp/thd_posix.cc",
"src/core/lib/gprpp/thd_windows.cc",
"src/core/lib/profiling/basic_timers.cc",
@ -507,7 +507,6 @@ grpc_cc_library(
"src/core/lib/gpr/alloc.h",
"src/core/lib/gpr/arena.h",
"src/core/lib/gpr/env.h",
"src/core/lib/gpr/mpscq.h",
"src/core/lib/gpr/murmur_hash.h",
"src/core/lib/gpr/spinlock.h",
"src/core/lib/gpr/string.h",
@ -531,6 +530,7 @@ grpc_cc_library(
"src/core/lib/gprpp/manual_constructor.h",
"src/core/lib/gprpp/map.h",
"src/core/lib/gprpp/memory.h",
"src/core/lib/gprpp/mpscq.h",
"src/core/lib/gprpp/pair.h",
"src/core/lib/gprpp/string_view.h",
"src/core/lib/gprpp/sync.h",

@ -104,8 +104,6 @@ config("grpc_config") {
"src/core/lib/gpr/log_linux.cc",
"src/core/lib/gpr/log_posix.cc",
"src/core/lib/gpr/log_windows.cc",
"src/core/lib/gpr/mpscq.cc",
"src/core/lib/gpr/mpscq.h",
"src/core/lib/gpr/murmur_hash.cc",
"src/core/lib/gpr/murmur_hash.h",
"src/core/lib/gpr/spinlock.h",
@ -150,6 +148,8 @@ config("grpc_config") {
"src/core/lib/gprpp/manual_constructor.h",
"src/core/lib/gprpp/map.h",
"src/core/lib/gprpp/memory.h",
"src/core/lib/gprpp/mpscq.cc",
"src/core/lib/gprpp/mpscq.h",
"src/core/lib/gprpp/pair.h",
"src/core/lib/gprpp/sync.h",
"src/core/lib/gprpp/thd.h",
@ -1227,7 +1227,6 @@ config("grpc_config") {
"src/core/lib/gpr/alloc.h",
"src/core/lib/gpr/arena.h",
"src/core/lib/gpr/env.h",
"src/core/lib/gpr/mpscq.h",
"src/core/lib/gpr/murmur_hash.h",
"src/core/lib/gpr/spinlock.h",
"src/core/lib/gpr/string.h",
@ -1253,6 +1252,7 @@ config("grpc_config") {
"src/core/lib/gprpp/manual_constructor.h",
"src/core/lib/gprpp/map.h",
"src/core/lib/gprpp/memory.h",
"src/core/lib/gprpp/mpscq.h",
"src/core/lib/gprpp/optional.h",
"src/core/lib/gprpp/orphanable.h",
"src/core/lib/gprpp/pair.h",

@ -308,7 +308,6 @@ add_dependencies(buildtests_c gpr_env_test)
add_dependencies(buildtests_c gpr_host_port_test)
add_dependencies(buildtests_c gpr_log_test)
add_dependencies(buildtests_c gpr_manual_constructor_test)
add_dependencies(buildtests_c gpr_mpscq_test)
add_dependencies(buildtests_c gpr_spinlock_test)
add_dependencies(buildtests_c gpr_string_test)
add_dependencies(buildtests_c gpr_sync_test)
@ -628,6 +627,7 @@ add_dependencies(buildtests_cxx generic_end2end_test)
add_dependencies(buildtests_cxx global_config_env_test)
add_dependencies(buildtests_cxx global_config_test)
add_dependencies(buildtests_cxx golden_file_test)
add_dependencies(buildtests_cxx gprpp_mpscq_test)
add_dependencies(buildtests_cxx grpc_alts_credentials_options_test)
add_dependencies(buildtests_cxx grpc_cli)
add_dependencies(buildtests_cxx grpc_core_map_test)
@ -864,7 +864,6 @@ add_library(gpr
src/core/lib/gpr/log_linux.cc
src/core/lib/gpr/log_posix.cc
src/core/lib/gpr/log_windows.cc
src/core/lib/gpr/mpscq.cc
src/core/lib/gpr/murmur_hash.cc
src/core/lib/gpr/string.cc
src/core/lib/gpr/string_posix.cc
@ -886,6 +885,7 @@ add_library(gpr
src/core/lib/gprpp/fork.cc
src/core/lib/gprpp/global_config_env.cc
src/core/lib/gprpp/host_port.cc
src/core/lib/gprpp/mpscq.cc
src/core/lib/gprpp/thd_posix.cc
src/core/lib/gprpp/thd_windows.cc
src/core/lib/profiling/basic_timers.cc
@ -7088,37 +7088,6 @@ target_link_libraries(gpr_manual_constructor_test
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(gpr_mpscq_test
test/core/gpr/mpscq_test.cc
)
target_include_directories(gpr_mpscq_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
PRIVATE ${_gRPC_UPB_GENERATED_DIR}
PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR}
PRIVATE ${_gRPC_UPB_INCLUDE_DIR}
PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
)
target_link_libraries(gpr_mpscq_test
${_gRPC_ALLTARGETS_LIBRARIES}
gpr
grpc_test_util_unsecure
grpc_unsecure
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
@ -13350,6 +13319,46 @@ target_link_libraries(golden_file_test
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(gprpp_mpscq_test
test/core/gprpp/mpscq_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
target_include_directories(gprpp_mpscq_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
PRIVATE ${_gRPC_UPB_GENERATED_DIR}
PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR}
PRIVATE ${_gRPC_UPB_INCLUDE_DIR}
PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
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(gprpp_mpscq_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
gpr
grpc_test_util_unsecure
grpc_unsecure
${_gRPC_GFLAGS_LIBRARIES}
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)

@ -1038,7 +1038,6 @@ gpr_env_test: $(BINDIR)/$(CONFIG)/gpr_env_test
gpr_host_port_test: $(BINDIR)/$(CONFIG)/gpr_host_port_test
gpr_log_test: $(BINDIR)/$(CONFIG)/gpr_log_test
gpr_manual_constructor_test: $(BINDIR)/$(CONFIG)/gpr_manual_constructor_test
gpr_mpscq_test: $(BINDIR)/$(CONFIG)/gpr_mpscq_test
gpr_spinlock_test: $(BINDIR)/$(CONFIG)/gpr_spinlock_test
gpr_string_test: $(BINDIR)/$(CONFIG)/gpr_string_test
gpr_sync_test: $(BINDIR)/$(CONFIG)/gpr_sync_test
@ -1219,6 +1218,7 @@ generic_end2end_test: $(BINDIR)/$(CONFIG)/generic_end2end_test
global_config_env_test: $(BINDIR)/$(CONFIG)/global_config_env_test
global_config_test: $(BINDIR)/$(CONFIG)/global_config_test
golden_file_test: $(BINDIR)/$(CONFIG)/golden_file_test
gprpp_mpscq_test: $(BINDIR)/$(CONFIG)/gprpp_mpscq_test
grpc_alts_credentials_options_test: $(BINDIR)/$(CONFIG)/grpc_alts_credentials_options_test
grpc_cli: $(BINDIR)/$(CONFIG)/grpc_cli
grpc_core_map_test: $(BINDIR)/$(CONFIG)/grpc_core_map_test
@ -1478,7 +1478,6 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/gpr_host_port_test \
$(BINDIR)/$(CONFIG)/gpr_log_test \
$(BINDIR)/$(CONFIG)/gpr_manual_constructor_test \
$(BINDIR)/$(CONFIG)/gpr_mpscq_test \
$(BINDIR)/$(CONFIG)/gpr_spinlock_test \
$(BINDIR)/$(CONFIG)/gpr_string_test \
$(BINDIR)/$(CONFIG)/gpr_sync_test \
@ -1698,6 +1697,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/global_config_env_test \
$(BINDIR)/$(CONFIG)/global_config_test \
$(BINDIR)/$(CONFIG)/golden_file_test \
$(BINDIR)/$(CONFIG)/gprpp_mpscq_test \
$(BINDIR)/$(CONFIG)/grpc_alts_credentials_options_test \
$(BINDIR)/$(CONFIG)/grpc_cli \
$(BINDIR)/$(CONFIG)/grpc_core_map_test \
@ -1867,6 +1867,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/global_config_env_test \
$(BINDIR)/$(CONFIG)/global_config_test \
$(BINDIR)/$(CONFIG)/golden_file_test \
$(BINDIR)/$(CONFIG)/gprpp_mpscq_test \
$(BINDIR)/$(CONFIG)/grpc_alts_credentials_options_test \
$(BINDIR)/$(CONFIG)/grpc_cli \
$(BINDIR)/$(CONFIG)/grpc_core_map_test \
@ -2048,8 +2049,6 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/gpr_log_test || ( echo test gpr_log_test failed ; exit 1 )
$(E) "[RUN] Testing gpr_manual_constructor_test"
$(Q) $(BINDIR)/$(CONFIG)/gpr_manual_constructor_test || ( echo test gpr_manual_constructor_test failed ; exit 1 )
$(E) "[RUN] Testing gpr_mpscq_test"
$(Q) $(BINDIR)/$(CONFIG)/gpr_mpscq_test || ( echo test gpr_mpscq_test failed ; exit 1 )
$(E) "[RUN] Testing gpr_spinlock_test"
$(Q) $(BINDIR)/$(CONFIG)/gpr_spinlock_test || ( echo test gpr_spinlock_test failed ; exit 1 )
$(E) "[RUN] Testing gpr_string_test"
@ -2376,6 +2375,8 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/global_config_test || ( echo test global_config_test failed ; exit 1 )
$(E) "[RUN] Testing golden_file_test"
$(Q) $(BINDIR)/$(CONFIG)/golden_file_test || ( echo test golden_file_test failed ; exit 1 )
$(E) "[RUN] Testing gprpp_mpscq_test"
$(Q) $(BINDIR)/$(CONFIG)/gprpp_mpscq_test || ( echo test gprpp_mpscq_test failed ; exit 1 )
$(E) "[RUN] Testing grpc_alts_credentials_options_test"
$(Q) $(BINDIR)/$(CONFIG)/grpc_alts_credentials_options_test || ( echo test grpc_alts_credentials_options_test failed ; exit 1 )
$(E) "[RUN] Testing grpc_core_map_test"
@ -3457,7 +3458,6 @@ LIBGPR_SRC = \
src/core/lib/gpr/log_linux.cc \
src/core/lib/gpr/log_posix.cc \
src/core/lib/gpr/log_windows.cc \
src/core/lib/gpr/mpscq.cc \
src/core/lib/gpr/murmur_hash.cc \
src/core/lib/gpr/string.cc \
src/core/lib/gpr/string_posix.cc \
@ -3479,6 +3479,7 @@ LIBGPR_SRC = \
src/core/lib/gprpp/fork.cc \
src/core/lib/gprpp/global_config_env.cc \
src/core/lib/gprpp/host_port.cc \
src/core/lib/gprpp/mpscq.cc \
src/core/lib/gprpp/thd_posix.cc \
src/core/lib/gprpp/thd_windows.cc \
src/core/lib/profiling/basic_timers.cc \
@ -9996,38 +9997,6 @@ endif
endif
GPR_MPSCQ_TEST_SRC = \
test/core/gpr/mpscq_test.cc \
GPR_MPSCQ_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_MPSCQ_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/gpr_mpscq_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/gpr_mpscq_test: $(GPR_MPSCQ_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(GPR_MPSCQ_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gpr_mpscq_test
endif
$(OBJDIR)/$(CONFIG)/test/core/gpr/mpscq_test.o: $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a
deps_gpr_mpscq_test: $(GPR_MPSCQ_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(GPR_MPSCQ_TEST_OBJS:.o=.dep)
endif
endif
GPR_SPINLOCK_TEST_SRC = \
test/core/gpr/spinlock_test.cc \
@ -16740,6 +16709,49 @@ endif
$(OBJDIR)/$(CONFIG)/test/cpp/codegen/golden_file_test.o: $(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc
GPRPP_MPSCQ_TEST_SRC = \
test/core/gprpp/mpscq_test.cc \
GPRPP_MPSCQ_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPRPP_MPSCQ_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/gprpp_mpscq_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.5.0+.
$(BINDIR)/$(CONFIG)/gprpp_mpscq_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/gprpp_mpscq_test: $(PROTOBUF_DEP) $(GPRPP_MPSCQ_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(GPRPP_MPSCQ_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/gprpp_mpscq_test
endif
endif
$(OBJDIR)/$(CONFIG)/test/core/gprpp/mpscq_test.o: $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a
deps_gprpp_mpscq_test: $(GPRPP_MPSCQ_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(GPRPP_MPSCQ_TEST_OBJS:.o=.dep)
endif
endif
GRPC_ALTS_CREDENTIALS_OPTIONS_TEST_SRC = \
test/core/security/grpc_alts_credentials_options_test.cc \

@ -217,7 +217,6 @@ filegroups:
- src/core/lib/gpr/log_linux.cc
- src/core/lib/gpr/log_posix.cc
- src/core/lib/gpr/log_windows.cc
- src/core/lib/gpr/mpscq.cc
- src/core/lib/gpr/murmur_hash.cc
- src/core/lib/gpr/string.cc
- src/core/lib/gpr/string_posix.cc
@ -239,6 +238,7 @@ filegroups:
- src/core/lib/gprpp/fork.cc
- src/core/lib/gprpp/global_config_env.cc
- src/core/lib/gprpp/host_port.cc
- src/core/lib/gprpp/mpscq.cc
- src/core/lib/gprpp/thd_posix.cc
- src/core/lib/gprpp/thd_windows.cc
- src/core/lib/profiling/basic_timers.cc
@ -268,7 +268,6 @@ filegroups:
- src/core/lib/gpr/alloc.h
- src/core/lib/gpr/arena.h
- src/core/lib/gpr/env.h
- src/core/lib/gpr/mpscq.h
- src/core/lib/gpr/murmur_hash.h
- src/core/lib/gpr/spinlock.h
- src/core/lib/gpr/string.h
@ -292,6 +291,7 @@ filegroups:
- src/core/lib/gprpp/manual_constructor.h
- src/core/lib/gprpp/map.h
- src/core/lib/gprpp/memory.h
- src/core/lib/gprpp/mpscq.h
- src/core/lib/gprpp/pair.h
- src/core/lib/gprpp/sync.h
- src/core/lib/gprpp/thd.h
@ -2745,17 +2745,6 @@ targets:
- grpc_test_util_unsecure
- grpc_unsecure
uses_polling: false
- name: gpr_mpscq_test
cpu_cost: 30
build: test
language: c
src:
- test/core/gpr/mpscq_test.cc
deps:
- gpr
- grpc_test_util_unsecure
- grpc_unsecure
uses_polling: false
- name: gpr_spinlock_test
cpu_cost: 3
build: test
@ -5008,6 +4997,17 @@ targets:
args:
- --generated_file_path=gens/src/proto/grpc/testing/
uses_polling: false
- name: gprpp_mpscq_test
cpu_cost: 30
build: test
language: c++
src:
- test/core/gprpp/mpscq_test.cc
deps:
- gpr
- grpc_test_util_unsecure
- grpc_unsecure
uses_polling: false
- name: grpc_alts_credentials_options_test
build: test
language: c++

@ -63,7 +63,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/gpr/log_linux.cc \
src/core/lib/gpr/log_posix.cc \
src/core/lib/gpr/log_windows.cc \
src/core/lib/gpr/mpscq.cc \
src/core/lib/gpr/murmur_hash.cc \
src/core/lib/gpr/string.cc \
src/core/lib/gpr/string_posix.cc \
@ -85,6 +84,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/gprpp/fork.cc \
src/core/lib/gprpp/global_config_env.cc \
src/core/lib/gprpp/host_port.cc \
src/core/lib/gprpp/mpscq.cc \
src/core/lib/gprpp/thd_posix.cc \
src/core/lib/gprpp/thd_windows.cc \
src/core/lib/profiling/basic_timers.cc \

@ -33,7 +33,6 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\gpr\\log_linux.cc " +
"src\\core\\lib\\gpr\\log_posix.cc " +
"src\\core\\lib\\gpr\\log_windows.cc " +
"src\\core\\lib\\gpr\\mpscq.cc " +
"src\\core\\lib\\gpr\\murmur_hash.cc " +
"src\\core\\lib\\gpr\\string.cc " +
"src\\core\\lib\\gpr\\string_posix.cc " +
@ -55,6 +54,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\gprpp\\fork.cc " +
"src\\core\\lib\\gprpp\\global_config_env.cc " +
"src\\core\\lib\\gprpp\\host_port.cc " +
"src\\core\\lib\\gprpp\\mpscq.cc " +
"src\\core\\lib\\gprpp\\thd_posix.cc " +
"src\\core\\lib\\gprpp\\thd_windows.cc " +
"src\\core\\lib\\profiling\\basic_timers.cc " +

@ -178,15 +178,12 @@ descriptor database.
desc_pool->FindMethodByName("helloworld.Greeter.SayHello");
```
* Get message type descriptors.
* Get message type descriptors and create messages dynamically.
```c++
const google::protobuf::Descriptor* request_desc =
desc_pool->FindMessageTypeByName("helloworld.HelloRequest");
google::protobuf::DynamicMessageFactory dmf;
google::protobuf::Message* request = dmf.GetPrototype(request_desc)->New();
```
* Feed [google::protobuf::DynamicMessageFactory](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.dynamic_message#DynamicMessageFactory).
```c++
google::protobuf::DynamicMessageFactory(&desc_pool);
```

@ -293,7 +293,6 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/alloc.h',
'src/core/lib/gpr/arena.h',
'src/core/lib/gpr/env.h',
'src/core/lib/gpr/mpscq.h',
'src/core/lib/gpr/murmur_hash.h',
'src/core/lib/gpr/spinlock.h',
'src/core/lib/gpr/string.h',
@ -317,6 +316,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/manual_constructor.h',
'src/core/lib/gprpp/map.h',
'src/core/lib/gprpp/memory.h',
'src/core/lib/gprpp/mpscq.h',
'src/core/lib/gprpp/pair.h',
'src/core/lib/gprpp/sync.h',
'src/core/lib/gprpp/thd.h',

@ -32,6 +32,7 @@ Pod::Spec.new do |s|
s.source = {
:git => 'https://github.com/grpc/grpc.git',
:tag => "v#{version}",
:submodules => true,
}
# gRPC podspecs depend on fix for https://github.com/CocoaPods/CocoaPods/issues/6024,
@ -184,14 +185,12 @@ Pod::Spec.new do |s|
ss.header_mappings_dir = '.'
ss.libraries = 'z'
ss.dependency "#{s.name}/Interface", version
ss.dependency 'BoringSSL-GRPC', '0.0.3'
ss.dependency 'BoringSSL-GRPC', '0.0.4'
ss.compiler_flags = '-DGRPC_SHADOW_BORINGSSL_SYMBOLS'
# To save you from scrolling, this is the last part of the podspec.
ss.source_files = 'src/core/lib/gpr/alloc.h',
'src/core/lib/gpr/arena.h',
'src/core/lib/gpr/env.h',
'src/core/lib/gpr/mpscq.h',
'src/core/lib/gpr/murmur_hash.h',
'src/core/lib/gpr/spinlock.h',
'src/core/lib/gpr/string.h',
@ -215,6 +214,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/manual_constructor.h',
'src/core/lib/gprpp/map.h',
'src/core/lib/gprpp/memory.h',
'src/core/lib/gprpp/mpscq.h',
'src/core/lib/gprpp/pair.h',
'src/core/lib/gprpp/sync.h',
'src/core/lib/gprpp/thd.h',
@ -233,7 +233,6 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/log_linux.cc',
'src/core/lib/gpr/log_posix.cc',
'src/core/lib/gpr/log_windows.cc',
'src/core/lib/gpr/mpscq.cc',
'src/core/lib/gpr/murmur_hash.cc',
'src/core/lib/gpr/string.cc',
'src/core/lib/gpr/string_posix.cc',
@ -255,6 +254,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/fork.cc',
'src/core/lib/gprpp/global_config_env.cc',
'src/core/lib/gprpp/host_port.cc',
'src/core/lib/gprpp/mpscq.cc',
'src/core/lib/gprpp/thd_posix.cc',
'src/core/lib/gprpp/thd_windows.cc',
'src/core/lib/profiling/basic_timers.cc',
@ -967,7 +967,6 @@ Pod::Spec.new do |s|
ss.private_header_files = 'src/core/lib/gpr/alloc.h',
'src/core/lib/gpr/arena.h',
'src/core/lib/gpr/env.h',
'src/core/lib/gpr/mpscq.h',
'src/core/lib/gpr/murmur_hash.h',
'src/core/lib/gpr/spinlock.h',
'src/core/lib/gpr/string.h',
@ -991,6 +990,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/manual_constructor.h',
'src/core/lib/gprpp/map.h',
'src/core/lib/gprpp/memory.h',
'src/core/lib/gprpp/mpscq.h',
'src/core/lib/gprpp/pair.h',
'src/core/lib/gprpp/sync.h',
'src/core/lib/gprpp/thd.h',

@ -32,11 +32,6 @@ Pod::Spec.new do |s|
:tag => "v#{version}",
}
s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.9'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '4.0'
name = 'GRPCClient'
s.module_name = name
s.header_dir = name
@ -49,25 +44,35 @@ Pod::Spec.new do |s|
'CLANG_WARN_STRICT_PROTOTYPES' => 'NO',
}
s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.9'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '4.0'
s.subspec 'Interface-Legacy' do |ss|
ss.header_mappings_dir = 'src/objective-c/GRPCClient'
ss.public_header_files = "GRPCClient/GRPCCall+ChannelArg.h",
"GRPCClient/GRPCCall+ChannelCredentials.h",
"GRPCClient/GRPCCall+Cronet.h",
"GRPCClient/GRPCCall+OAuth2.h",
"GRPCClient/GRPCCall+Tests.h",
ss.public_header_files = "src/objective-c/GRPCClient/GRPCCall+ChannelArg.h",
"src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.h",
"src/objective-c/GRPCClient/GRPCCall+Cronet.h",
"src/objective-c/GRPCClient/GRPCCall+OAuth2.h",
"src/objective-c/GRPCClient/GRPCCall+Tests.h",
"src/objective-c/GRPCClient/GRPCCallLegacy.h",
"src/objective-c/GRPCClient/GRPCTypes.h"
ss.source_files = "GRPCClient/GRPCCall+ChannelArg.h",
"GRPCClient/GRPCCall+ChannelCredentials.h",
"GRPCClient/GRPCCall+Cronet.h",
"GRPCClient/GRPCCall+OAuth2.h",
"GRPCClient/GRPCCall+Tests.h",
ss.source_files = "src/objective-c/GRPCClient/GRPCCall+ChannelArg.h",
"src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.h",
"src/objective-c/GRPCClient/GRPCCall+Cronet.h",
"src/objective-c/GRPCClient/GRPCCall+OAuth2.h",
"src/objective-c/GRPCClient/GRPCCall+Tests.h",
"src/objective-c/GRPCClient/GRPCCallLegacy.h",
"src/objective-c/GRPCClient/GRPCTypes.h"
ss.dependency "gRPC-RxLibrary/Interface", version
ss.ios.deployment_target = '7.0'
ss.osx.deployment_target = '10.9'
ss.tvos.deployment_target = '10.0'
ss.watchos.deployment_target = '4.0'
end
s.subspec 'Interface' do |ss|
@ -98,6 +103,11 @@ Pod::Spec.new do |s|
'src/objective-c/GRPCClient/version.h'
ss.dependency "#{s.name}/Interface-Legacy", version
ss.ios.deployment_target = '7.0'
ss.osx.deployment_target = '10.9'
ss.tvos.deployment_target = '10.0'
ss.watchos.deployment_target = '4.0'
end
s.subspec 'GRPCCore' do |ss|
@ -131,6 +141,11 @@ Pod::Spec.new do |s|
ss.dependency "#{s.name}/Interface", version
ss.dependency 'gRPC-Core', version
ss.dependency 'gRPC-RxLibrary', version
ss.ios.deployment_target = '7.0'
ss.osx.deployment_target = '10.9'
ss.tvos.deployment_target = '10.0'
ss.watchos.deployment_target = '4.0'
end
s.subspec 'GRPCCoreCronet' do |ss|
@ -142,10 +157,17 @@ Pod::Spec.new do |s|
ss.dependency "#{s.name}/GRPCCore", version
ss.dependency 'gRPC-Core/Cronet-Implementation', version
ss.dependency 'CronetFramework'
ss.ios.deployment_target = '8.0'
end
# CFStream is now default. Leaving this subspec only for compatibility purpose.
s.subspec 'CFStream' do |ss|
ss.dependency "#{s.name}/GRPCCore", version
ss.ios.deployment_target = '7.0'
ss.osx.deployment_target = '10.9'
ss.tvos.deployment_target = '10.0'
ss.watchos.deployment_target = '4.0'
end
end

@ -85,7 +85,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gpr/alloc.h )
s.files += %w( src/core/lib/gpr/arena.h )
s.files += %w( src/core/lib/gpr/env.h )
s.files += %w( src/core/lib/gpr/mpscq.h )
s.files += %w( src/core/lib/gpr/murmur_hash.h )
s.files += %w( src/core/lib/gpr/spinlock.h )
s.files += %w( src/core/lib/gpr/string.h )
@ -109,6 +108,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gprpp/manual_constructor.h )
s.files += %w( src/core/lib/gprpp/map.h )
s.files += %w( src/core/lib/gprpp/memory.h )
s.files += %w( src/core/lib/gprpp/mpscq.h )
s.files += %w( src/core/lib/gprpp/pair.h )
s.files += %w( src/core/lib/gprpp/sync.h )
s.files += %w( src/core/lib/gprpp/thd.h )
@ -127,7 +127,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gpr/log_linux.cc )
s.files += %w( src/core/lib/gpr/log_posix.cc )
s.files += %w( src/core/lib/gpr/log_windows.cc )
s.files += %w( src/core/lib/gpr/mpscq.cc )
s.files += %w( src/core/lib/gpr/murmur_hash.cc )
s.files += %w( src/core/lib/gpr/string.cc )
s.files += %w( src/core/lib/gpr/string_posix.cc )
@ -149,6 +148,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gprpp/fork.cc )
s.files += %w( src/core/lib/gprpp/global_config_env.cc )
s.files += %w( src/core/lib/gprpp/host_port.cc )
s.files += %w( src/core/lib/gprpp/mpscq.cc )
s.files += %w( src/core/lib/gprpp/thd_posix.cc )
s.files += %w( src/core/lib/gprpp/thd_windows.cc )
s.files += %w( src/core/lib/profiling/basic_timers.cc )

@ -218,7 +218,6 @@
'src/core/lib/gpr/log_linux.cc',
'src/core/lib/gpr/log_posix.cc',
'src/core/lib/gpr/log_windows.cc',
'src/core/lib/gpr/mpscq.cc',
'src/core/lib/gpr/murmur_hash.cc',
'src/core/lib/gpr/string.cc',
'src/core/lib/gpr/string_posix.cc',
@ -240,6 +239,7 @@
'src/core/lib/gprpp/fork.cc',
'src/core/lib/gprpp/global_config_env.cc',
'src/core/lib/gprpp/host_port.cc',
'src/core/lib/gprpp/mpscq.cc',
'src/core/lib/gprpp/thd_posix.cc',
'src/core/lib/gprpp/thd_windows.cc',
'src/core/lib/profiling/basic_timers.cc',

@ -194,6 +194,26 @@
#else /* musl libc */
#define GPR_MUSL_LIBC_COMPAT 1
#endif
#elif defined(__ASYLO__)
#define GPR_ARCH_64 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_TLS 1
#define GPR_PLATFORM_STRING "asylo"
#define GPR_GCC_SYNC 1
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_STRING 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_TIME 1
#define GPR_POSIX_ENV 1
#define GPR_ASYLO 1
#define GRPC_POSIX_SOCKET 1
#define GRPC_POSIX_SOCKETADDR
#define GRPC_POSIX_SOCKETUTILS 1
#define GRPC_TIMER_USE_GENERIC 1
#define GRPC_POSIX_NO_SPECIAL_WAKEUP_FD 1
#define GRPC_POSIX_WAKEUP_FD 1
#define GRPC_ARES 0
#define GPR_NO_AUTODETECT_PLATFORM 1
#elif defined(__APPLE__)
#include <Availability.h>
#include <TargetConditionals.h>

@ -90,7 +90,6 @@
<file baseinstalldir="/" name="src/core/lib/gpr/alloc.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/arena.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/env.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/mpscq.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/murmur_hash.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/spinlock.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/string.h" role="src" />
@ -114,6 +113,7 @@
<file baseinstalldir="/" name="src/core/lib/gprpp/manual_constructor.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/map.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/memory.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/mpscq.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/pair.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/sync.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/thd.h" role="src" />
@ -132,7 +132,6 @@
<file baseinstalldir="/" name="src/core/lib/gpr/log_linux.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/log_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/log_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/mpscq.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/murmur_hash.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/string.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/string_posix.cc" role="src" />
@ -154,6 +153,7 @@
<file baseinstalldir="/" name="src/core/lib/gprpp/fork.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/global_config_env.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/host_port.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/mpscq.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/thd_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/thd_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/profiling/basic_timers.cc" role="src" />

@ -88,7 +88,7 @@ class WSAErrorContext {
* from c-ares and are used with the grpc windows poller, and it, e.g.,
* manufactures virtual socket error codes when it e.g. needs to tell the c-ares
* library to wait for an async read. */
class GrpcPolledFdWindows : public GrpcPolledFd {
class GrpcPolledFdWindows {
public:
enum WriteState {
WRITE_IDLE,
@ -146,7 +146,7 @@ class GrpcPolledFdWindows : public GrpcPolledFd {
write_closure_ = nullptr;
}
void RegisterForOnReadableLocked(grpc_closure* read_closure) override {
void RegisterForOnReadableLocked(grpc_closure* read_closure) {
GPR_ASSERT(read_closure_ == nullptr);
read_closure_ = read_closure;
GPR_ASSERT(GRPC_SLICE_LENGTH(read_buf_) == 0);
@ -206,7 +206,7 @@ class GrpcPolledFdWindows : public GrpcPolledFd {
grpc_socket_notify_on_read(winsocket_, &outer_read_closure_);
}
void RegisterForOnWriteableLocked(grpc_closure* write_closure) override {
void RegisterForOnWriteableLocked(grpc_closure* write_closure) {
if (socket_type_ == SOCK_DGRAM) {
GRPC_CARES_TRACE_LOG("fd:|%s| RegisterForOnWriteableLocked called",
GetName());
@ -272,19 +272,17 @@ class GrpcPolledFdWindows : public GrpcPolledFd {
}
}
bool IsFdStillReadableLocked() override {
return GRPC_SLICE_LENGTH(read_buf_) > 0;
}
bool IsFdStillReadableLocked() { return GRPC_SLICE_LENGTH(read_buf_) > 0; }
void ShutdownLocked(grpc_error* error) override {
void ShutdownLocked(grpc_error* error) {
grpc_winsocket_shutdown(winsocket_);
}
ares_socket_t GetWrappedAresSocketLocked() override {
ares_socket_t GetWrappedAresSocketLocked() {
return grpc_winsocket_wrapped_socket(winsocket_);
}
const char* GetName() override { return name_; }
const char* GetName() { return name_; }
ares_ssize_t RecvFrom(WSAErrorContext* wsa_error_ctx, void* data,
ares_socket_t data_len, int flags,
@ -816,14 +814,19 @@ class SockToPolledFdMap {
SockToPolledFdMap* map = static_cast<SockToPolledFdMap*>(user_data);
GrpcPolledFdWindows* polled_fd = map->LookupPolledFd(s);
map->RemoveEntry(s);
// See https://github.com/grpc/grpc/pull/20284, this trace log is
// intentionally placed to attempt to trigger a crash in case of a
// use after free on polled_fd.
GRPC_CARES_TRACE_LOG("CloseSocket called for socket: %s",
polled_fd->GetName());
// If a gRPC polled fd has not made it in to the driver's list yet, then
// the driver has not and will never see this socket.
if (!polled_fd->gotten_into_driver_list()) {
polled_fd->ShutdownLocked(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Shut down c-ares fd before without it ever having made it into the "
"driver's list"));
return 0;
}
grpc_core::Delete(polled_fd);
return 0;
}
@ -840,6 +843,42 @@ const struct ares_socket_functions custom_ares_sock_funcs = {
&SockToPolledFdMap::SendV /* sendv */,
};
/* A thin wrapper over a GrpcPolledFdWindows object but with a shorter
lifetime. This object releases it's GrpcPolledFdWindows upon destruction,
so that c-ares can close it via usual socket teardown. */
class GrpcPolledFdWindowsWrapper : public GrpcPolledFd {
public:
GrpcPolledFdWindowsWrapper(GrpcPolledFdWindows* wrapped)
: wrapped_(wrapped) {}
~GrpcPolledFdWindowsWrapper() {}
void RegisterForOnReadableLocked(grpc_closure* read_closure) override {
wrapped_->RegisterForOnReadableLocked(read_closure);
}
void RegisterForOnWriteableLocked(grpc_closure* write_closure) override {
wrapped_->RegisterForOnWriteableLocked(write_closure);
}
bool IsFdStillReadableLocked() override {
return wrapped_->IsFdStillReadableLocked();
}
void ShutdownLocked(grpc_error* error) override {
wrapped_->ShutdownLocked(error);
}
ares_socket_t GetWrappedAresSocketLocked() override {
return wrapped_->GetWrappedAresSocketLocked();
}
const char* GetName() override { return wrapped_->GetName(); }
private:
GrpcPolledFdWindows* wrapped_;
};
class GrpcPolledFdFactoryWindows : public GrpcPolledFdFactory {
public:
GrpcPolledFdFactoryWindows(grpc_combiner* combiner)
@ -852,7 +891,7 @@ class GrpcPolledFdFactoryWindows : public GrpcPolledFdFactory {
// Set a flag so that the virtual socket "close" method knows it
// doesn't need to call ShutdownLocked, since now the driver will.
polled_fd->set_gotten_into_driver_list();
return polled_fd;
return grpc_core::New<GrpcPolledFdWindowsWrapper>(polled_fd);
}
void ConfigureAresChannelLocked(ares_channel channel) override {

@ -97,7 +97,7 @@ static callback_state* get_state_for_batch(
/* Intercept a call operation and either push it directly up or translate it
into transport stream operations */
static void con_start_transport_stream_op_batch(
static void connected_channel_start_transport_stream_op_batch(
grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
call_data* calld = static_cast<call_data*>(elem->call_data);
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
@ -137,15 +137,15 @@ static void con_start_transport_stream_op_batch(
GRPC_CALL_COMBINER_STOP(calld->call_combiner, "passed batch to transport");
}
static void con_start_transport_op(grpc_channel_element* elem,
grpc_transport_op* op) {
static void connected_channel_start_transport_op(grpc_channel_element* elem,
grpc_transport_op* op) {
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
grpc_transport_perform_op(chand->transport, op);
}
/* Constructor for call_data */
static grpc_error* init_call_elem(grpc_call_element* elem,
const grpc_call_element_args* args) {
static grpc_error* connected_channel_init_call_elem(
grpc_call_element* elem, const grpc_call_element_args* args) {
call_data* calld = static_cast<call_data*>(elem->call_data);
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
calld->call_combiner = args->call_combiner;
@ -166,9 +166,9 @@ static void set_pollset_or_pollset_set(grpc_call_element* elem,
}
/* Destructor for call_data */
static void destroy_call_elem(grpc_call_element* elem,
const grpc_call_final_info* final_info,
grpc_closure* then_schedule_closure) {
static void connected_channel_destroy_call_elem(
grpc_call_element* elem, const grpc_call_final_info* final_info,
grpc_closure* then_schedule_closure) {
call_data* calld = static_cast<call_data*>(elem->call_data);
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
grpc_transport_destroy_stream(chand->transport,
@ -177,8 +177,8 @@ static void destroy_call_elem(grpc_call_element* elem,
}
/* Constructor for channel_data */
static grpc_error* init_channel_elem(grpc_channel_element* elem,
grpc_channel_element_args* args) {
static grpc_error* connected_channel_init_channel_elem(
grpc_channel_element* elem, grpc_channel_element_args* args) {
channel_data* cd = static_cast<channel_data*>(elem->channel_data);
GPR_ASSERT(args->is_last);
cd->transport = nullptr;
@ -186,7 +186,7 @@ static grpc_error* init_channel_elem(grpc_channel_element* elem,
}
/* Destructor for channel_data */
static void destroy_channel_elem(grpc_channel_element* elem) {
static void connected_channel_destroy_channel_elem(grpc_channel_element* elem) {
channel_data* cd = static_cast<channel_data*>(elem->channel_data);
if (cd->transport) {
grpc_transport_destroy(cd->transport);
@ -194,20 +194,20 @@ static void destroy_channel_elem(grpc_channel_element* elem) {
}
/* No-op. */
static void con_get_channel_info(grpc_channel_element* elem,
const grpc_channel_info* channel_info) {}
static void connected_channel_get_channel_info(
grpc_channel_element* elem, const grpc_channel_info* channel_info) {}
const grpc_channel_filter grpc_connected_filter = {
con_start_transport_stream_op_batch,
con_start_transport_op,
connected_channel_start_transport_stream_op_batch,
connected_channel_start_transport_op,
sizeof(call_data),
init_call_elem,
connected_channel_init_call_elem,
set_pollset_or_pollset_set,
destroy_call_elem,
connected_channel_destroy_call_elem,
sizeof(channel_data),
init_channel_elem,
destroy_channel_elem,
con_get_channel_info,
connected_channel_init_channel_elem,
connected_channel_destroy_channel_elem,
connected_channel_get_channel_info,
"connected",
};

@ -1,117 +0,0 @@
/*
*
* Copyright 2016 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <grpc/support/port_platform.h>
#include "src/core/lib/gpr/mpscq.h"
#include <grpc/support/log.h>
void gpr_mpscq_init(gpr_mpscq* q) {
gpr_atm_no_barrier_store(&q->head, (gpr_atm)&q->stub);
q->tail = &q->stub;
gpr_atm_no_barrier_store(&q->stub.next, (gpr_atm)NULL);
}
void gpr_mpscq_destroy(gpr_mpscq* q) {
GPR_ASSERT(gpr_atm_no_barrier_load(&q->head) == (gpr_atm)&q->stub);
GPR_ASSERT(q->tail == &q->stub);
}
bool gpr_mpscq_push(gpr_mpscq* q, gpr_mpscq_node* n) {
gpr_atm_no_barrier_store(&n->next, (gpr_atm)NULL);
gpr_mpscq_node* prev =
(gpr_mpscq_node*)gpr_atm_full_xchg(&q->head, (gpr_atm)n);
gpr_atm_rel_store(&prev->next, (gpr_atm)n);
return prev == &q->stub;
}
gpr_mpscq_node* gpr_mpscq_pop(gpr_mpscq* q) {
bool empty;
return gpr_mpscq_pop_and_check_end(q, &empty);
}
gpr_mpscq_node* gpr_mpscq_pop_and_check_end(gpr_mpscq* q, bool* empty) {
gpr_mpscq_node* tail = q->tail;
gpr_mpscq_node* next = (gpr_mpscq_node*)gpr_atm_acq_load(&tail->next);
if (tail == &q->stub) {
// indicates the list is actually (ephemerally) empty
if (next == nullptr) {
*empty = true;
return nullptr;
}
q->tail = next;
tail = next;
next = (gpr_mpscq_node*)gpr_atm_acq_load(&tail->next);
}
if (next != nullptr) {
*empty = false;
q->tail = next;
return tail;
}
gpr_mpscq_node* head = (gpr_mpscq_node*)gpr_atm_acq_load(&q->head);
if (tail != head) {
*empty = false;
// indicates a retry is in order: we're still adding
return nullptr;
}
gpr_mpscq_push(q, &q->stub);
next = (gpr_mpscq_node*)gpr_atm_acq_load(&tail->next);
if (next != nullptr) {
*empty = false;
q->tail = next;
return tail;
}
// indicates a retry is in order: we're still adding
*empty = false;
return nullptr;
}
void gpr_locked_mpscq_init(gpr_locked_mpscq* q) {
gpr_mpscq_init(&q->queue);
gpr_mu_init(&q->mu);
}
void gpr_locked_mpscq_destroy(gpr_locked_mpscq* q) {
gpr_mpscq_destroy(&q->queue);
gpr_mu_destroy(&q->mu);
}
bool gpr_locked_mpscq_push(gpr_locked_mpscq* q, gpr_mpscq_node* n) {
return gpr_mpscq_push(&q->queue, n);
}
gpr_mpscq_node* gpr_locked_mpscq_try_pop(gpr_locked_mpscq* q) {
if (gpr_mu_trylock(&q->mu)) {
gpr_mpscq_node* n = gpr_mpscq_pop(&q->queue);
gpr_mu_unlock(&q->mu);
return n;
}
return nullptr;
}
gpr_mpscq_node* gpr_locked_mpscq_pop(gpr_locked_mpscq* q) {
gpr_mu_lock(&q->mu);
bool empty = false;
gpr_mpscq_node* n;
do {
n = gpr_mpscq_pop_and_check_end(&q->queue, &empty);
} while (n == nullptr && !empty);
gpr_mu_unlock(&q->mu);
return n;
}

@ -1,88 +0,0 @@
/*
*
* Copyright 2016 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPC_CORE_LIB_GPR_MPSCQ_H
#define GRPC_CORE_LIB_GPR_MPSCQ_H
#include <grpc/support/port_platform.h>
#include <grpc/support/atm.h>
#include <grpc/support/sync.h>
#include <stdbool.h>
#include <stddef.h>
// Multiple-producer single-consumer lock free queue, based upon the
// implementation from Dmitry Vyukov here:
// http://www.1024cores.net/home/lock-free-algorithms/queues/intrusive-mpsc-node-based-queue
// List node (include this in a data structure at the top, and add application
// fields after it - to simulate inheritance)
typedef struct gpr_mpscq_node {
gpr_atm next;
} gpr_mpscq_node;
// Actual queue type
typedef struct gpr_mpscq {
// make sure head & tail don't share a cacheline
union {
char padding[GPR_CACHELINE_SIZE];
gpr_atm head;
};
gpr_mpscq_node* tail;
gpr_mpscq_node stub;
} gpr_mpscq;
void gpr_mpscq_init(gpr_mpscq* q);
void gpr_mpscq_destroy(gpr_mpscq* q);
// Push a node
// Thread safe - can be called from multiple threads concurrently
// Returns true if this was possibly the first node (may return true
// sporadically, will not return false sporadically)
bool gpr_mpscq_push(gpr_mpscq* q, gpr_mpscq_node* n);
// Pop a node (returns NULL if no node is ready - which doesn't indicate that
// the queue is empty!!)
// Thread compatible - can only be called from one thread at a time
gpr_mpscq_node* gpr_mpscq_pop(gpr_mpscq* q);
// Pop a node; sets *empty to true if the queue is empty, or false if it is not
gpr_mpscq_node* gpr_mpscq_pop_and_check_end(gpr_mpscq* q, bool* empty);
// An mpscq with a lock: it's safe to pop from multiple threads, but doing
// only one thread will succeed concurrently
typedef struct gpr_locked_mpscq {
gpr_mpscq queue;
gpr_mu mu;
} gpr_locked_mpscq;
void gpr_locked_mpscq_init(gpr_locked_mpscq* q);
void gpr_locked_mpscq_destroy(gpr_locked_mpscq* q);
// Push a node
// Thread safe - can be called from multiple threads concurrently
// Returns true if this was possibly the first node (may return true
// sporadically, will not return false sporadically)
bool gpr_locked_mpscq_push(gpr_locked_mpscq* q, gpr_mpscq_node* n);
// Pop a node (returns NULL if no node is ready - which doesn't indicate that
// the queue is empty!!)
// Thread safe - can be called from multiple threads concurrently
gpr_mpscq_node* gpr_locked_mpscq_try_pop(gpr_locked_mpscq* q);
// Pop a node. Returns NULL only if the queue was empty at some point after
// calling this function
gpr_mpscq_node* gpr_locked_mpscq_pop(gpr_locked_mpscq* q);
#endif /* GRPC_CORE_LIB_GPR_MPSCQ_H */

@ -0,0 +1,108 @@
/*
*
* Copyright 2016 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/mpscq.h"
namespace grpc_core {
//
// MultiProducerSingleConsumerQueue
//
bool MultiProducerSingleConsumerQueue::Push(Node* node) {
node->next.Store(nullptr, MemoryOrder::RELAXED);
Node* prev = head_.Exchange(node, MemoryOrder::ACQ_REL);
prev->next.Store(node, MemoryOrder::RELEASE);
return prev == &stub_;
}
MultiProducerSingleConsumerQueue::Node*
MultiProducerSingleConsumerQueue::Pop() {
bool empty;
return PopAndCheckEnd(&empty);
}
MultiProducerSingleConsumerQueue::Node*
MultiProducerSingleConsumerQueue::PopAndCheckEnd(bool* empty) {
Node* tail = tail_;
Node* next = tail_->next.Load(MemoryOrder::ACQUIRE);
if (tail == &stub_) {
// indicates the list is actually (ephemerally) empty
if (next == nullptr) {
*empty = true;
return nullptr;
}
tail_ = next;
tail = next;
next = tail->next.Load(MemoryOrder::ACQUIRE);
}
if (next != nullptr) {
*empty = false;
tail_ = next;
return tail;
}
Node* head = head_.Load(MemoryOrder::ACQUIRE);
if (tail != head) {
*empty = false;
// indicates a retry is in order: we're still adding
return nullptr;
}
Push(&stub_);
next = tail->next.Load(MemoryOrder::ACQUIRE);
if (next != nullptr) {
*empty = false;
tail_ = next;
return tail;
}
// indicates a retry is in order: we're still adding
*empty = false;
return nullptr;
}
//
// LockedMultiProducerSingleConsumerQueue
//
bool LockedMultiProducerSingleConsumerQueue::Push(Node* node) {
return queue_.Push(node);
}
LockedMultiProducerSingleConsumerQueue::Node*
LockedMultiProducerSingleConsumerQueue::TryPop() {
if (gpr_mu_trylock(mu_.get())) {
Node* node = queue_.Pop();
gpr_mu_unlock(mu_.get());
return node;
}
return nullptr;
}
LockedMultiProducerSingleConsumerQueue::Node*
LockedMultiProducerSingleConsumerQueue::Pop() {
MutexLock lock(&mu_);
bool empty = false;
Node* node;
do {
node = queue_.PopAndCheckEnd(&empty);
} while (node == nullptr && !empty);
return node;
}
} // namespace grpc_core

@ -0,0 +1,98 @@
/*
*
* Copyright 2016 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPC_CORE_LIB_GPRPP_MPSCQ_H
#define GRPC_CORE_LIB_GPRPP_MPSCQ_H
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/sync.h"
#include <grpc/support/log.h>
namespace grpc_core {
// Multiple-producer single-consumer lock free queue, based upon the
// implementation from Dmitry Vyukov here:
// http://www.1024cores.net/home/lock-free-algorithms/queues/intrusive-mpsc-node-based-queue
class MultiProducerSingleConsumerQueue {
public:
// List node. Application node types can inherit from this.
struct Node {
Atomic<Node*> next;
};
MultiProducerSingleConsumerQueue() : head_{&stub_}, tail_(&stub_) {}
~MultiProducerSingleConsumerQueue() {
GPR_ASSERT(head_.Load(MemoryOrder::RELAXED) == &stub_);
GPR_ASSERT(tail_ == &stub_);
}
// Push a node
// Thread safe - can be called from multiple threads concurrently
// Returns true if this was possibly the first node (may return true
// sporadically, will not return false sporadically)
bool Push(Node* node);
// Pop a node (returns NULL if no node is ready - which doesn't indicate that
// the queue is empty!!)
// Thread compatible - can only be called from one thread at a time
Node* Pop();
// Pop a node; sets *empty to true if the queue is empty, or false if it is
// not.
Node* PopAndCheckEnd(bool* empty);
private:
// make sure head & tail don't share a cacheline
union {
char padding_[GPR_CACHELINE_SIZE];
Atomic<Node*> head_;
};
Node* tail_;
Node stub_;
};
// An mpscq with a lock: it's safe to pop from multiple threads, but doing
// only one thread will succeed concurrently.
class LockedMultiProducerSingleConsumerQueue {
public:
typedef MultiProducerSingleConsumerQueue::Node Node;
// Push a node
// Thread safe - can be called from multiple threads concurrently
// Returns true if this was possibly the first node (may return true
// sporadically, will not return false sporadically)
bool Push(Node* node);
// Pop a node (returns NULL if no node is ready - which doesn't indicate that
// the queue is empty!!)
// Thread safe - can be called from multiple threads concurrently
Node* TryPop();
// Pop a node. Returns NULL only if the queue was empty at some point after
// calling this function
Node* Pop();
private:
MultiProducerSingleConsumerQueue queue_;
Mutex mu_;
};
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_GPRPP_MPSCQ_H */

@ -48,7 +48,6 @@ gpr_atm EncodeCancelStateError(grpc_error* error) {
CallCombiner::CallCombiner() {
gpr_atm_no_barrier_store(&cancel_state_, 0);
gpr_atm_no_barrier_store(&size_, 0);
gpr_mpscq_init(&queue_);
#ifdef GRPC_TSAN_ENABLED
GRPC_CLOSURE_INIT(&tsan_closure_, TsanClosure, this,
grpc_schedule_on_exec_ctx);
@ -56,7 +55,6 @@ CallCombiner::CallCombiner() {
}
CallCombiner::~CallCombiner() {
gpr_mpscq_destroy(&queue_);
GRPC_ERROR_UNREF(DecodeCancelStateError(cancel_state_));
}
@ -140,7 +138,8 @@ void CallCombiner::Start(grpc_closure* closure, grpc_error* error,
}
// Queue was not empty, so add closure to queue.
closure->error_data.error = error;
gpr_mpscq_push(&queue_, reinterpret_cast<gpr_mpscq_node*>(closure));
queue_.Push(
reinterpret_cast<MultiProducerSingleConsumerQueue::Node*>(closure));
}
}
@ -163,8 +162,8 @@ void CallCombiner::Stop(DEBUG_ARGS const char* reason) {
gpr_log(GPR_INFO, " checking queue");
}
bool empty;
grpc_closure* closure = reinterpret_cast<grpc_closure*>(
gpr_mpscq_pop_and_check_end(&queue_, &empty));
grpc_closure* closure =
reinterpret_cast<grpc_closure*>(queue_.PopAndCheckEnd(&empty));
if (closure == nullptr) {
// This can happen either due to a race condition within the mpscq
// code or because of a race with Start().

@ -25,8 +25,8 @@
#include <grpc/support/atm.h>
#include "src/core/lib/gpr/mpscq.h"
#include "src/core/lib/gprpp/inlined_vector.h"
#include "src/core/lib/gprpp/mpscq.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/closure.h"
@ -108,7 +108,7 @@ class CallCombiner {
#endif
gpr_atm size_ = 0; // size_t, num closures in queue or currently executing
gpr_mpscq queue_;
MultiProducerSingleConsumerQueue queue_;
// Either 0 (if not cancelled and no cancellation closure set),
// a grpc_closure* (if the lowest bit is 0),
// or a grpc_error* (if the lowest bit is 1).

@ -22,10 +22,13 @@
#include <grpc/support/port_platform.h>
#include <assert.h>
#include <stdbool.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <stdbool.h>
#include "src/core/lib/gpr/mpscq.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/mpscq.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/profiling/timers.h"
@ -69,7 +72,9 @@ struct grpc_closure {
* space */
union {
grpc_closure* next;
gpr_mpscq_node atm_next;
grpc_core::ManualConstructor<
grpc_core::MultiProducerSingleConsumerQueue::Node>
mpscq_node;
uintptr_t scratch;
} next_data;

@ -28,6 +28,7 @@
#include <grpc/support/log.h>
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gprpp/mpscq.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/profiling/timers.h"
@ -45,10 +46,10 @@ grpc_core::DebugOnlyTraceFlag grpc_combiner_trace(false, "combiner");
#define STATE_ELEM_COUNT_LOW_BIT 2
struct grpc_combiner {
grpc_combiner* next_combiner_on_this_exec_ctx;
grpc_combiner* next_combiner_on_this_exec_ctx = nullptr;
grpc_closure_scheduler scheduler;
grpc_closure_scheduler finally_scheduler;
gpr_mpscq queue;
grpc_core::MultiProducerSingleConsumerQueue queue;
// either:
// a pointer to the initiating exec ctx if that is the only exec_ctx that has
// ever queued to this combiner, or NULL. If this is non-null, it's not
@ -58,7 +59,7 @@ struct grpc_combiner {
// lower bit - zero if orphaned (STATE_UNORPHANED)
// other bits - number of items queued on the lock (STATE_ELEM_COUNT_LOW_BIT)
gpr_atm state;
bool time_to_execute_final_list;
bool time_to_execute_final_list = false;
grpc_closure_list final_list;
grpc_closure offload;
gpr_refcount refs;
@ -76,12 +77,11 @@ static const grpc_closure_scheduler_vtable finally_scheduler = {
static void offload(void* arg, grpc_error* error);
grpc_combiner* grpc_combiner_create(void) {
grpc_combiner* lock = static_cast<grpc_combiner*>(gpr_zalloc(sizeof(*lock)));
grpc_combiner* lock = grpc_core::New<grpc_combiner>();
gpr_ref_init(&lock->refs, 1);
lock->scheduler.vtable = &scheduler;
lock->finally_scheduler.vtable = &finally_scheduler;
gpr_atm_no_barrier_store(&lock->state, STATE_UNORPHANED);
gpr_mpscq_init(&lock->queue);
grpc_closure_list_init(&lock->final_list);
GRPC_CLOSURE_INIT(
&lock->offload, offload, lock,
@ -93,8 +93,7 @@ grpc_combiner* grpc_combiner_create(void) {
static void really_destroy(grpc_combiner* lock) {
GRPC_COMBINER_TRACE(gpr_log(GPR_INFO, "C:%p really_destroy", lock));
GPR_ASSERT(gpr_atm_no_barrier_load(&lock->state) == 0);
gpr_mpscq_destroy(&lock->queue);
gpr_free(lock);
grpc_core::Delete(lock);
}
static void start_destroy(grpc_combiner* lock) {
@ -185,7 +184,7 @@ static void combiner_exec(grpc_closure* cl, grpc_error* error) {
GPR_ASSERT(last & STATE_UNORPHANED); // ensure lock has not been destroyed
assert(cl->cb);
cl->error_data.error = error;
gpr_mpscq_push(&lock->queue, &cl->next_data.atm_next);
lock->queue.Push(cl->next_data.mpscq_node.get());
}
static void move_next() {
@ -249,7 +248,7 @@ bool grpc_combiner_continue_exec_ctx() {
// peek to see if something new has shown up, and execute that with
// priority
(gpr_atm_acq_load(&lock->state) >> 1) > 1) {
gpr_mpscq_node* n = gpr_mpscq_pop(&lock->queue);
grpc_core::MultiProducerSingleConsumerQueue::Node* n = lock->queue.Pop();
GRPC_COMBINER_TRACE(
gpr_log(GPR_INFO, "C:%p maybe_finish_one n=%p", lock, n));
if (n == nullptr) {

@ -25,7 +25,6 @@
#include <grpc/support/atm.h>
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/mpscq.h"
#include "src/core/lib/iomgr/exec_ctx.h"
// Provides serialized access to some resource.

@ -210,14 +210,14 @@ struct cq_vtable {
namespace {
/* Queue that holds the cq_completion_events. Internally uses gpr_mpscq queue
* (a lockfree multiproducer single consumer queue). It uses a queue_lock
* to support multiple consumers.
/* Queue that holds the cq_completion_events. Internally uses
* MultiProducerSingleConsumerQueue (a lockfree multiproducer single consumer
* queue). It uses a queue_lock to support multiple consumers.
* Only used in completion queues whose completion_type is GRPC_CQ_NEXT */
class CqEventQueue {
public:
CqEventQueue() { gpr_mpscq_init(&queue_); }
~CqEventQueue() { gpr_mpscq_destroy(&queue_); }
CqEventQueue() = default;
~CqEventQueue() = default;
/* Note: The counter is not incremented/decremented atomically with push/pop.
* The count is only eventually consistent */
@ -232,7 +232,7 @@ class CqEventQueue {
/* Spinlock to serialize consumers i.e pop() operations */
gpr_spinlock queue_lock_ = GPR_SPINLOCK_INITIALIZER;
gpr_mpscq queue_;
grpc_core::MultiProducerSingleConsumerQueue queue_;
/* A lazy counter of number of items in the queue. This is NOT atomically
incremented/decremented along with push/pop operations and hence is only
@ -462,7 +462,8 @@ int grpc_completion_queue_thread_local_cache_flush(grpc_completion_queue* cq,
}
bool CqEventQueue::Push(grpc_cq_completion* c) {
gpr_mpscq_push(&queue_, reinterpret_cast<gpr_mpscq_node*>(c));
queue_.Push(
reinterpret_cast<grpc_core::MultiProducerSingleConsumerQueue::Node*>(c));
return num_queue_items_.FetchAdd(1, grpc_core::MemoryOrder::RELAXED) == 0;
}
@ -473,8 +474,7 @@ grpc_cq_completion* CqEventQueue::Pop() {
GRPC_STATS_INC_CQ_EV_QUEUE_TRYLOCK_SUCCESSES();
bool is_empty = false;
c = reinterpret_cast<grpc_cq_completion*>(
gpr_mpscq_pop_and_check_end(&queue_, &is_empty));
c = reinterpret_cast<grpc_cq_completion*>(queue_.PopAndCheckEnd(&is_empty));
gpr_spinlock_unlock(&queue_lock_);
if (c == nullptr && !is_empty) {
@ -1007,8 +1007,9 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
if (cqd->pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) == 0) {
/* Before returning, check if the queue has any items left over (since
gpr_mpscq_pop() can sometimes return NULL even if the queue is not
empty. If so, keep retrying but do not return GRPC_QUEUE_SHUTDOWN */
MultiProducerSingleConsumerQueue::Pop() can sometimes return NULL
even if the queue is not empty. If so, keep retrying but do not
return GRPC_QUEUE_SHUTDOWN */
if (cqd->queue.num_items() > 0) {
/* Go to the beginning of the loop. No point doing a poll because
(cq->shutdown == true) is only possible when there is no pending

@ -24,8 +24,10 @@
#include <grpc/support/port_platform.h>
#include <grpc/grpc.h>
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/abstract.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/iomgr/pollset.h"
/* These trace flags default to 1. The corresponding lines are only traced
@ -36,7 +38,8 @@ extern grpc_core::DebugOnlyTraceFlag grpc_trace_pending_tags;
extern grpc_core::DebugOnlyTraceFlag grpc_trace_cq_refcount;
typedef struct grpc_cq_completion {
gpr_mpscq_node node;
grpc_core::ManualConstructor<grpc_core::MultiProducerSingleConsumerQueue>
node;
/** user supplied tag */
void* tag;

@ -34,9 +34,9 @@
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/mpscq.h"
#include "src/core/lib/gpr/spinlock.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/mpscq.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/slice/slice_internal.h"
@ -50,6 +50,8 @@
grpc_core::TraceFlag grpc_server_channel_trace(false, "server_channel");
using grpc_core::LockedMultiProducerSingleConsumerQueue;
static void server_on_recv_initial_metadata(void* ptr, grpc_error* error);
static void server_recv_trailing_metadata_ready(void* user_data,
grpc_error* error);
@ -70,7 +72,9 @@ enum requested_call_type { BATCH_CALL, REGISTERED_CALL };
struct registered_method;
struct requested_call {
gpr_mpscq_node request_link; /* must be first */
grpc_core::ManualConstructor<
grpc_core::MultiProducerSingleConsumerQueue::Node>
mpscq_node;
requested_call_type type;
size_t cq_idx;
void* tag;
@ -198,7 +202,7 @@ struct request_matcher {
grpc_server* server;
call_data* pending_head;
call_data* pending_tail;
gpr_locked_mpscq* requests_per_cq;
LockedMultiProducerSingleConsumerQueue* requests_per_cq;
};
struct registered_method {
@ -350,17 +354,17 @@ static void channel_broadcaster_shutdown(channel_broadcaster* cb,
static void request_matcher_init(request_matcher* rm, grpc_server* server) {
rm->server = server;
rm->pending_head = rm->pending_tail = nullptr;
rm->requests_per_cq = static_cast<gpr_locked_mpscq*>(
rm->requests_per_cq = static_cast<LockedMultiProducerSingleConsumerQueue*>(
gpr_malloc(sizeof(*rm->requests_per_cq) * server->cq_count));
for (size_t i = 0; i < server->cq_count; i++) {
gpr_locked_mpscq_init(&rm->requests_per_cq[i]);
new (&rm->requests_per_cq[i]) LockedMultiProducerSingleConsumerQueue();
}
}
static void request_matcher_destroy(request_matcher* rm) {
for (size_t i = 0; i < rm->server->cq_count; i++) {
GPR_ASSERT(gpr_locked_mpscq_pop(&rm->requests_per_cq[i]) == nullptr);
gpr_locked_mpscq_destroy(&rm->requests_per_cq[i]);
GPR_ASSERT(rm->requests_per_cq[i].Pop() == nullptr);
rm->requests_per_cq[i].~LockedMultiProducerSingleConsumerQueue();
}
gpr_free(rm->requests_per_cq);
}
@ -389,7 +393,7 @@ static void request_matcher_kill_requests(grpc_server* server,
requested_call* rc;
for (size_t i = 0; i < server->cq_count; i++) {
while ((rc = reinterpret_cast<requested_call*>(
gpr_locked_mpscq_pop(&rm->requests_per_cq[i]))) != nullptr) {
rm->requests_per_cq[i].Pop())) != nullptr) {
fail_call(server, i, rc, GRPC_ERROR_REF(error));
}
}
@ -534,8 +538,8 @@ static void publish_new_rpc(void* arg, grpc_error* error) {
for (size_t i = 0; i < server->cq_count; i++) {
size_t cq_idx = (chand->cq_idx + i) % server->cq_count;
requested_call* rc = reinterpret_cast<requested_call*>(
gpr_locked_mpscq_try_pop(&rm->requests_per_cq[cq_idx]));
requested_call* rc =
reinterpret_cast<requested_call*>(rm->requests_per_cq[cq_idx].TryPop());
if (rc == nullptr) {
continue;
} else {
@ -556,8 +560,8 @@ static void publish_new_rpc(void* arg, grpc_error* error) {
// added to the pending list.
for (size_t i = 0; i < server->cq_count; i++) {
size_t cq_idx = (chand->cq_idx + i) % server->cq_count;
requested_call* rc = reinterpret_cast<requested_call*>(
gpr_locked_mpscq_pop(&rm->requests_per_cq[cq_idx]));
requested_call* rc =
reinterpret_cast<requested_call*>(rm->requests_per_cq[cq_idx].Pop());
if (rc == nullptr) {
continue;
} else {
@ -905,25 +909,25 @@ static void channel_connectivity_changed(void* cd, grpc_error* error) {
}
}
static grpc_error* init_call_elem(grpc_call_element* elem,
const grpc_call_element_args* args) {
static grpc_error* server_init_call_elem(grpc_call_element* elem,
const grpc_call_element_args* args) {
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
server_ref(chand->server);
new (elem->call_data) call_data(elem, *args);
return GRPC_ERROR_NONE;
}
static void destroy_call_elem(grpc_call_element* elem,
const grpc_call_final_info* final_info,
grpc_closure* ignored) {
static void server_destroy_call_elem(grpc_call_element* elem,
const grpc_call_final_info* final_info,
grpc_closure* ignored) {
call_data* calld = static_cast<call_data*>(elem->call_data);
calld->~call_data();
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
server_unref(chand->server);
}
static grpc_error* init_channel_elem(grpc_channel_element* elem,
grpc_channel_element_args* args) {
static grpc_error* server_init_channel_elem(grpc_channel_element* elem,
grpc_channel_element_args* args) {
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
GPR_ASSERT(args->is_first);
GPR_ASSERT(!args->is_last);
@ -938,7 +942,7 @@ static grpc_error* init_channel_elem(grpc_channel_element* elem,
return GRPC_ERROR_NONE;
}
static void destroy_channel_elem(grpc_channel_element* elem) {
static void server_destroy_channel_elem(grpc_channel_element* elem) {
size_t i;
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
if (chand->registered_methods) {
@ -970,12 +974,12 @@ const grpc_channel_filter grpc_server_top_filter = {
server_start_transport_stream_op_batch,
grpc_channel_next_op,
sizeof(call_data),
init_call_elem,
server_init_call_elem,
grpc_call_stack_ignore_set_pollset_or_pollset_set,
destroy_call_elem,
server_destroy_call_elem,
sizeof(channel_data),
init_channel_elem,
destroy_channel_elem,
server_init_channel_elem,
server_destroy_channel_elem,
grpc_channel_next_get_info,
"server",
};
@ -1430,13 +1434,12 @@ static grpc_call_error queue_call_request(grpc_server* server, size_t cq_idx,
rm = &rc->data.registered.method->matcher;
break;
}
if (gpr_locked_mpscq_push(&rm->requests_per_cq[cq_idx], &rc->request_link)) {
if (rm->requests_per_cq[cq_idx].Push(rc->mpscq_node.get())) {
/* this was the first queued request: we need to lock and start
matching calls */
gpr_mu_lock(&server->mu_call);
while ((calld = rm->pending_head) != nullptr) {
rc = reinterpret_cast<requested_call*>(
gpr_locked_mpscq_pop(&rm->requests_per_cq[cq_idx]));
rc = reinterpret_cast<requested_call*>(rm->requests_per_cq[cq_idx].Pop());
if (rc == nullptr) break;
rm->pending_head = calld->pending_next;
gpr_mu_unlock(&server->mu_call);

@ -107,7 +107,12 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.9'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '4.0'
# watchOS is disabled due to #20258.
# TODO (mxyan): Enable watchos when !ProtoCompiler.podspec is updated for
# support of watchos in the next release
# s.watchos.deployment_target = '4.0'
# Restrict the gRPC runtime version to the one supported by this plugin.
s.dependency 'gRPC-ProtoRPC', v
@ -116,6 +121,8 @@ Pod::Spec.new do |s|
# present in this pod's directory. We use that knowledge to check for the existence of the file
# and, if absent, compile the plugin from the local sources.
s.prepare_command = <<-CMD
#{bazel} build //src/compiler:grpc_objective_c_plugin
if [ ! -f #{plugin} ]; then
#{bazel} build //src/compiler:grpc_objective_c_plugin
fi
CMD
end

@ -123,6 +123,11 @@ Pod::Spec.new do |s|
bazel = "#{repo_root}/tools/bazel"
s.prepare_command = <<-CMD
#{bazel} build @com_google_protobuf//:protoc
if [ ! -f bin/protoc ]; then
#{bazel} build @com_google_protobuf//:protoc
else
mv bin/protoc .
mv include/google .
fi
CMD
end

@ -39,7 +39,7 @@
Pod::Spec.new do |s|
s.name = 'BoringSSL-GRPC'
version = '0.0.3'
version = '0.0.4'
s.version = version
s.summary = 'BoringSSL is a fork of OpenSSL that is designed to meet Google\'s needs.'
# Adapted from the homepage:

@ -32,7 +32,6 @@ CORE_SOURCE_FILES = [
'src/core/lib/gpr/log_linux.cc',
'src/core/lib/gpr/log_posix.cc',
'src/core/lib/gpr/log_windows.cc',
'src/core/lib/gpr/mpscq.cc',
'src/core/lib/gpr/murmur_hash.cc',
'src/core/lib/gpr/string.cc',
'src/core/lib/gpr/string_posix.cc',
@ -54,6 +53,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/gprpp/fork.cc',
'src/core/lib/gprpp/global_config_env.cc',
'src/core/lib/gprpp/host_port.cc',
'src/core/lib/gprpp/mpscq.cc',
'src/core/lib/gprpp/thd_posix.cc',
'src/core/lib/gprpp/thd_windows.cc',
'src/core/lib/profiling/basic_timers.cc',

@ -85,6 +85,7 @@
s.source = {
:git => 'https://github.com/grpc/grpc.git',
:tag => "v#{version}",
:submodules => true,
}
# gRPC podspecs depend on fix for https://github.com/CocoaPods/CocoaPods/issues/6024,
@ -171,10 +172,9 @@
ss.header_mappings_dir = '.'
ss.libraries = 'z'
ss.dependency "#{s.name}/Interface", version
ss.dependency 'BoringSSL-GRPC', '0.0.3'
ss.dependency 'BoringSSL-GRPC', '0.0.4'
ss.compiler_flags = '-DGRPC_SHADOW_BORINGSSL_SYMBOLS'
# To save you from scrolling, this is the last part of the podspec.
ss.source_files = ${ruby_multiline_list(grpc_private_files(libs), 22)}
ss.private_header_files = ${ruby_multiline_list(grpc_private_headers(libs), 30)}

@ -34,11 +34,6 @@
:tag => "v#{version}",
}
s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.9'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '4.0'
name = 'GRPCClient'
s.module_name = name
s.header_dir = name
@ -51,25 +46,35 @@
'CLANG_WARN_STRICT_PROTOTYPES' => 'NO',
}
s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.9'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '4.0'
s.subspec 'Interface-Legacy' do |ss|
ss.header_mappings_dir = 'src/objective-c/GRPCClient'
ss.public_header_files = "GRPCClient/GRPCCall+ChannelArg.h",
"GRPCClient/GRPCCall+ChannelCredentials.h",
"GRPCClient/GRPCCall+Cronet.h",
"GRPCClient/GRPCCall+OAuth2.h",
"GRPCClient/GRPCCall+Tests.h",
ss.public_header_files = "src/objective-c/GRPCClient/GRPCCall+ChannelArg.h",
"src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.h",
"src/objective-c/GRPCClient/GRPCCall+Cronet.h",
"src/objective-c/GRPCClient/GRPCCall+OAuth2.h",
"src/objective-c/GRPCClient/GRPCCall+Tests.h",
"src/objective-c/GRPCClient/GRPCCallLegacy.h",
"src/objective-c/GRPCClient/GRPCTypes.h"
ss.source_files = "GRPCClient/GRPCCall+ChannelArg.h",
"GRPCClient/GRPCCall+ChannelCredentials.h",
"GRPCClient/GRPCCall+Cronet.h",
"GRPCClient/GRPCCall+OAuth2.h",
"GRPCClient/GRPCCall+Tests.h",
ss.source_files = "src/objective-c/GRPCClient/GRPCCall+ChannelArg.h",
"src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.h",
"src/objective-c/GRPCClient/GRPCCall+Cronet.h",
"src/objective-c/GRPCClient/GRPCCall+OAuth2.h",
"src/objective-c/GRPCClient/GRPCCall+Tests.h",
"src/objective-c/GRPCClient/GRPCCallLegacy.h",
"src/objective-c/GRPCClient/GRPCTypes.h"
ss.dependency "gRPC-RxLibrary/Interface", version
ss.ios.deployment_target = '7.0'
ss.osx.deployment_target = '10.9'
ss.tvos.deployment_target = '10.0'
ss.watchos.deployment_target = '4.0'
end
s.subspec 'Interface' do |ss|
@ -100,6 +105,11 @@
'src/objective-c/GRPCClient/version.h'
ss.dependency "#{s.name}/Interface-Legacy", version
ss.ios.deployment_target = '7.0'
ss.osx.deployment_target = '10.9'
ss.tvos.deployment_target = '10.0'
ss.watchos.deployment_target = '4.0'
end
s.subspec 'GRPCCore' do |ss|
@ -133,6 +143,11 @@
ss.dependency "#{s.name}/Interface", version
ss.dependency 'gRPC-Core', version
ss.dependency 'gRPC-RxLibrary', version
ss.ios.deployment_target = '7.0'
ss.osx.deployment_target = '10.9'
ss.tvos.deployment_target = '10.0'
ss.watchos.deployment_target = '4.0'
end
s.subspec 'GRPCCoreCronet' do |ss|
@ -144,10 +159,17 @@
ss.dependency "#{s.name}/GRPCCore", version
ss.dependency 'gRPC-Core/Cronet-Implementation', version
ss.dependency 'CronetFramework'
ss.ios.deployment_target = '8.0'
end
# CFStream is now default. Leaving this subspec only for compatibility purpose.
s.subspec 'CFStream' do |ss|
ss.dependency "#{s.name}/GRPCCore", version
ss.ios.deployment_target = '7.0'
ss.osx.deployment_target = '10.9'
ss.tvos.deployment_target = '10.0'
ss.watchos.deployment_target = '4.0'
end
end

@ -109,7 +109,12 @@
s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.9'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '4.0'
# watchOS is disabled due to #20258.
# TODO (mxyan): Enable watchos when !ProtoCompiler.podspec is updated for
# support of watchos in the next release
# s.watchos.deployment_target = '4.0'
# Restrict the gRPC runtime version to the one supported by this plugin.
s.dependency 'gRPC-ProtoRPC', v
@ -118,6 +123,8 @@
# present in this pod's directory. We use that knowledge to check for the existence of the file
# and, if absent, compile the plugin from the local sources.
s.prepare_command = <<-CMD
#{bazel} build //src/compiler:grpc_objective_c_plugin
if [ ! -f #{plugin} ]; then
#{bazel} build //src/compiler:grpc_objective_c_plugin
fi
CMD
end

@ -44,7 +44,7 @@
Pod::Spec.new do |s|
s.name = 'BoringSSL-GRPC'
version = '0.0.3'
version = '0.0.4'
s.version = version
s.summary = 'BoringSSL is a fork of OpenSSL that is designed to meet Google\'s needs.'
# Adapted from the homepage:

@ -380,6 +380,7 @@ def grpc_end2end_tests():
"end2end_tests.h",
],
language = "C++",
visibility = ["//visibility:public"],
deps = [
":cq_verifier",
":ssl_test_data",

@ -68,17 +68,6 @@ grpc_cc_test(
],
)
grpc_cc_test(
name = "mpscq_test",
srcs = ["mpscq_test.cc"],
exec_compatible_with = ["//third_party/toolchains/machine_size:large"],
language = "C++",
deps = [
"//:gpr",
"//test/core/util:grpc_test_util",
],
)
grpc_cc_test(
name = "murmur_hash_test",
srcs = ["murmur_hash_test.cc"],

@ -113,6 +113,17 @@ grpc_cc_test(
],
)
grpc_cc_test(
name = "mpscq_test",
srcs = ["mpscq_test.cc"],
exec_compatible_with = ["//third_party/toolchains/machine_size:large"],
language = "C++",
deps = [
"//:gpr",
"//test/core/util:grpc_test_util",
],
)
grpc_cc_test(
name = "optional_test",
srcs = ["optional_test.cc"],

@ -16,7 +16,7 @@
*
*/
#include "src/core/lib/gpr/mpscq.h"
#include "src/core/lib/gprpp/mpscq.h"
#include <inttypes.h>
#include <stdlib.h>
@ -29,14 +29,16 @@
#include "src/core/lib/gprpp/thd.h"
#include "test/core/util/test_config.h"
using grpc_core::MultiProducerSingleConsumerQueue;
typedef struct test_node {
gpr_mpscq_node node;
MultiProducerSingleConsumerQueue::Node node;
size_t i;
size_t* ctr;
} test_node;
static test_node* new_node(size_t i, size_t* ctr) {
test_node* n = static_cast<test_node*>(gpr_malloc(sizeof(test_node)));
test_node* n = grpc_core::New<test_node>();
n->i = i;
n->ctr = ctr;
return n;
@ -44,13 +46,12 @@ static test_node* new_node(size_t i, size_t* ctr) {
static void test_serial(void) {
gpr_log(GPR_DEBUG, "test_serial");
gpr_mpscq q;
gpr_mpscq_init(&q);
MultiProducerSingleConsumerQueue q;
for (size_t i = 0; i < 10000000; i++) {
gpr_mpscq_push(&q, &new_node(i, nullptr)->node);
q.Push(&new_node(i, nullptr)->node);
}
for (size_t i = 0; i < 10000000; i++) {
test_node* n = reinterpret_cast<test_node*>(gpr_mpscq_pop(&q));
test_node* n = reinterpret_cast<test_node*>(q.Pop());
GPR_ASSERT(n);
GPR_ASSERT(n->i == i);
gpr_free(n);
@ -59,7 +60,7 @@ static void test_serial(void) {
typedef struct {
size_t ctr;
gpr_mpscq* q;
MultiProducerSingleConsumerQueue* q;
gpr_event* start;
} thd_args;
@ -69,7 +70,7 @@ static void test_thread(void* args) {
thd_args* a = static_cast<thd_args*>(args);
gpr_event_wait(a->start, gpr_inf_future(GPR_CLOCK_REALTIME));
for (size_t i = 1; i <= THREAD_ITERATIONS; i++) {
gpr_mpscq_push(a->q, &new_node(i, &a->ctr)->node);
a->q->Push(&new_node(i, &a->ctr)->node);
}
}
@ -79,8 +80,7 @@ static void test_mt(void) {
gpr_event_init(&start);
grpc_core::Thread thds[100];
thd_args ta[GPR_ARRAY_SIZE(thds)];
gpr_mpscq q;
gpr_mpscq_init(&q);
MultiProducerSingleConsumerQueue q;
for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
ta[i].ctr = 0;
ta[i].q = &q;
@ -92,8 +92,8 @@ static void test_mt(void) {
size_t spins = 0;
gpr_event_set(&start, (void*)1);
while (num_done != GPR_ARRAY_SIZE(thds)) {
gpr_mpscq_node* n;
while ((n = gpr_mpscq_pop(&q)) == nullptr) {
MultiProducerSingleConsumerQueue::Node* n;
while ((n = q.Pop()) == nullptr) {
spins++;
}
test_node* tn = reinterpret_cast<test_node*>(n);
@ -106,7 +106,6 @@ static void test_mt(void) {
for (auto& th : thds) {
th.Join();
}
gpr_mpscq_destroy(&q);
}
typedef struct {
@ -115,7 +114,7 @@ typedef struct {
gpr_mu mu;
size_t num_done;
size_t spins;
gpr_mpscq* q;
MultiProducerSingleConsumerQueue* q;
gpr_event* start;
} pull_args;
@ -129,8 +128,8 @@ static void pull_thread(void* arg) {
gpr_mu_unlock(&pa->mu);
return;
}
gpr_mpscq_node* n;
while ((n = gpr_mpscq_pop(pa->q)) == nullptr) {
MultiProducerSingleConsumerQueue::Node* n;
while ((n = pa->q->Pop()) == nullptr) {
pa->spins++;
}
test_node* tn = reinterpret_cast<test_node*>(n);
@ -149,8 +148,7 @@ static void test_mt_multipop(void) {
grpc_core::Thread thds[50];
grpc_core::Thread pull_thds[50];
thd_args ta[GPR_ARRAY_SIZE(thds)];
gpr_mpscq q;
gpr_mpscq_init(&q);
MultiProducerSingleConsumerQueue q;
for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
ta[i].ctr = 0;
ta[i].q = &q;
@ -179,7 +177,6 @@ static void test_mt_multipop(void) {
th.Join();
}
gpr_mu_destroy(&pa.mu);
gpr_mpscq_destroy(&q);
}
int main(int argc, char** argv) {

@ -21,9 +21,6 @@ native.objc_library(
srcs = [
"UnitTesting/GTMGoogleTestRunner.mm",
],
copts = [
"-DGTM_USING_XCTEST",
],
deps = [
"//external:gtest",
],

@ -1091,7 +1091,6 @@ src/core/lib/debug/trace.h \
src/core/lib/gpr/alloc.h \
src/core/lib/gpr/arena.h \
src/core/lib/gpr/env.h \
src/core/lib/gpr/mpscq.h \
src/core/lib/gpr/murmur_hash.h \
src/core/lib/gpr/spinlock.h \
src/core/lib/gpr/string.h \
@ -1117,6 +1116,7 @@ src/core/lib/gprpp/inlined_vector.h \
src/core/lib/gprpp/manual_constructor.h \
src/core/lib/gprpp/map.h \
src/core/lib/gprpp/memory.h \
src/core/lib/gprpp/mpscq.h \
src/core/lib/gprpp/optional.h \
src/core/lib/gprpp/orphanable.h \
src/core/lib/gprpp/pair.h \

@ -1203,8 +1203,6 @@ src/core/lib/gpr/log_android.cc \
src/core/lib/gpr/log_linux.cc \
src/core/lib/gpr/log_posix.cc \
src/core/lib/gpr/log_windows.cc \
src/core/lib/gpr/mpscq.cc \
src/core/lib/gpr/mpscq.h \
src/core/lib/gpr/murmur_hash.cc \
src/core/lib/gpr/murmur_hash.h \
src/core/lib/gpr/spinlock.h \
@ -1252,6 +1250,8 @@ src/core/lib/gprpp/inlined_vector.h \
src/core/lib/gprpp/manual_constructor.h \
src/core/lib/gprpp/map.h \
src/core/lib/gprpp/memory.h \
src/core/lib/gprpp/mpscq.cc \
src/core/lib/gprpp/mpscq.h \
src/core/lib/gprpp/optional.h \
src/core/lib/gprpp/orphanable.h \
src/core/lib/gprpp/pair.h \

@ -955,30 +955,6 @@
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 30,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": false,
"language": "c",
"name": "gpr_mpscq_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
@ -4739,6 +4715,30 @@
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 30,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": false,
"language": "c++",
"name": "gprpp_mpscq_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,

@ -1132,17 +1132,19 @@ class ObjCLanguage(object):
'EXAMPLE_PATH': 'src/objective-c/examples/tvOS-sample',
'FRAMEWORKS': 'NO'
}))
out.append(
self.config.job_spec(
['src/objective-c/tests/build_one_example_bazel.sh'],
timeout_seconds=20 * 60,
shortname='ios-buildtest-example-watchOS-sample',
cpu_cost=1e6,
environ={
'SCHEME': 'watchOS-sample-WatchKit-App',
'EXAMPLE_PATH': 'src/objective-c/examples/watchOS-sample',
'FRAMEWORKS': 'NO'
}))
# Disabled due to #20258
# TODO (mxyan): Reenable this test when #20258 is resolved.
# out.append(
# self.config.job_spec(
# ['src/objective-c/tests/build_one_example_bazel.sh'],
# timeout_seconds=20 * 60,
# shortname='ios-buildtest-example-watchOS-sample',
# cpu_cost=1e6,
# environ={
# 'SCHEME': 'watchOS-sample-WatchKit-App',
# 'EXAMPLE_PATH': 'src/objective-c/examples/watchOS-sample',
# 'FRAMEWORKS': 'NO'
# }))
out.append(
self.config.job_spec(
['src/objective-c/tests/run_plugin_tests.sh'],

Loading…
Cancel
Save