From 90e98c16eae6043d342a16fbf41904b4b8319d2c Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Fri, 16 Mar 2018 15:49:29 -0700 Subject: [PATCH 001/165] Add test result uploading for RBE builds --- .../linux/grpc_bazel_on_foundry_base.sh | 12 +- .../python_utils/upload_rbe_results.py | 162 ++++++++++++++++++ 2 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 tools/run_tests/python_utils/upload_rbe_results.py diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh index a202aafb507..8c2c50c8286 100755 --- a/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh @@ -54,4 +54,14 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/debian8_clang/0.3.0/bazel_0.10.0:toolchain \ --define GRPC_PORT_ISOLATED_RUNTIME=1 \ $1 \ - -- //test/... + -- //test/... || FAILED="true" + +if [ "$UPLOAD_TEST_RESULTS" != "" ] +then + python ./tools/run_tests/python_utils/upload_rbe_results.py +fi + +if [ "$FAILED" != "" ] +then + exit 1 +fi diff --git a/tools/run_tests/python_utils/upload_rbe_results.py b/tools/run_tests/python_utils/upload_rbe_results.py new file mode 100644 index 00000000000..c959b50ac62 --- /dev/null +++ b/tools/run_tests/python_utils/upload_rbe_results.py @@ -0,0 +1,162 @@ +#!/usr/bin/env python +# Copyright 2017 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. +"""Uploads RBE results to BigQuery""" + +import argparse +import os +import json +import sys +import urllib2 +import uuid + +gcp_utils_dir = os.path.abspath( + os.path.join(os.path.dirname(__file__), '../../gcp/utils')) +sys.path.append(gcp_utils_dir) +import big_query_utils + +_DATASET_ID = 'jenkins_test_results' +_DESCRIPTION = 'Test results from master RBE builds on Kokoro' +# 90 days in milliseconds +_EXPIRATION_MS = 90 * 24 * 60 * 60 * 1000 +_PARTITION_TYPE = 'DAY' +_PROJECT_ID = 'grpc-testing' +_RESULTS_SCHEMA = [ + ('job_name', 'STRING', 'Name of Kokoro job'), + ('build_id', 'INTEGER', 'Build ID of Kokoro job'), + ('build_url', 'STRING', 'URL of Kokoro build'), + ('test_target', 'STRING', 'Bazel target path'), + ('result', 'STRING', 'Test or build result'), + ('type', 'STRING', 'Type of Bazel target'), + ('language', 'STRING', 'Language of target'), + ('timestamp', 'TIMESTAMP', 'Timestamp of test run'), + ('size', 'STRING', 'Size of Bazel target'), +] +_TABLE_ID = 'rbe_test_results' + + +def _fill_missing_fields(target): + """Inserts 'N/A' to missing expected fields of Bazel target + + Args: + target: A dictionary of a Bazel target's ResultStore data + """ + if 'type' not in target['targetAttributes']: + target['targetAttributes']['type'] = 'N/A' + if 'language' not in target['targetAttributes']: + target['targetAttributes']['language'] = 'N/A' + if 'testAttributes' not in target: + target['testAttributes'] = {'size': 'N/A'} + return target + + +def _get_api_key(): + """Returns string with API key to access ResultStore. + Intended to be used in Kokoro envrionment.""" + api_key_directory = os.getenv('KOKORO_GFILE_DIR') + api_key_file = os.path.join(api_key_directory, 'resultstore_api_key') + assert os.path.isfile(api_key_file), 'Must add --api_key arg if not on ' \ + 'Kokoro or Kokoro envrionment is not set up properly.' + with open(api_key_file, 'r') as f: + return f.read().replace('\n', '') + + +def _get_invocation_id(): + """Returns String of Bazel invocation ID. Intended to be used in + Kokoro envirionment.""" + bazel_id_directory = os.getenv('KOKORO_ARTIFACTS_DIR') + bazel_id_file = os.path.join(bazel_id_directory, 'bazel_invocation_ids') + assert os.path.isfile(bazel_id_file), 'bazel_invocation_ids file, written ' \ + 'by bazel_wrapper.py, expected but not found.' + with open(bazel_id_file, 'r') as f: + return f.read().replace('\n', '') + + +def _upload_results_to_bq(rows): + """Upload test results to a BQ table. + + Args: + rows: A list of dictionaries containing data for each row to insert + """ + bq = big_query_utils.create_big_query() + big_query_utils.create_partitioned_table( + bq, + _PROJECT_ID, + _DATASET_ID, + _TABLE_ID, + _RESULTS_SCHEMA, + _DESCRIPTION, + partition_type=_PARTITION_TYPE, + expiration_ms=_EXPIRATION_MS) + + max_retries = 3 + for attempt in range(max_retries): + if big_query_utils.insert_rows(bq, _PROJECT_ID, _DATASET_ID, _TABLE_ID, + rows): + break + else: + if attempt < max_retries - 1: + print('Error uploading result to bigquery, will retry.') + else: + print( + 'Error uploading result to bigquery, all attempts failed.') + sys.exit(1) + + +if __name__ == "__main__": + # Arguments are necessary if running in a non-Kokoro envrionment. + argp = argparse.ArgumentParser(description='Upload RBE results.') + argp.add_argument('--api_key', default='', type=str) + argp.add_argument('--invocation_id', default='', type=str) + args = argp.parse_args() + + api_key = args.api_key or _get_api_key() + invocation_id = args.invocation_id or _get_invocation_id() + + req = urllib2.Request( + url='https://resultstore.googleapis.com/v2/invocations/%s/targets?key=%s' + % (invocation_id, api_key), + headers={ + 'Content-Type': 'application/json' + }) + + results = json.loads(urllib2.urlopen(req).read()) + bq_rows = [] + for target in map(_fill_missing_fields, results['targets']): + bq_rows.append({ + 'insertId': str(uuid.uuid4()), + 'json': { + 'build_id': + os.getenv('KOKORO_BUILD_NUMBER'), + 'build_url': + 'https://sponge.corp.google.com/invocation?id=%s' % + os.getenv('KOKORO_BUILD_ID'), + 'job_name': + os.getenv('KOKORO_JOB_NAME'), + 'test_target': + target['id']['targetId'], + 'result': + target['statusAttributes']['status'], + 'type': + target['targetAttributes']['type'], + 'language': + target['targetAttributes']['language'], + 'timestamp': + target['timing']['startTime'], + 'size': + target['testAttributes']['size'] + } + }) + + _upload_results_to_bq(bq_rows) From d536dba4d3234ba28066a31f7a092ce9daa89ec4 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 30 Mar 2018 13:18:08 -0700 Subject: [PATCH 002/165] Work-around for ref-counted subclass deletion address problem. --- src/core/ext/filters/client_channel/lb_policy.h | 4 ++++ .../ext/filters/client_channel/lb_policy/grpclb/grpclb.cc | 4 ++++ src/core/ext/filters/client_channel/method_params.h | 4 ++++ src/core/ext/filters/client_channel/resolver.h | 4 ++++ src/core/ext/filters/client_channel/retry_throttle.h | 4 ++++ src/core/lib/gprpp/orphanable.h | 4 ++-- src/core/lib/gprpp/ref_counted.h | 4 ++-- src/core/lib/slice/slice_hash_table.h | 4 ++++ src/core/tsi/ssl/session_cache/ssl_session_cache.h | 4 ++++ 9 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h index c3e43e5ef65..454e00a6907 100644 --- a/src/core/ext/filters/client_channel/lb_policy.h +++ b/src/core/ext/filters/client_channel/lb_policy.h @@ -162,6 +162,10 @@ class LoadBalancingPolicy GRPC_ABSTRACT_BASE_CLASS protected: + // So Delete() can access our protected dtor. + template + friend void Delete(T*); + explicit LoadBalancingPolicy(const Args& args); virtual ~LoadBalancingPolicy(); diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 0b2a30818e2..097ff112f9a 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -189,6 +189,10 @@ class GrpcLb : public LoadBalancingPolicy { bool seen_initial_response() const { return seen_initial_response_; } private: + // So Delete() can access our private dtor. + template + friend void grpc_core::Delete(T*); + ~BalancerCallState(); GrpcLb* grpclb_policy() const { diff --git a/src/core/ext/filters/client_channel/method_params.h b/src/core/ext/filters/client_channel/method_params.h index 099924edf36..a31d360f172 100644 --- a/src/core/ext/filters/client_channel/method_params.h +++ b/src/core/ext/filters/client_channel/method_params.h @@ -60,6 +60,10 @@ class ClientChannelMethodParams : public RefCounted { template friend T* grpc_core::New(Args&&... args); + // So Delete() can call our private dtor. + template + friend void grpc_core::Delete(T*); + ClientChannelMethodParams() {} virtual ~ClientChannelMethodParams() {} diff --git a/src/core/ext/filters/client_channel/resolver.h b/src/core/ext/filters/client_channel/resolver.h index cdb5a20ea31..02380314dd9 100644 --- a/src/core/ext/filters/client_channel/resolver.h +++ b/src/core/ext/filters/client_channel/resolver.h @@ -105,6 +105,10 @@ class Resolver : public InternallyRefCountedWithTracing { GRPC_ABSTRACT_BASE_CLASS protected: + // So Delete() can access our protected dtor. + template + friend void Delete(T*); + /// Does NOT take ownership of the reference to \a combiner. // TODO(roth): Once we have a C++-like interface for combiners, this // API should change to take a RefCountedPtr<>, so that we always take diff --git a/src/core/ext/filters/client_channel/retry_throttle.h b/src/core/ext/filters/client_channel/retry_throttle.h index 2b6fa0a70b1..fddafcd903e 100644 --- a/src/core/ext/filters/client_channel/retry_throttle.h +++ b/src/core/ext/filters/client_channel/retry_throttle.h @@ -42,6 +42,10 @@ class ServerRetryThrottleData : public RefCounted { intptr_t milli_token_ratio() const { return milli_token_ratio_; } private: + // So Delete() can call our private dtor. + template + friend void grpc_core::Delete(T*); + ~ServerRetryThrottleData(); void GetReplacementThrottleDataIfNeeded( diff --git a/src/core/lib/gprpp/orphanable.h b/src/core/lib/gprpp/orphanable.h index a5bc8d8efc9..b50f8c247ca 100644 --- a/src/core/lib/gprpp/orphanable.h +++ b/src/core/lib/gprpp/orphanable.h @@ -100,7 +100,7 @@ class InternallyRefCounted : public Orphanable { void Unref() { if (gpr_unref(&refs_)) { - Delete(this); + Delete(static_cast(this)); } } @@ -173,7 +173,7 @@ class InternallyRefCountedWithTracing : public Orphanable { void Unref() { if (gpr_unref(&refs_)) { - Delete(this); + Delete(static_cast(this)); } } diff --git a/src/core/lib/gprpp/ref_counted.h b/src/core/lib/gprpp/ref_counted.h index 46bfaf7fb8c..bd6874f3db5 100644 --- a/src/core/lib/gprpp/ref_counted.h +++ b/src/core/lib/gprpp/ref_counted.h @@ -54,7 +54,7 @@ class RefCounted { // friend of this class. void Unref() { if (gpr_unref(&refs_)) { - Delete(this); + Delete(static_cast(this)); } } @@ -114,7 +114,7 @@ class RefCountedWithTracing { void Unref() { if (gpr_unref(&refs_)) { - Delete(this); + Delete(static_cast(this)); } } diff --git a/src/core/lib/slice/slice_hash_table.h b/src/core/lib/slice/slice_hash_table.h index fbe9cc58e87..4bbcf88e895 100644 --- a/src/core/lib/slice/slice_hash_table.h +++ b/src/core/lib/slice/slice_hash_table.h @@ -81,6 +81,10 @@ class SliceHashTable : public RefCounted> { template friend T2* New(Args&&... args); + // So Delete() can call our private dtor. + template + friend void Delete(T2*); + SliceHashTable(size_t num_entries, Entry* entries, ValueCmp value_cmp); virtual ~SliceHashTable(); diff --git a/src/core/tsi/ssl/session_cache/ssl_session_cache.h b/src/core/tsi/ssl/session_cache/ssl_session_cache.h index 488638c9bb2..a90cca1a2ea 100644 --- a/src/core/tsi/ssl/session_cache/ssl_session_cache.h +++ b/src/core/tsi/ssl/session_cache/ssl_session_cache.h @@ -69,6 +69,10 @@ class SslSessionLRUCache : public grpc_core::RefCounted { template friend T* grpc_core::New(Args&&... args); + // So Delete() can call our private dtor. + template + friend void grpc_core::Delete(T*); + class Node; explicit SslSessionLRUCache(size_t capacity); From 7c1b5db3bb000a7c69d9d8151c66fecbacce64c3 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 30 Mar 2018 13:28:56 -0700 Subject: [PATCH 003/165] Convert subchannel_list code to C++. --- BUILD | 3 - CMakeLists.txt | 3 - Makefile | 3 - build.yaml | 2 - config.m4 | 2 - config.w32 | 1 - gRPC-Core.podspec | 2 - grpc.gemspec | 1 - grpc.gyp | 2 - package.xml | 1 - .../filters/client_channel/client_channel.cc | 27 +- .../lb_policy/pick_first/pick_first.cc | 322 ++++++------ .../lb_policy/round_robin/round_robin.cc | 428 +++++++++------- .../lb_policy/subchannel_list.cc | 253 ---------- .../lb_policy/subchannel_list.h | 468 ++++++++++++++---- src/core/lib/gprpp/inlined_vector.h | 64 ++- src/python/grpcio/grpc_core_dependencies.py | 1 - test/core/gprpp/inlined_vector_test.cc | 1 + tools/doxygen/Doxyfile.core.internal | 1 - .../generated/sources_and_headers.json | 1 - 20 files changed, 822 insertions(+), 764 deletions(-) delete mode 100644 src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc diff --git a/BUILD b/BUILD index e1c5f7663ae..f3cdfae0e46 100644 --- a/BUILD +++ b/BUILD @@ -1237,9 +1237,6 @@ grpc_cc_library( grpc_cc_library( name = "grpc_lb_subchannel_list", - srcs = [ - "src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc", - ], hdrs = [ "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h", ], diff --git a/CMakeLists.txt b/CMakeLists.txt index c0c47c9d520..d194e440c0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1193,7 +1193,6 @@ add_library(grpc src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc - src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc @@ -1474,7 +1473,6 @@ add_library(grpc_cronet src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_index.cc src/core/ext/filters/client_channel/uri_parser.cc - src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc src/core/ext/filters/max_age/max_age_filter.cc src/core/ext/filters/message_size/message_size_filter.cc src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc @@ -2518,7 +2516,6 @@ add_library(grpc_unsecure third_party/nanopb/pb_decode.c third_party/nanopb/pb_encode.c src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc - src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc src/core/ext/census/grpc_context.cc src/core/ext/filters/max_age/max_age_filter.cc diff --git a/Makefile b/Makefile index 94954a6fc3a..007314c6c5c 100644 --- a/Makefile +++ b/Makefile @@ -3543,7 +3543,6 @@ LIBGRPC_SRC = \ src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ - src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc \ @@ -3824,7 +3823,6 @@ LIBGRPC_CRONET_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_index.cc \ src/core/ext/filters/client_channel/uri_parser.cc \ - src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc \ src/core/ext/filters/max_age/max_age_filter.cc \ src/core/ext/filters/message_size/message_size_filter.cc \ src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \ @@ -4838,7 +4836,6 @@ LIBGRPC_UNSECURE_SRC = \ third_party/nanopb/pb_decode.c \ third_party/nanopb/pb_encode.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ - src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/census/grpc_context.cc \ src/core/ext/filters/max_age/max_age_filter.cc \ diff --git a/build.yaml b/build.yaml index 000169a4d97..5b531b01778 100644 --- a/build.yaml +++ b/build.yaml @@ -683,8 +683,6 @@ filegroups: - name: grpc_lb_subchannel_list headers: - src/core/ext/filters/client_channel/lb_policy/subchannel_list.h - src: - - src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc uses: - grpc_base - grpc_client_channel diff --git a/config.m4 b/config.m4 index 0dc4825191b..df06259606a 100644 --- a/config.m4 +++ b/config.m4 @@ -369,7 +369,6 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ - src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc \ @@ -650,7 +649,6 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/boringssl) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/pick_first) diff --git a/config.w32 b/config.w32 index bb9cb3ffe2a..2c6516fe3a9 100644 --- a/config.w32 +++ b/config.w32 @@ -345,7 +345,6 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\load_balancer.pb.c " + "src\\core\\ext\\filters\\client_channel\\resolver\\fake\\fake_resolver.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first\\pick_first.cc " + - "src\\core\\ext\\filters\\client_channel\\lb_policy\\subchannel_list.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin\\round_robin.cc " + "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\dns_resolver_ares.cc " + "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_ev_driver_posix.cc " + diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 9ddee79ff99..20fc79fcb1e 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -783,7 +783,6 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', - 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc', @@ -1641,7 +1640,6 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_index.cc', 'src/core/ext/filters/client_channel/uri_parser.cc', - 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc', 'src/core/ext/filters/max_age/max_age_filter.cc', 'src/core/ext/filters/message_size/message_size_filter.cc', 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc', diff --git a/grpc.gemspec b/grpc.gemspec index 4e309f15a98..16810335292 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -722,7 +722,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c ) s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc ) - s.files += %w( src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc ) diff --git a/grpc.gyp b/grpc.gyp index 30664695b3f..00effc2be01 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -529,7 +529,6 @@ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', - 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc', @@ -1258,7 +1257,6 @@ 'third_party/nanopb/pb_decode.c', 'third_party/nanopb/pb_encode.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', - 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/census/grpc_context.cc', 'src/core/ext/filters/max_age/max_age_filter.cc', diff --git a/package.xml b/package.xml index fd430068363..7213d1645f8 100644 --- a/package.xml +++ b/package.xml @@ -729,7 +729,6 @@ - diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index 51f9ae000a3..a10bfea8b19 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -924,7 +924,9 @@ typedef struct client_channel_call_data { // Note: We inline the cache for the first 3 send_message ops and use // dynamic allocation after that. This number was essentially picked // at random; it could be changed in the future to tune performance. - grpc_core::InlinedVector send_messages; + grpc_core::ManualConstructor< + grpc_core::InlinedVector> + send_messages; // send_trailing_metadata bool seen_send_trailing_metadata; grpc_linked_mdelem* send_trailing_metadata_storage; @@ -974,7 +976,7 @@ static void maybe_cache_send_ops_for_batch(call_data* calld, gpr_arena_alloc(calld->arena, sizeof(grpc_core::ByteStreamCache))); new (cache) grpc_core::ByteStreamCache( std::move(batch->payload->send_message.send_message)); - calld->send_messages.push_back(cache); + calld->send_messages->push_back(cache); } // Save metadata batch for send_trailing_metadata ops. if (batch->send_trailing_metadata) { @@ -1008,7 +1010,7 @@ static void free_cached_send_op_data_after_commit( "]", chand, calld, i); } - calld->send_messages[i]->Destroy(); + (*calld->send_messages)[i]->Destroy(); } if (retry_state->completed_send_trailing_metadata) { grpc_metadata_batch_destroy(&calld->send_trailing_metadata); @@ -1032,7 +1034,7 @@ static void free_cached_send_op_data_for_completed_batch( "]", chand, calld, retry_state->completed_send_message_count - 1); } - calld->send_messages[retry_state->completed_send_message_count - 1] + (*calld->send_messages)[retry_state->completed_send_message_count - 1] ->Destroy(); } if (batch_data->batch.send_trailing_metadata) { @@ -1280,7 +1282,8 @@ static bool pending_batch_is_completed( return false; } if (pending->batch->send_message && - retry_state->completed_send_message_count < calld->send_messages.size()) { + retry_state->completed_send_message_count < + calld->send_messages->size()) { return false; } if (pending->batch->send_trailing_metadata && @@ -1315,7 +1318,7 @@ static bool pending_batch_is_unstarted( return true; } if (pending->batch->send_message && - retry_state->started_send_message_count < calld->send_messages.size()) { + retry_state->started_send_message_count < calld->send_messages->size()) { return true; } if (pending->batch->send_trailing_metadata && @@ -1817,7 +1820,7 @@ static void add_closures_for_replay_or_pending_send_ops( channel_data* chand = static_cast(elem->channel_data); call_data* calld = static_cast(elem->call_data); bool have_pending_send_message_ops = - retry_state->started_send_message_count < calld->send_messages.size(); + retry_state->started_send_message_count < calld->send_messages->size(); bool have_pending_send_trailing_metadata_op = calld->seen_send_trailing_metadata && !retry_state->started_send_trailing_metadata; @@ -2133,7 +2136,7 @@ static void add_retriable_send_message_op( chand, calld, retry_state->started_send_message_count); } grpc_core::ByteStreamCache* cache = - calld->send_messages[retry_state->started_send_message_count]; + (*calld->send_messages)[retry_state->started_send_message_count]; ++retry_state->started_send_message_count; batch_data->send_message.Init(cache); batch_data->batch.send_message = true; @@ -2254,7 +2257,7 @@ static subchannel_batch_data* maybe_create_subchannel_batch_for_replay( } // send_message. // Note that we can only have one send_message op in flight at a time. - if (retry_state->started_send_message_count < calld->send_messages.size() && + if (retry_state->started_send_message_count < calld->send_messages->size() && retry_state->started_send_message_count == retry_state->completed_send_message_count && !calld->pending_send_message) { @@ -2274,7 +2277,7 @@ static subchannel_batch_data* maybe_create_subchannel_batch_for_replay( // to start, since we can't send down any more send_message ops after // send_trailing_metadata. if (calld->seen_send_trailing_metadata && - retry_state->started_send_message_count == calld->send_messages.size() && + retry_state->started_send_message_count == calld->send_messages->size() && !retry_state->started_send_trailing_metadata && !calld->pending_send_trailing_metadata) { if (grpc_client_channel_trace.enabled()) { @@ -2325,7 +2328,7 @@ static void add_subchannel_batches_for_pending_batches( // send_message ops after send_trailing_metadata. if (batch->send_trailing_metadata && (retry_state->started_send_message_count + batch->send_message < - calld->send_messages.size() || + calld->send_messages->size() || retry_state->started_send_trailing_metadata)) { continue; } @@ -2976,6 +2979,7 @@ static grpc_error* cc_init_call_elem(grpc_call_element* elem, calld->deadline); } calld->enable_retries = chand->enable_retries; + calld->send_messages.Init(); return GRPC_ERROR_NONE; } @@ -3011,6 +3015,7 @@ static void cc_destroy_call_elem(grpc_call_element* elem, calld->pick.subchannel_call_context[i].value); } } + calld->send_messages.Destroy(); GRPC_CLOSURE_SCHED(then_schedule_closure, GRPC_ERROR_NONE); } diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 9090c344123..b593f93d7b9 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -62,31 +62,57 @@ class PickFirst : public LoadBalancingPolicy { private: ~PickFirst(); + class PickFirstSubchannelList; + + class PickFirstSubchannelData + : public SubchannelData { + public: + PickFirstSubchannelData(PickFirstSubchannelList* subchannel_list, + const grpc_lb_user_data_vtable* user_data_vtable, + const grpc_lb_address& address, + grpc_subchannel* subchannel, + grpc_combiner* combiner) + : SubchannelData(subchannel_list, user_data_vtable, address, + subchannel, combiner) {} + + void ProcessConnectivityChangeLocked(grpc_error* error) override; + }; + + class PickFirstSubchannelList + : public SubchannelList { + public: + PickFirstSubchannelList( + PickFirst* policy, TraceFlag* tracer, + const grpc_lb_addresses* addresses, grpc_combiner* combiner, + grpc_client_channel_factory* client_channel_factory, + const grpc_channel_args& args) + : SubchannelList(policy, tracer, addresses, combiner, + client_channel_factory, args) {} + + void RefForConnectivityWatch(const char* reason); + void UnrefForConnectivityWatch(const char* reason); + }; + void ShutdownLocked() override; void StartPickingLocked(); void DestroyUnselectedSubchannelsLocked(); - static void OnConnectivityChangedLocked(void* arg, grpc_error* error); - - void SubchannelListRefForConnectivityWatch( - grpc_lb_subchannel_list* subchannel_list, const char* reason); - void SubchannelListUnrefForConnectivityWatch( - grpc_lb_subchannel_list* subchannel_list, const char* reason); - - /** all our subchannels */ - grpc_lb_subchannel_list* subchannel_list_ = nullptr; - /** latest pending subchannel list */ - grpc_lb_subchannel_list* latest_pending_subchannel_list_ = nullptr; - /** selected subchannel in \a subchannel_list */ - grpc_lb_subchannel_data* selected_ = nullptr; - /** have we started picking? */ + // All our subchannels. + RefCountedPtr subchannel_list_; + // Latest pending subchannel list. + RefCountedPtr latest_pending_subchannel_list_; + // Selected subchannel in \a subchannel_list_. + PickFirstSubchannelData* selected_ = nullptr; + // Have we started picking? bool started_picking_ = false; - /** are we shut down? */ + // Are we shut down? bool shutdown_ = false; - /** list of picks that are waiting on connectivity */ + // List of picks that are waiting on connectivity. PickState* pending_picks_ = nullptr; - /** our connectivity state tracker */ + // Our connectivity state tracker. grpc_connectivity_state_tracker state_tracker_; }; @@ -138,13 +164,12 @@ void PickFirst::ShutdownLocked() { grpc_connectivity_state_set(&state_tracker_, GRPC_CHANNEL_SHUTDOWN, GRPC_ERROR_REF(error), "shutdown"); if (subchannel_list_ != nullptr) { - grpc_lb_subchannel_list_shutdown_and_unref(subchannel_list_, "pf_shutdown"); - subchannel_list_ = nullptr; + subchannel_list_->ShutdownLocked("pf_shutdown"); + subchannel_list_.reset(); } if (latest_pending_subchannel_list_ != nullptr) { - grpc_lb_subchannel_list_shutdown_and_unref(latest_pending_subchannel_list_, - "pf_shutdown"); - latest_pending_subchannel_list_ = nullptr; + latest_pending_subchannel_list_->ShutdownLocked("pf_shutdown"); + latest_pending_subchannel_list_.reset(); } TryReresolutionLocked(&grpc_lb_pick_first_trace, GRPC_ERROR_CANCELLED); GRPC_ERROR_UNREF(error); @@ -192,14 +217,12 @@ void PickFirst::CancelMatchingPicksLocked(uint32_t initial_metadata_flags_mask, void PickFirst::StartPickingLocked() { started_picking_ = true; - if (subchannel_list_ != nullptr && subchannel_list_->num_subchannels > 0) { - subchannel_list_->checking_subchannel = 0; - for (size_t i = 0; i < subchannel_list_->num_subchannels; ++i) { - if (subchannel_list_->subchannels[i].subchannel != nullptr) { - SubchannelListRefForConnectivityWatch( - subchannel_list_, "connectivity_watch+start_picking"); - grpc_lb_subchannel_data_start_connectivity_watch( - &subchannel_list_->subchannels[i]); + if (subchannel_list_ != nullptr) { + for (size_t i = 0; i < subchannel_list_->num_subchannels(); ++i) { + if (subchannel_list_->subchannel(i)->subchannel() != nullptr) { + subchannel_list_->RefForConnectivityWatch( + "connectivity_watch+start_picking"); + subchannel_list_->subchannel(i)->StartConnectivityWatchLocked(); break; } } @@ -215,7 +238,7 @@ void PickFirst::ExitIdleLocked() { bool PickFirst::PickLocked(PickState* pick) { // If we have a selected subchannel already, return synchronously. if (selected_ != nullptr) { - pick->connected_subchannel = selected_->connected_subchannel; + pick->connected_subchannel = selected_->connected_subchannel()->Ref(); return true; } // No subchannel selected yet, so handle asynchronously. @@ -228,11 +251,10 @@ bool PickFirst::PickLocked(PickState* pick) { } void PickFirst::DestroyUnselectedSubchannelsLocked() { - for (size_t i = 0; i < subchannel_list_->num_subchannels; ++i) { - grpc_lb_subchannel_data* sd = &subchannel_list_->subchannels[i]; + for (size_t i = 0; i < subchannel_list_->num_subchannels(); ++i) { + PickFirstSubchannelData* sd = subchannel_list_->subchannel(i); if (selected_ != sd) { - grpc_lb_subchannel_data_unref_subchannel(sd, - "selected_different_subchannel"); + sd->UnrefSubchannelLocked("selected_different_subchannel"); } } } @@ -249,7 +271,7 @@ void PickFirst::NotifyOnStateChangeLocked(grpc_connectivity_state* current, void PickFirst::PingOneLocked(grpc_closure* on_initiate, grpc_closure* on_ack) { if (selected_ != nullptr) { - selected_->connected_subchannel->Ping(on_initiate, on_ack); + selected_->connected_subchannel()->Ping(on_initiate, on_ack); } else { GRPC_CLOSURE_SCHED(on_initiate, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Not connected")); @@ -258,24 +280,6 @@ void PickFirst::PingOneLocked(grpc_closure* on_initiate, grpc_closure* on_ack) { } } -void PickFirst::SubchannelListRefForConnectivityWatch( - grpc_lb_subchannel_list* subchannel_list, const char* reason) { - // TODO(roth): We currently track this ref manually. Once the new - // ClosureRef API is ready and the subchannel_list code has been - // converted to a C++ API, find a way to hold the RefCountedPtr<> - // somewhere (maybe in the subchannel_data object) instead of doing - // this manually. - auto self = Ref(DEBUG_LOCATION, reason); - self.release(); - grpc_lb_subchannel_list_ref(subchannel_list, reason); -} - -void PickFirst::SubchannelListUnrefForConnectivityWatch( - grpc_lb_subchannel_list* subchannel_list, const char* reason) { - Unref(DEBUG_LOCATION, reason); - grpc_lb_subchannel_list_unref(subchannel_list, reason); -} - void PickFirst::UpdateLocked(const grpc_channel_args& args) { const grpc_arg* arg = grpc_channel_args_find(&args, GRPC_ARG_LB_ADDRESSES); if (arg == nullptr || arg->type != GRPC_ARG_POINTER) { @@ -301,10 +305,10 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { "Pick First %p received update with %" PRIuPTR " addresses", this, addresses->num_addresses); } - grpc_lb_subchannel_list* subchannel_list = grpc_lb_subchannel_list_create( + auto subchannel_list = MakeRefCounted( this, &grpc_lb_pick_first_trace, addresses, combiner(), - client_channel_factory(), args, &PickFirst::OnConnectivityChangedLocked); - if (subchannel_list->num_subchannels == 0) { + client_channel_factory(), args); + if (subchannel_list->num_subchannels() == 0) { // Empty update or no valid subchannels. Unsubscribe from all current // subchannels and put the channel in TRANSIENT_FAILURE. grpc_connectivity_state_set( @@ -312,10 +316,9 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"), "pf_update_empty"); if (subchannel_list_ != nullptr) { - grpc_lb_subchannel_list_shutdown_and_unref(subchannel_list_, - "sl_shutdown_empty_update"); + subchannel_list_->ShutdownLocked("sl_shutdown_empty_update"); } - subchannel_list_ = subchannel_list; // Empty list. + subchannel_list_ = std::move(subchannel_list); // Empty list. selected_ = nullptr; return; } @@ -323,45 +326,48 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { // We don't yet have a selected subchannel, so replace the current // subchannel list immediately. if (subchannel_list_ != nullptr) { - grpc_lb_subchannel_list_shutdown_and_unref(subchannel_list_, - "pf_update_before_selected"); + subchannel_list_->ShutdownLocked("pf_update_before_selected"); + } + subchannel_list_ = std::move(subchannel_list); + // If we've started picking, start trying to connect to the first + // subchannel in the new list. + if (started_picking_) { + subchannel_list_->RefForConnectivityWatch("connectivity_watch+update"); + subchannel_list_->subchannel(0)->StartConnectivityWatchLocked(); } - subchannel_list_ = subchannel_list; } else { // We do have a selected subchannel. // Check if it's present in the new list. If so, we're done. - for (size_t i = 0; i < subchannel_list->num_subchannels; ++i) { - grpc_lb_subchannel_data* sd = &subchannel_list->subchannels[i]; - if (sd->subchannel == selected_->subchannel) { + for (size_t i = 0; i < subchannel_list->num_subchannels(); ++i) { + PickFirstSubchannelData* sd = subchannel_list->subchannel(i); + if (sd->subchannel() == selected_->subchannel()) { // The currently selected subchannel is in the update: we are done. if (grpc_lb_pick_first_trace.enabled()) { gpr_log(GPR_INFO, "Pick First %p found already selected subchannel %p " "at update index %" PRIuPTR " of %" PRIuPTR "; update done", - this, selected_->subchannel, i, - subchannel_list->num_subchannels); + this, selected_->subchannel(), i, + subchannel_list->num_subchannels()); } - if (selected_->connected_subchannel != nullptr) { - sd->connected_subchannel = selected_->connected_subchannel; + if (selected_->connected_subchannel() != nullptr) { + sd->SetConnectedSubchannelFromLocked(selected_); } selected_ = sd; if (subchannel_list_ != nullptr) { - grpc_lb_subchannel_list_shutdown_and_unref( - subchannel_list_, "pf_update_includes_selected"); + subchannel_list_->ShutdownLocked("pf_update_includes_selected"); } - subchannel_list_ = subchannel_list; + subchannel_list_ = std::move(subchannel_list); DestroyUnselectedSubchannelsLocked(); - SubchannelListRefForConnectivityWatch( - subchannel_list, "connectivity_watch+replace_selected"); - grpc_lb_subchannel_data_start_connectivity_watch(sd); + subchannel_list_->RefForConnectivityWatch( + "connectivity_watch+replace_selected"); + sd->StartConnectivityWatchLocked(); // If there was a previously pending update (which may or may // not have contained the currently selected subchannel), drop // it, so that it doesn't override what we've done here. if (latest_pending_subchannel_list_ != nullptr) { - grpc_lb_subchannel_list_shutdown_and_unref( - latest_pending_subchannel_list_, + latest_pending_subchannel_list_->ShutdownLocked( "pf_update_includes_selected+outdated"); - latest_pending_subchannel_list_ = nullptr; + latest_pending_subchannel_list_.reset(); } return; } @@ -375,74 +381,89 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { gpr_log(GPR_DEBUG, "Pick First %p Shutting down latest pending subchannel list " "%p, about to be replaced by newer latest %p", - this, latest_pending_subchannel_list_, subchannel_list); + this, latest_pending_subchannel_list_.get(), + subchannel_list.get()); } - grpc_lb_subchannel_list_shutdown_and_unref( - latest_pending_subchannel_list_, "sl_outdated_dont_smash"); + latest_pending_subchannel_list_->ShutdownLocked("sl_outdated_dont_smash"); + } + latest_pending_subchannel_list_ = std::move(subchannel_list); + // If we've started picking, start trying to connect to the first + // subchannel in the new list. + if (started_picking_) { + latest_pending_subchannel_list_->RefForConnectivityWatch( + "connectivity_watch+update"); + latest_pending_subchannel_list_->subchannel(0) + ->StartConnectivityWatchLocked(); } - latest_pending_subchannel_list_ = subchannel_list; - } - // If we've started picking, start trying to connect to the first - // subchannel in the new list. - if (started_picking_) { - SubchannelListRefForConnectivityWatch(subchannel_list, - "connectivity_watch+update"); - grpc_lb_subchannel_data_start_connectivity_watch( - &subchannel_list->subchannels[0]); } } -void PickFirst::OnConnectivityChangedLocked(void* arg, grpc_error* error) { - grpc_lb_subchannel_data* sd = static_cast(arg); - PickFirst* p = static_cast(sd->subchannel_list->policy); +void PickFirst::PickFirstSubchannelList::RefForConnectivityWatch( + const char* reason) { + // TODO(roth): We currently track these refs manually. Once the new + // ClosureRef API is ready, find a way to pass the RefCountedPtr<> + // along with the closures instead of doing this manually. + // Ref subchannel list. + Ref(DEBUG_LOCATION, reason).release(); + // Ref LB policy. + PickFirst* p = static_cast(policy()); + p->Ref(DEBUG_LOCATION, reason).release(); +} + +void PickFirst::PickFirstSubchannelList::UnrefForConnectivityWatch( + const char* reason) { + // Unref LB policy. + PickFirst* p = static_cast(policy()); + p->Unref(DEBUG_LOCATION, reason); + // Unref subchannel list. + Unref(DEBUG_LOCATION, reason); +} + +void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( + grpc_error* error) { + PickFirst* p = static_cast(subchannel_list()->policy()); if (grpc_lb_pick_first_trace.enabled()) { gpr_log(GPR_DEBUG, "Pick First %p connectivity changed for subchannel %p (%" PRIuPTR " of %" PRIuPTR "), subchannel_list %p: state=%s p->shutdown_=%d " "sd->subchannel_list->shutting_down=%d error=%s", - p, sd->subchannel, sd->subchannel_list->checking_subchannel, - sd->subchannel_list->num_subchannels, sd->subchannel_list, - grpc_connectivity_state_name(sd->pending_connectivity_state_unsafe), - p->shutdown_, sd->subchannel_list->shutting_down, + p, subchannel(), Index(), subchannel_list()->num_subchannels(), + subchannel_list(), + grpc_connectivity_state_name(connectivity_state()), + p->shutdown_, subchannel_list()->shutting_down(), grpc_error_string(error)); } // If the policy is shutting down, unref and return. if (p->shutdown_) { - grpc_lb_subchannel_data_stop_connectivity_watch(sd); - grpc_lb_subchannel_data_unref_subchannel(sd, "pf_shutdown"); - p->SubchannelListUnrefForConnectivityWatch(sd->subchannel_list, - "pf_shutdown"); + StopConnectivityWatchLocked(); + UnrefSubchannelLocked("pf_shutdown"); + subchannel_list()->UnrefForConnectivityWatch("pf_shutdown"); return; } // If the subchannel list is shutting down, stop watching. - if (sd->subchannel_list->shutting_down || error == GRPC_ERROR_CANCELLED) { - grpc_lb_subchannel_data_stop_connectivity_watch(sd); - grpc_lb_subchannel_data_unref_subchannel(sd, "pf_sl_shutdown"); - p->SubchannelListUnrefForConnectivityWatch(sd->subchannel_list, - "pf_sl_shutdown"); + if (subchannel_list()->shutting_down() || error == GRPC_ERROR_CANCELLED) { + StopConnectivityWatchLocked(); + UnrefSubchannelLocked("pf_sl_shutdown"); + subchannel_list()->UnrefForConnectivityWatch("pf_sl_shutdown"); return; } // If we're still here, the notification must be for a subchannel in // either the current or latest pending subchannel lists. - GPR_ASSERT(sd->subchannel_list == p->subchannel_list_ || - sd->subchannel_list == p->latest_pending_subchannel_list_); - // Update state. - sd->curr_connectivity_state = sd->pending_connectivity_state_unsafe; + GPR_ASSERT(p->subchannel_list_ == subchannel_list() || + p->latest_pending_subchannel_list_ == subchannel_list()); // Handle updates for the currently selected subchannel. - if (p->selected_ == sd) { + if (p->selected_ == this) { // If the new state is anything other than READY and there is a // pending update, switch to the pending update. - if (sd->curr_connectivity_state != GRPC_CHANNEL_READY && + if (connectivity_state() != GRPC_CHANNEL_READY && p->latest_pending_subchannel_list_ != nullptr) { p->selected_ = nullptr; - grpc_lb_subchannel_data_stop_connectivity_watch(sd); - p->SubchannelListUnrefForConnectivityWatch( - sd->subchannel_list, "selected_not_ready+switch_to_update"); - grpc_lb_subchannel_list_shutdown_and_unref( - p->subchannel_list_, "selected_not_ready+switch_to_update"); - p->subchannel_list_ = p->latest_pending_subchannel_list_; - p->latest_pending_subchannel_list_ = nullptr; + StopConnectivityWatchLocked(); + subchannel_list()->UnrefForConnectivityWatch( + "selected_not_ready+switch_to_update"); + subchannel_list()->ShutdownLocked("selected_not_ready+switch_to_update"); + p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); grpc_connectivity_state_set( &p->state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, GRPC_ERROR_REF(error), "selected_not_ready+switch_to_update"); @@ -452,8 +473,8 @@ void PickFirst::OnConnectivityChangedLocked(void* arg, grpc_error* error) { // re-resolution is introduced. But we need to investigate whether we // really want to take any action instead of waiting for the selected // subchannel reconnecting. - GPR_ASSERT(sd->curr_connectivity_state != GRPC_CHANNEL_SHUTDOWN); - if (sd->curr_connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { + GPR_ASSERT(connectivity_state() != GRPC_CHANNEL_SHUTDOWN); + if (connectivity_state() == GRPC_CHANNEL_TRANSIENT_FAILURE) { // If the selected channel goes bad, request a re-resolution. grpc_connectivity_state_set(&p->state_tracker_, GRPC_CHANNEL_IDLE, GRPC_ERROR_NONE, @@ -462,17 +483,14 @@ void PickFirst::OnConnectivityChangedLocked(void* arg, grpc_error* error) { p->TryReresolutionLocked(&grpc_lb_pick_first_trace, GRPC_ERROR_NONE); // In transient failure. Rely on re-resolution to recover. p->selected_ = nullptr; - grpc_lb_subchannel_data_stop_connectivity_watch(sd); - p->SubchannelListUnrefForConnectivityWatch(sd->subchannel_list, - "pf_selected_shutdown"); - grpc_lb_subchannel_data_unref_subchannel( - sd, "pf_selected_shutdown"); // Unrefs connected subchannel + StopConnectivityWatchLocked(); + subchannel_list()->UnrefForConnectivityWatch("pf_selected_shutdown"); + UnrefSubchannelLocked("pf_selected_shutdown"); } else { - grpc_connectivity_state_set(&p->state_tracker_, - sd->curr_connectivity_state, + grpc_connectivity_state_set(&p->state_tracker_, connectivity_state(), GRPC_ERROR_REF(error), "selected_changed"); // Renew notification. - grpc_lb_subchannel_data_start_connectivity_watch(sd); + StartConnectivityWatchLocked(); } } return; @@ -486,26 +504,23 @@ void PickFirst::OnConnectivityChangedLocked(void* arg, grpc_error* error) { // for a subchannel in p->latest_pending_subchannel_list_. The // goal here is to find a subchannel from the update that we can // select in place of the current one. - switch (sd->curr_connectivity_state) { + switch (connectivity_state()) { case GRPC_CHANNEL_READY: { // Case 2. Promote p->latest_pending_subchannel_list_ to // p->subchannel_list_. - sd->connected_subchannel = - grpc_subchannel_get_connected_subchannel(sd->subchannel); - if (sd->subchannel_list == p->latest_pending_subchannel_list_) { + GetConnectedSubchannelFromSubchannelLocked(); + if (p->latest_pending_subchannel_list_ == subchannel_list()) { GPR_ASSERT(p->subchannel_list_ != nullptr); - grpc_lb_subchannel_list_shutdown_and_unref(p->subchannel_list_, - "finish_update"); - p->subchannel_list_ = p->latest_pending_subchannel_list_; - p->latest_pending_subchannel_list_ = nullptr; + p->subchannel_list_->ShutdownLocked("finish_update"); + p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); } // Cases 1 and 2. grpc_connectivity_state_set(&p->state_tracker_, GRPC_CHANNEL_READY, GRPC_ERROR_NONE, "connecting_ready"); - p->selected_ = sd; + p->selected_ = this; if (grpc_lb_pick_first_trace.enabled()) { gpr_log(GPR_INFO, "Pick First %p selected subchannel %p", p, - sd->subchannel); + subchannel()); } // Drop all other subchannels, since we are now connected. p->DestroyUnselectedSubchannelsLocked(); @@ -513,7 +528,8 @@ void PickFirst::OnConnectivityChangedLocked(void* arg, grpc_error* error) { PickState* pick; while ((pick = p->pending_picks_)) { p->pending_picks_ = pick->next; - pick->connected_subchannel = p->selected_->connected_subchannel; + pick->connected_subchannel = + p->selected_->connected_subchannel()->Ref(); if (grpc_lb_pick_first_trace.enabled()) { gpr_log(GPR_INFO, "Servicing pending pick with selected subchannel %p", @@ -522,40 +538,38 @@ void PickFirst::OnConnectivityChangedLocked(void* arg, grpc_error* error) { GRPC_CLOSURE_SCHED(pick->on_complete, GRPC_ERROR_NONE); } // Renew notification. - grpc_lb_subchannel_data_start_connectivity_watch(sd); + StartConnectivityWatchLocked(); break; } case GRPC_CHANNEL_TRANSIENT_FAILURE: { - grpc_lb_subchannel_data_stop_connectivity_watch(sd); + StopConnectivityWatchLocked(); + PickFirstSubchannelData* sd = this; do { - sd->subchannel_list->checking_subchannel = - (sd->subchannel_list->checking_subchannel + 1) % - sd->subchannel_list->num_subchannels; - sd = &sd->subchannel_list - ->subchannels[sd->subchannel_list->checking_subchannel]; - } while (sd->subchannel == nullptr); + size_t next_index = + (sd->Index() + 1) % subchannel_list()->num_subchannels(); + sd = subchannel_list()->subchannel(next_index); + } while (sd->subchannel() == nullptr); // Case 1: Only set state to TRANSIENT_FAILURE if we've tried // all subchannels. - if (sd->subchannel_list->checking_subchannel == 0 && - sd->subchannel_list == p->subchannel_list_) { + if (sd->Index() == 0 && p->subchannel_list_ == subchannel_list()) { grpc_connectivity_state_set( &p->state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, GRPC_ERROR_REF(error), "connecting_transient_failure"); } // Reuses the connectivity refs from the previous watch. - grpc_lb_subchannel_data_start_connectivity_watch(sd); + sd->StartConnectivityWatchLocked(); break; } case GRPC_CHANNEL_CONNECTING: case GRPC_CHANNEL_IDLE: { // Only update connectivity state in case 1. - if (sd->subchannel_list == p->subchannel_list_) { + if (p->subchannel_list_ == subchannel_list()) { grpc_connectivity_state_set(&p->state_tracker_, GRPC_CHANNEL_CONNECTING, GRPC_ERROR_REF(error), "connecting_changed"); } // Renew notification. - grpc_lb_subchannel_data_start_connectivity_watch(sd); + StartConnectivityWatchLocked(); break; } case GRPC_CHANNEL_SHUTDOWN: diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index e534131c02c..a9d9227ea52 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -73,23 +73,93 @@ class RoundRobin : public LoadBalancingPolicy { private: ~RoundRobin(); + class RoundRobinSubchannelList; + + class RoundRobinSubchannelData + : public SubchannelData { + public: + RoundRobinSubchannelData(RoundRobinSubchannelList* subchannel_list, + const grpc_lb_user_data_vtable* user_data_vtable, + const grpc_lb_address& address, + grpc_subchannel* subchannel, + grpc_combiner* combiner) + : SubchannelData(subchannel_list, user_data_vtable, address, + subchannel, combiner), + user_data_vtable_(user_data_vtable), + user_data_(user_data_vtable_ != nullptr + ? user_data_vtable_->copy(address.user_data) + : nullptr) {} + + void ProcessConnectivityChangeLocked(grpc_error* error) override; + + void UnrefSubchannelLocked(const char* reason) override { + SubchannelData::UnrefSubchannelLocked(reason); + if (user_data_ != nullptr) { + GPR_ASSERT(user_data_vtable_ != nullptr); + user_data_vtable_->destroy(user_data_); + user_data_ = nullptr; + } + } + + void* user_data() const { return user_data_; } + + grpc_connectivity_state CheckConnectivityStateLocked() override { + prev_connectivity_state_ = SubchannelData::CheckConnectivityStateLocked(); + return prev_connectivity_state_; + } + + private: + const grpc_lb_user_data_vtable* user_data_vtable_; + void* user_data_ = nullptr; + grpc_connectivity_state prev_connectivity_state_ = GRPC_CHANNEL_IDLE; + }; + + class RoundRobinSubchannelList + : public SubchannelList { + public: + RoundRobinSubchannelList( + RoundRobin* policy, TraceFlag* tracer, + const grpc_lb_addresses* addresses, grpc_combiner* combiner, + grpc_client_channel_factory* client_channel_factory, + const grpc_channel_args& args) + : SubchannelList(policy, tracer, addresses, combiner, + client_channel_factory, args), + num_idle_(num_subchannels()) {} + + void RefForConnectivityWatch(const char* reason); + void UnrefForConnectivityWatch(const char* reason); + + void UpdateStateCountersLocked(grpc_connectivity_state old_state, + grpc_connectivity_state new_state); + + size_t num_ready() const { return num_ready_; } + size_t num_transient_failure() const { return num_transient_failure_; } + size_t num_idle() const { return num_idle_; } + + private: + size_t num_ready_ = 0; + size_t num_transient_failure_ = 0; + size_t num_idle_; + }; + void ShutdownLocked() override; void StartPickingLocked(); size_t GetNextReadySubchannelIndexLocked(); void UpdateLastReadySubchannelIndexLocked(size_t last_ready_index); - void UpdateConnectivityStatusLocked(grpc_lb_subchannel_data* sd, - grpc_error* error); - - static void OnConnectivityChangedLocked(void* arg, grpc_error* error); - - void SubchannelListRefForConnectivityWatch( - grpc_lb_subchannel_list* subchannel_list, const char* reason); - void SubchannelListUnrefForConnectivityWatch( - grpc_lb_subchannel_list* subchannel_list, const char* reason); + void UpdateConnectivityStateLocked(grpc_connectivity_state state, + grpc_error* error); /** list of subchannels */ - grpc_lb_subchannel_list* subchannel_list_ = nullptr; + RefCountedPtr subchannel_list_; + /** Latest version of the subchannel list. + * Subchannel connectivity callbacks will only promote updated subchannel + * lists if they equal \a latest_pending_subchannel_list. In other words, + * racing callbacks that reference outdated subchannel lists won't perform any + * update. */ + RefCountedPtr latest_pending_subchannel_list_; /** have we started picking? */ bool started_picking_ = false; /** are we shutting down? */ @@ -98,14 +168,8 @@ class RoundRobin : public LoadBalancingPolicy { PickState* pending_picks_ = nullptr; /** our connectivity state tracker */ grpc_connectivity_state_tracker state_tracker_; - /** Index into subchannels for last pick. */ + /** Index into subchannel_list_ for last pick. */ size_t last_ready_subchannel_index_ = 0; - /** Latest version of the subchannel list. - * Subchannel connectivity callbacks will only promote updated subchannel - * lists if they equal \a latest_pending_subchannel_list. In other words, - * racing callbacks that reference outdated subchannel lists won't perform any - * update. */ - grpc_lb_subchannel_list* latest_pending_subchannel_list_ = nullptr; }; RoundRobin::RoundRobin(const Args& args) : LoadBalancingPolicy(args) { @@ -115,7 +179,7 @@ RoundRobin::RoundRobin(const Args& args) : LoadBalancingPolicy(args) { UpdateLocked(*args.args); if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, "[RR %p] Created with %" PRIuPTR " subchannels", this, - subchannel_list_->num_subchannels); + subchannel_list_->num_subchannels()); } grpc_subchannel_index_ref(); } @@ -144,30 +208,30 @@ size_t RoundRobin::GetNextReadySubchannelIndexLocked() { "[RR %p] getting next ready subchannel (out of %" PRIuPTR "), " "last_ready_subchannel_index=%" PRIuPTR, - this, subchannel_list_->num_subchannels, + this, subchannel_list_->num_subchannels(), last_ready_subchannel_index_); } - for (size_t i = 0; i < subchannel_list_->num_subchannels; ++i) { + for (size_t i = 0; i < subchannel_list_->num_subchannels(); ++i) { const size_t index = (i + last_ready_subchannel_index_ + 1) % - subchannel_list_->num_subchannels; + subchannel_list_->num_subchannels(); if (grpc_lb_round_robin_trace.enabled()) { gpr_log( GPR_DEBUG, "[RR %p] checking subchannel %p, subchannel_list %p, index %" PRIuPTR ": state=%s", - this, subchannel_list_->subchannels[index].subchannel, - subchannel_list_, index, + this, subchannel_list_->subchannel(index)->subchannel(), + subchannel_list_.get(), index, grpc_connectivity_state_name( - subchannel_list_->subchannels[index].curr_connectivity_state)); + subchannel_list_->subchannel(index)->connectivity_state())); } - if (subchannel_list_->subchannels[index].curr_connectivity_state == + if (subchannel_list_->subchannel(index)->connectivity_state() == GRPC_CHANNEL_READY) { if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, "[RR %p] found next ready subchannel (%p) at index %" PRIuPTR " of subchannel_list %p", - this, subchannel_list_->subchannels[index].subchannel, index, - subchannel_list_); + this, subchannel_list_->subchannel(index)->subchannel(), + index, subchannel_list_.get()); } return index; } @@ -175,21 +239,21 @@ size_t RoundRobin::GetNextReadySubchannelIndexLocked() { if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, "[RR %p] no subchannels in ready state", this); } - return subchannel_list_->num_subchannels; + return subchannel_list_->num_subchannels(); } // Sets last_ready_subchannel_index_ to last_ready_index. void RoundRobin::UpdateLastReadySubchannelIndexLocked(size_t last_ready_index) { - GPR_ASSERT(last_ready_index < subchannel_list_->num_subchannels); + GPR_ASSERT(last_ready_index < subchannel_list_->num_subchannels()); last_ready_subchannel_index_ = last_ready_index; if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, "[RR %p] setting last_ready_subchannel_index=%" PRIuPTR " (SC %p, CSC %p)", this, last_ready_index, - subchannel_list_->subchannels[last_ready_index].subchannel, - subchannel_list_->subchannels[last_ready_index] - .connected_subchannel.get()); + subchannel_list_->subchannel(last_ready_index)->subchannel(), + subchannel_list_->subchannel(last_ready_index) + ->connected_subchannel()); } } @@ -219,14 +283,12 @@ void RoundRobin::ShutdownLocked() { grpc_connectivity_state_set(&state_tracker_, GRPC_CHANNEL_SHUTDOWN, GRPC_ERROR_REF(error), "rr_shutdown"); if (subchannel_list_ != nullptr) { - grpc_lb_subchannel_list_shutdown_and_unref(subchannel_list_, - "sl_shutdown_rr_shutdown"); - subchannel_list_ = nullptr; + subchannel_list_->ShutdownLocked("rr_shutdown"); + subchannel_list_.reset(); } if (latest_pending_subchannel_list_ != nullptr) { - grpc_lb_subchannel_list_shutdown_and_unref( - latest_pending_subchannel_list_, "sl_shutdown_pending_rr_shutdown"); - latest_pending_subchannel_list_ = nullptr; + latest_pending_subchannel_list_->ShutdownLocked("rr_shutdown"); + latest_pending_subchannel_list_.reset(); } TryReresolutionLocked(&grpc_lb_round_robin_trace, GRPC_ERROR_CANCELLED); GRPC_ERROR_UNREF(error); @@ -273,32 +335,12 @@ void RoundRobin::CancelMatchingPicksLocked(uint32_t initial_metadata_flags_mask, GRPC_ERROR_UNREF(error); } -void RoundRobin::SubchannelListRefForConnectivityWatch( - grpc_lb_subchannel_list* subchannel_list, const char* reason) { - // TODO(roth): We currently track this ref manually. Once the new - // ClosureRef API is ready and the subchannel_list code has been - // converted to a C++ API, find a way to hold the RefCountedPtr<> - // somewhere (maybe in the subchannel_data object) instead of doing - // this manually. - auto self = Ref(DEBUG_LOCATION, reason); - self.release(); - grpc_lb_subchannel_list_ref(subchannel_list, reason); -} - -void RoundRobin::SubchannelListUnrefForConnectivityWatch( - grpc_lb_subchannel_list* subchannel_list, const char* reason) { - Unref(DEBUG_LOCATION, reason); - grpc_lb_subchannel_list_unref(subchannel_list, reason); -} - void RoundRobin::StartPickingLocked() { started_picking_ = true; - for (size_t i = 0; i < subchannel_list_->num_subchannels; i++) { - if (subchannel_list_->subchannels[i].subchannel != nullptr) { - SubchannelListRefForConnectivityWatch(subchannel_list_, - "connectivity_watch"); - grpc_lb_subchannel_data_start_connectivity_watch( - &subchannel_list_->subchannels[i]); + for (size_t i = 0; i < subchannel_list_->num_subchannels(); i++) { + if (subchannel_list_->subchannel(i)->subchannel() != nullptr) { + subchannel_list_->RefForConnectivityWatch("connectivity_watch"); + subchannel_list_->subchannel(i)->StartConnectivityWatchLocked(); } } } @@ -317,21 +359,21 @@ bool RoundRobin::PickLocked(PickState* pick) { GPR_ASSERT(!shutdown_); if (subchannel_list_ != nullptr) { const size_t next_ready_index = GetNextReadySubchannelIndexLocked(); - if (next_ready_index < subchannel_list_->num_subchannels) { + if (next_ready_index < subchannel_list_->num_subchannels()) { /* readily available, report right away */ - grpc_lb_subchannel_data* sd = - &subchannel_list_->subchannels[next_ready_index]; - pick->connected_subchannel = sd->connected_subchannel; + RoundRobinSubchannelData* sd = + subchannel_list_->subchannel(next_ready_index); + pick->connected_subchannel = sd->connected_subchannel()->Ref(); if (pick->user_data != nullptr) { - *pick->user_data = sd->user_data; + *pick->user_data = sd->user_data(); } if (grpc_lb_round_robin_trace.enabled()) { gpr_log( GPR_DEBUG, "[RR %p] Picked target <-- Subchannel %p (connected %p) (sl %p, " "index %" PRIuPTR ")", - this, sd->subchannel, pick->connected_subchannel.get(), - sd->subchannel_list, next_ready_index); + this, sd->subchannel(), pick->connected_subchannel.get(), + sd->subchannel_list(), next_ready_index); } /* only advance the last picked pointer if the selection was used */ UpdateLastReadySubchannelIndexLocked(next_ready_index); @@ -347,36 +389,12 @@ bool RoundRobin::PickLocked(PickState* pick) { return false; } -void UpdateStateCountersLocked(grpc_lb_subchannel_data* sd) { - grpc_lb_subchannel_list* subchannel_list = sd->subchannel_list; - GPR_ASSERT(sd->prev_connectivity_state != GRPC_CHANNEL_SHUTDOWN); - GPR_ASSERT(sd->curr_connectivity_state != GRPC_CHANNEL_SHUTDOWN); - if (sd->prev_connectivity_state == GRPC_CHANNEL_READY) { - GPR_ASSERT(subchannel_list->num_ready > 0); - --subchannel_list->num_ready; - } else if (sd->prev_connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { - GPR_ASSERT(subchannel_list->num_transient_failures > 0); - --subchannel_list->num_transient_failures; - } else if (sd->prev_connectivity_state == GRPC_CHANNEL_IDLE) { - GPR_ASSERT(subchannel_list->num_idle > 0); - --subchannel_list->num_idle; - } - sd->prev_connectivity_state = sd->curr_connectivity_state; - if (sd->curr_connectivity_state == GRPC_CHANNEL_READY) { - ++subchannel_list->num_ready; - } else if (sd->curr_connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { - ++subchannel_list->num_transient_failures; - } else if (sd->curr_connectivity_state == GRPC_CHANNEL_IDLE) { - ++subchannel_list->num_idle; - } -} - /** Sets the policy's connectivity status based on that of the passed-in \a sd * (the grpc_lb_subchannel_data associated with the updated subchannel) and the * subchannel list \a sd belongs to (sd->subchannel_list). \a error will be used * only if the policy transitions to state TRANSIENT_FAILURE. */ -void RoundRobin::UpdateConnectivityStatusLocked(grpc_lb_subchannel_data* sd, - grpc_error* error) { +void RoundRobin::UpdateConnectivityStateLocked(grpc_connectivity_state state, + grpc_error* error) { /* In priority order. The first rule to match terminates the search (ie, if we * are on rule n, all previous rules were unfulfilled). * @@ -391,18 +409,16 @@ void RoundRobin::UpdateConnectivityStatusLocked(grpc_lb_subchannel_data* sd, * CHECK: subchannel_list->num_transient_failures == * subchannel_list->num_subchannels. */ - grpc_lb_subchannel_list* subchannel_list = sd->subchannel_list; - GPR_ASSERT(sd->curr_connectivity_state != GRPC_CHANNEL_IDLE); - if (subchannel_list->num_ready > 0) { + if (subchannel_list_->num_ready() > 0) { /* 1) READY */ grpc_connectivity_state_set(&state_tracker_, GRPC_CHANNEL_READY, GRPC_ERROR_NONE, "rr_ready"); - } else if (sd->curr_connectivity_state == GRPC_CHANNEL_CONNECTING) { + } else if (state == GRPC_CHANNEL_CONNECTING) { /* 2) CONNECTING */ grpc_connectivity_state_set(&state_tracker_, GRPC_CHANNEL_CONNECTING, GRPC_ERROR_NONE, "rr_connecting"); - } else if (subchannel_list->num_transient_failures == - subchannel_list->num_subchannels) { + } else if (subchannel_list_->num_transient_failure() == + subchannel_list_->num_subchannels()) { /* 3) TRANSIENT_FAILURE */ grpc_connectivity_state_set(&state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, GRPC_ERROR_REF(error), @@ -411,99 +427,134 @@ void RoundRobin::UpdateConnectivityStatusLocked(grpc_lb_subchannel_data* sd, GRPC_ERROR_UNREF(error); } -void RoundRobin::OnConnectivityChangedLocked(void* arg, grpc_error* error) { - grpc_lb_subchannel_data* sd = static_cast(arg); - RoundRobin* p = static_cast(sd->subchannel_list->policy); +void RoundRobin::RoundRobinSubchannelList::RefForConnectivityWatch( + const char* reason) { + // TODO(roth): We currently track these refs manually. Once the new + // ClosureRef API is ready, find a way to pass the RefCountedPtr<> + // along with the closures instead of doing this manually. + // Ref subchannel list. + Ref(DEBUG_LOCATION, reason).release(); + // Ref LB policy. + RoundRobin* p = static_cast(policy()); + p->Ref(DEBUG_LOCATION, reason).release(); +} + +void RoundRobin::RoundRobinSubchannelList::UnrefForConnectivityWatch( + const char* reason) { + // Unref LB policy. + RoundRobin* p = static_cast(policy()); + p->Unref(DEBUG_LOCATION, reason); + // Unref subchannel list. + Unref(DEBUG_LOCATION, reason); +} + +void RoundRobin::RoundRobinSubchannelList::UpdateStateCountersLocked( + grpc_connectivity_state old_state, grpc_connectivity_state new_state) { + GPR_ASSERT(old_state != GRPC_CHANNEL_SHUTDOWN); + GPR_ASSERT(new_state != GRPC_CHANNEL_SHUTDOWN); + if (old_state == GRPC_CHANNEL_READY) { + GPR_ASSERT(num_ready_ > 0); + --num_ready_; + } else if (old_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { + GPR_ASSERT(num_transient_failure_ > 0); + --num_transient_failure_; + } else if (old_state == GRPC_CHANNEL_IDLE) { + GPR_ASSERT(num_idle_ > 0); + --num_idle_; + } + if (new_state == GRPC_CHANNEL_READY) { + ++num_ready_; + } else if (new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { + ++num_transient_failure_; + } else if (new_state == GRPC_CHANNEL_IDLE) { + ++num_idle_; + } +} + +void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( + grpc_error* error) { + RoundRobin* p = static_cast(subchannel_list()->policy()); if (grpc_lb_round_robin_trace.enabled()) { gpr_log( GPR_DEBUG, "[RR %p] connectivity changed for subchannel %p, subchannel_list %p: " "prev_state=%s new_state=%s p->shutdown=%d " "sd->subchannel_list->shutting_down=%d error=%s", - p, sd->subchannel, sd->subchannel_list, - grpc_connectivity_state_name(sd->prev_connectivity_state), - grpc_connectivity_state_name(sd->pending_connectivity_state_unsafe), - p->shutdown_, sd->subchannel_list->shutting_down, + p, subchannel(), subchannel_list(), + grpc_connectivity_state_name(prev_connectivity_state_), + grpc_connectivity_state_name(connectivity_state()), + p->shutdown_, subchannel_list()->shutting_down(), grpc_error_string(error)); } - GPR_ASSERT(sd->subchannel != nullptr); + GPR_ASSERT(subchannel() != nullptr); // If the policy is shutting down, unref and return. if (p->shutdown_) { - grpc_lb_subchannel_data_stop_connectivity_watch(sd); - grpc_lb_subchannel_data_unref_subchannel(sd, "rr_shutdown"); - p->SubchannelListUnrefForConnectivityWatch(sd->subchannel_list, - "rr_shutdown"); + StopConnectivityWatchLocked(); + UnrefSubchannelLocked("rr_shutdown"); + subchannel_list()->UnrefForConnectivityWatch("rr_shutdown"); return; } // If the subchannel list is shutting down, stop watching. - if (sd->subchannel_list->shutting_down || error == GRPC_ERROR_CANCELLED) { - grpc_lb_subchannel_data_stop_connectivity_watch(sd); - grpc_lb_subchannel_data_unref_subchannel(sd, "rr_sl_shutdown"); - p->SubchannelListUnrefForConnectivityWatch(sd->subchannel_list, - "rr_sl_shutdown"); + if (subchannel_list()->shutting_down() || error == GRPC_ERROR_CANCELLED) { + StopConnectivityWatchLocked(); + UnrefSubchannelLocked("rr_sl_shutdown"); + subchannel_list()->UnrefForConnectivityWatch("rr_sl_shutdown"); return; } + GPR_ASSERT(connectivity_state() != GRPC_CHANNEL_SHUTDOWN); // If we're still here, the notification must be for a subchannel in // either the current or latest pending subchannel lists. - GPR_ASSERT(sd->subchannel_list == p->subchannel_list_ || - sd->subchannel_list == p->latest_pending_subchannel_list_); - GPR_ASSERT(sd->pending_connectivity_state_unsafe != GRPC_CHANNEL_SHUTDOWN); - // Now that we're inside the combiner, copy the pending connectivity - // state (which was set by the connectivity state watcher) to - // curr_connectivity_state, which is what we use inside of the combiner. - sd->curr_connectivity_state = sd->pending_connectivity_state_unsafe; + GPR_ASSERT(p->subchannel_list_ == subchannel_list() || + p->latest_pending_subchannel_list_ == subchannel_list()); // If the sd's new state is TRANSIENT_FAILURE, unref the *connected* // subchannel, if any. - switch (sd->curr_connectivity_state) { + switch (connectivity_state()) { case GRPC_CHANNEL_TRANSIENT_FAILURE: { - sd->connected_subchannel.reset(); + clear_connected_subchannel(); if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, "[RR %p] Subchannel %p has gone into TRANSIENT_FAILURE. " "Requesting re-resolution", - p, sd->subchannel); + p, subchannel()); } p->TryReresolutionLocked(&grpc_lb_round_robin_trace, GRPC_ERROR_NONE); break; } case GRPC_CHANNEL_READY: { - if (sd->connected_subchannel == nullptr) { - sd->connected_subchannel = - grpc_subchannel_get_connected_subchannel(sd->subchannel); + if (connected_subchannel() == nullptr) { + GetConnectedSubchannelFromSubchannelLocked(); } - if (sd->subchannel_list != p->subchannel_list_) { - // promote sd->subchannel_list to p->subchannel_list_. - // sd->subchannel_list must be equal to + if (p->subchannel_list_ != subchannel_list()) { + // promote subchannel_list() to p->subchannel_list_. + // subchannel_list() must be equal to // p->latest_pending_subchannel_list_ because we have already filtered - // for sds belonging to outdated subchannel lists. - GPR_ASSERT(sd->subchannel_list == p->latest_pending_subchannel_list_); - GPR_ASSERT(!sd->subchannel_list->shutting_down); + // for subchannels belonging to outdated subchannel lists. + GPR_ASSERT(p->latest_pending_subchannel_list_ == subchannel_list()); + GPR_ASSERT(!subchannel_list()->shutting_down()); if (grpc_lb_round_robin_trace.enabled()) { const size_t num_subchannels = p->subchannel_list_ != nullptr - ? p->subchannel_list_->num_subchannels + ? p->subchannel_list_->num_subchannels() : 0; gpr_log(GPR_DEBUG, "[RR %p] phasing out subchannel list %p (size %" PRIuPTR ") in favor of %p (size %" PRIuPTR ")", - p, p->subchannel_list_, num_subchannels, sd->subchannel_list, - num_subchannels); + p, p->subchannel_list_.get(), num_subchannels, + subchannel_list(), subchannel_list()->num_subchannels()); } if (p->subchannel_list_ != nullptr) { // dispose of the current subchannel_list - grpc_lb_subchannel_list_shutdown_and_unref(p->subchannel_list_, - "sl_phase_out_shutdown"); + p->subchannel_list_->ShutdownLocked("sl_phase_out_shutdown"); } - p->subchannel_list_ = p->latest_pending_subchannel_list_; - p->latest_pending_subchannel_list_ = nullptr; + p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); } /* at this point we know there's at least one suitable subchannel. Go * ahead and pick one and notify the pending suitors in * p->pending_picks. This preemptively replicates rr_pick()'s actions. */ const size_t next_ready_index = p->GetNextReadySubchannelIndexLocked(); - GPR_ASSERT(next_ready_index < p->subchannel_list_->num_subchannels); - grpc_lb_subchannel_data* selected = - &p->subchannel_list_->subchannels[next_ready_index]; + GPR_ASSERT(next_ready_index < p->subchannel_list_->num_subchannels()); + RoundRobinSubchannelData* selected = + p->subchannel_list_->subchannel(next_ready_index); if (p->pending_picks_ != nullptr) { // if the selected subchannel is going to be used for the pending // picks, update the last picked pointer @@ -512,15 +563,15 @@ void RoundRobin::OnConnectivityChangedLocked(void* arg, grpc_error* error) { PickState* pick; while ((pick = p->pending_picks_)) { p->pending_picks_ = pick->next; - pick->connected_subchannel = selected->connected_subchannel; + pick->connected_subchannel = selected->connected_subchannel()->Ref(); if (pick->user_data != nullptr) { - *pick->user_data = selected->user_data; + *pick->user_data = selected->user_data(); } if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, "[RR %p] Fulfilling pending pick. Target <-- subchannel %p " "(subchannel_list %p, index %" PRIuPTR ")", - p, selected->subchannel, p->subchannel_list_, + p, selected->subchannel(), p->subchannel_list_.get(), next_ready_index); } GRPC_CLOSURE_SCHED(pick->on_complete, GRPC_ERROR_NONE); @@ -533,13 +584,16 @@ void RoundRobin::OnConnectivityChangedLocked(void* arg, grpc_error* error) { case GRPC_CHANNEL_IDLE:; // fallthrough } // Update state counters. - UpdateStateCountersLocked(sd); + subchannel_list()->UpdateStateCountersLocked(prev_connectivity_state_, + connectivity_state()); + prev_connectivity_state_ = connectivity_state(); // Only update connectivity based on the selected subchannel list. - if (sd->subchannel_list == p->subchannel_list_) { - p->UpdateConnectivityStatusLocked(sd, GRPC_ERROR_REF(error)); + if (p->subchannel_list_ == subchannel_list()) { + p->UpdateConnectivityStateLocked(connectivity_state(), + GRPC_ERROR_REF(error)); } // Renew notification. - grpc_lb_subchannel_data_start_connectivity_watch(sd); + StartConnectivityWatchLocked(); } grpc_connectivity_state RoundRobin::CheckConnectivityLocked( @@ -556,10 +610,10 @@ void RoundRobin::NotifyOnStateChangeLocked(grpc_connectivity_state* current, void RoundRobin::PingOneLocked(grpc_closure* on_initiate, grpc_closure* on_ack) { const size_t next_ready_index = GetNextReadySubchannelIndexLocked(); - if (next_ready_index < subchannel_list_->num_subchannels) { - grpc_lb_subchannel_data* selected = - &subchannel_list_->subchannels[next_ready_index]; - selected->connected_subchannel->Ping(on_initiate, on_ack); + if (next_ready_index < subchannel_list_->num_subchannels()) { + RoundRobinSubchannelData* selected = + subchannel_list_->subchannel(next_ready_index); + selected->connected_subchannel()->Ping(on_initiate, on_ack); } else { GRPC_CLOSURE_SCHED(on_initiate, GRPC_ERROR_CREATE_FROM_STATIC_STRING( "Round Robin not connected")); @@ -587,30 +641,29 @@ void RoundRobin::UpdateLocked(const grpc_channel_args& args) { gpr_log(GPR_DEBUG, "[RR %p] received update with %" PRIuPTR " addresses", this, addresses->num_addresses); } - grpc_lb_subchannel_list* subchannel_list = grpc_lb_subchannel_list_create( + auto subchannel_list = MakeRefCounted( this, &grpc_lb_round_robin_trace, addresses, combiner(), - client_channel_factory(), args, &RoundRobin::OnConnectivityChangedLocked); - if (subchannel_list->num_subchannels == 0) { + client_channel_factory(), args); + if (subchannel_list->num_subchannels() == 0) { grpc_connectivity_state_set( &state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"), "rr_update_empty"); if (subchannel_list_ != nullptr) { - grpc_lb_subchannel_list_shutdown_and_unref(subchannel_list_, - "sl_shutdown_empty_update"); + subchannel_list_->ShutdownLocked("sl_shutdown_empty_update"); } - subchannel_list_ = subchannel_list; // empty list + subchannel_list_ = std::move(subchannel_list); // empty list return; } if (started_picking_) { - for (size_t i = 0; i < subchannel_list->num_subchannels; ++i) { + for (size_t i = 0; i < subchannel_list->num_subchannels(); ++i) { const grpc_connectivity_state subchannel_state = - grpc_subchannel_check_connectivity( - subchannel_list->subchannels[i].subchannel, nullptr); + subchannel_list->subchannel(i)->CheckConnectivityStateLocked(); // Override the default setting of IDLE for connectivity notification // purposes if the subchannel is already in transient failure. Otherwise // we'd be immediately notified of the IDLE-TRANSIENT_FAILURE - // discrepancy, attempt to re-resolve and end up here again. + // discrepancy, attempt to re-resolve, and end up here again. +// FIXME // TODO(roth): As part of C++-ifying the subchannel_list API, design a // better API for notifying the LB policy of subchannel states, which can // be used both for the subchannel's initial state and for subsequent @@ -619,43 +672,36 @@ void RoundRobin::UpdateLocked(const grpc_channel_args& args) { // pending picks across all READY subchannels rather than sending them all // to the first one). if (subchannel_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { - subchannel_list->subchannels[i].pending_connectivity_state_unsafe = - subchannel_list->subchannels[i].curr_connectivity_state = - subchannel_list->subchannels[i].prev_connectivity_state = - subchannel_state; - --subchannel_list->num_idle; - ++subchannel_list->num_transient_failures; + subchannel_list->UpdateStateCountersLocked(GRPC_CHANNEL_IDLE, + subchannel_state); } } + for (size_t i = 0; i < subchannel_list->num_subchannels(); ++i) { + /* Watch every new subchannel. A subchannel list becomes active the + * moment one of its subchannels is READY. At that moment, we swap + * p->subchannel_list for sd->subchannel_list, provided the subchannel + * list is still valid (ie, isn't shutting down) */ + subchannel_list->RefForConnectivityWatch("connectivity_watch"); + subchannel_list->subchannel(i)->StartConnectivityWatchLocked(); + } if (latest_pending_subchannel_list_ != nullptr) { if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, "[RR %p] Shutting down latest pending subchannel list %p, " "about to be replaced by newer latest %p", - this, latest_pending_subchannel_list_, subchannel_list); + this, latest_pending_subchannel_list_.get(), + subchannel_list.get()); } - grpc_lb_subchannel_list_shutdown_and_unref( - latest_pending_subchannel_list_, "sl_outdated"); - } - latest_pending_subchannel_list_ = subchannel_list; - for (size_t i = 0; i < subchannel_list->num_subchannels; ++i) { - /* Watch every new subchannel. A subchannel list becomes active the - * moment one of its subchannels is READY. At that moment, we swap - * p->subchannel_list for sd->subchannel_list, provided the subchannel - * list is still valid (ie, isn't shutting down) */ - SubchannelListRefForConnectivityWatch(subchannel_list, - "connectivity_watch"); - grpc_lb_subchannel_data_start_connectivity_watch( - &subchannel_list->subchannels[i]); + latest_pending_subchannel_list_->ShutdownLocked("sl_outdated"); } + latest_pending_subchannel_list_ = std::move(subchannel_list); } else { // The policy isn't picking yet. Save the update for later, disposing of // previous version if any. if (subchannel_list_ != nullptr) { - grpc_lb_subchannel_list_shutdown_and_unref( - subchannel_list_, "rr_update_before_started_picking"); + subchannel_list_->ShutdownLocked("rr_update_before_started_picking"); } - subchannel_list_ = subchannel_list; + subchannel_list_ = std::move(subchannel_list); } } diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc deleted file mode 100644 index 79cb64c6c60..00000000000 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc +++ /dev/null @@ -1,253 +0,0 @@ -/* - * - * Copyright 2015 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 - -#include - -#include - -#include "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h" -#include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/debug/trace.h" -#include "src/core/lib/iomgr/closure.h" -#include "src/core/lib/iomgr/combiner.h" -#include "src/core/lib/iomgr/sockaddr_utils.h" -#include "src/core/lib/transport/connectivity_state.h" - -void grpc_lb_subchannel_data_unref_subchannel(grpc_lb_subchannel_data* sd, - const char* reason) { - if (sd->subchannel != nullptr) { - if (sd->subchannel_list->tracer->enabled()) { - gpr_log(GPR_DEBUG, - "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR - " (subchannel %p): unreffing subchannel", - sd->subchannel_list->tracer->name(), sd->subchannel_list->policy, - sd->subchannel_list, - static_cast(sd - sd->subchannel_list->subchannels), - sd->subchannel_list->num_subchannels, sd->subchannel); - } - GRPC_SUBCHANNEL_UNREF(sd->subchannel, reason); - sd->subchannel = nullptr; - sd->connected_subchannel.reset(); - if (sd->user_data != nullptr) { - GPR_ASSERT(sd->user_data_vtable != nullptr); - sd->user_data_vtable->destroy(sd->user_data); - sd->user_data = nullptr; - } - } -} - -void grpc_lb_subchannel_data_start_connectivity_watch( - grpc_lb_subchannel_data* sd) { - if (sd->subchannel_list->tracer->enabled()) { - gpr_log( - GPR_DEBUG, - "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR - " (subchannel %p): requesting connectivity change " - "notification (from %s)", - sd->subchannel_list->tracer->name(), sd->subchannel_list->policy, - sd->subchannel_list, - static_cast(sd - sd->subchannel_list->subchannels), - sd->subchannel_list->num_subchannels, sd->subchannel, - grpc_connectivity_state_name(sd->pending_connectivity_state_unsafe)); - } - sd->connectivity_notification_pending = true; - grpc_subchannel_notify_on_state_change( - sd->subchannel, sd->subchannel_list->policy->interested_parties(), - &sd->pending_connectivity_state_unsafe, - &sd->connectivity_changed_closure); -} - -void grpc_lb_subchannel_data_stop_connectivity_watch( - grpc_lb_subchannel_data* sd) { - if (sd->subchannel_list->tracer->enabled()) { - gpr_log(GPR_DEBUG, - "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR - " (subchannel %p): stopping connectivity watch", - sd->subchannel_list->tracer->name(), sd->subchannel_list->policy, - sd->subchannel_list, - static_cast(sd - sd->subchannel_list->subchannels), - sd->subchannel_list->num_subchannels, sd->subchannel); - } - GPR_ASSERT(sd->connectivity_notification_pending); - sd->connectivity_notification_pending = false; -} - -grpc_lb_subchannel_list* grpc_lb_subchannel_list_create( - grpc_core::LoadBalancingPolicy* p, grpc_core::TraceFlag* tracer, - const grpc_lb_addresses* addresses, grpc_combiner* combiner, - grpc_client_channel_factory* client_channel_factory, - const grpc_channel_args& args, grpc_iomgr_cb_func connectivity_changed_cb) { - grpc_lb_subchannel_list* subchannel_list = - static_cast( - gpr_zalloc(sizeof(*subchannel_list))); - if (tracer->enabled()) { - gpr_log(GPR_DEBUG, - "[%s %p] Creating subchannel list %p for %" PRIuPTR " subchannels", - tracer->name(), p, subchannel_list, addresses->num_addresses); - } - subchannel_list->policy = p; - subchannel_list->tracer = tracer; - gpr_ref_init(&subchannel_list->refcount, 1); - subchannel_list->subchannels = static_cast( - gpr_zalloc(sizeof(grpc_lb_subchannel_data) * addresses->num_addresses)); - // We need to remove the LB addresses in order to be able to compare the - // subchannel keys of subchannels from a different batch of addresses. - static const char* keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS, - GRPC_ARG_LB_ADDRESSES}; - // Create a subchannel for each address. - grpc_subchannel_args sc_args; - size_t subchannel_index = 0; - for (size_t i = 0; i < addresses->num_addresses; i++) { - // If there were any balancer, we would have chosen grpclb policy instead. - GPR_ASSERT(!addresses->addresses[i].is_balancer); - memset(&sc_args, 0, sizeof(grpc_subchannel_args)); - grpc_arg addr_arg = - grpc_create_subchannel_address_arg(&addresses->addresses[i].address); - grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove( - &args, keys_to_remove, GPR_ARRAY_SIZE(keys_to_remove), &addr_arg, 1); - gpr_free(addr_arg.value.string); - sc_args.args = new_args; - grpc_subchannel* subchannel = grpc_client_channel_factory_create_subchannel( - client_channel_factory, &sc_args); - grpc_channel_args_destroy(new_args); - if (subchannel == nullptr) { - // Subchannel could not be created. - if (tracer->enabled()) { - char* address_uri = - grpc_sockaddr_to_uri(&addresses->addresses[i].address); - gpr_log(GPR_DEBUG, - "[%s %p] could not create subchannel for address uri %s, " - "ignoring", - tracer->name(), subchannel_list->policy, address_uri); - gpr_free(address_uri); - } - continue; - } - if (tracer->enabled()) { - char* address_uri = - grpc_sockaddr_to_uri(&addresses->addresses[i].address); - gpr_log(GPR_DEBUG, - "[%s %p] subchannel list %p index %" PRIuPTR - ": Created subchannel %p for address uri %s", - tracer->name(), p, subchannel_list, subchannel_index, subchannel, - address_uri); - gpr_free(address_uri); - } - grpc_lb_subchannel_data* sd = - &subchannel_list->subchannels[subchannel_index++]; - sd->subchannel_list = subchannel_list; - sd->subchannel = subchannel; - GRPC_CLOSURE_INIT(&sd->connectivity_changed_closure, - connectivity_changed_cb, sd, - grpc_combiner_scheduler(combiner)); - // We assume that the current state is IDLE. If not, we'll get a - // callback telling us that. - sd->prev_connectivity_state = GRPC_CHANNEL_IDLE; - sd->curr_connectivity_state = GRPC_CHANNEL_IDLE; - sd->pending_connectivity_state_unsafe = GRPC_CHANNEL_IDLE; - sd->user_data_vtable = addresses->user_data_vtable; - if (sd->user_data_vtable != nullptr) { - sd->user_data = - sd->user_data_vtable->copy(addresses->addresses[i].user_data); - } - } - subchannel_list->num_subchannels = subchannel_index; - subchannel_list->num_idle = subchannel_index; - return subchannel_list; -} - -static void subchannel_list_destroy(grpc_lb_subchannel_list* subchannel_list) { - if (subchannel_list->tracer->enabled()) { - gpr_log(GPR_DEBUG, "[%s %p] Destroying subchannel_list %p", - subchannel_list->tracer->name(), subchannel_list->policy, - subchannel_list); - } - for (size_t i = 0; i < subchannel_list->num_subchannels; i++) { - grpc_lb_subchannel_data* sd = &subchannel_list->subchannels[i]; - grpc_lb_subchannel_data_unref_subchannel(sd, "subchannel_list_destroy"); - } - gpr_free(subchannel_list->subchannels); - gpr_free(subchannel_list); -} - -void grpc_lb_subchannel_list_ref(grpc_lb_subchannel_list* subchannel_list, - const char* reason) { - gpr_ref_non_zero(&subchannel_list->refcount); - if (subchannel_list->tracer->enabled()) { - const gpr_atm count = gpr_atm_acq_load(&subchannel_list->refcount.count); - gpr_log(GPR_DEBUG, "[%s %p] subchannel_list %p REF %lu->%lu (%s)", - subchannel_list->tracer->name(), subchannel_list->policy, - subchannel_list, static_cast(count - 1), - static_cast(count), reason); - } -} - -void grpc_lb_subchannel_list_unref(grpc_lb_subchannel_list* subchannel_list, - const char* reason) { - const bool done = gpr_unref(&subchannel_list->refcount); - if (subchannel_list->tracer->enabled()) { - const gpr_atm count = gpr_atm_acq_load(&subchannel_list->refcount.count); - gpr_log(GPR_DEBUG, "[%s %p] subchannel_list %p UNREF %lu->%lu (%s)", - subchannel_list->tracer->name(), subchannel_list->policy, - subchannel_list, static_cast(count + 1), - static_cast(count), reason); - } - if (done) { - subchannel_list_destroy(subchannel_list); - } -} - -static void subchannel_data_cancel_connectivity_watch( - grpc_lb_subchannel_data* sd, const char* reason) { - if (sd->subchannel_list->tracer->enabled()) { - gpr_log(GPR_DEBUG, - "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR - " (subchannel %p): canceling connectivity watch (%s)", - sd->subchannel_list->tracer->name(), sd->subchannel_list->policy, - sd->subchannel_list, - static_cast(sd - sd->subchannel_list->subchannels), - sd->subchannel_list->num_subchannels, sd->subchannel, reason); - } - grpc_subchannel_notify_on_state_change(sd->subchannel, nullptr, nullptr, - &sd->connectivity_changed_closure); -} - -void grpc_lb_subchannel_list_shutdown_and_unref( - grpc_lb_subchannel_list* subchannel_list, const char* reason) { - if (subchannel_list->tracer->enabled()) { - gpr_log(GPR_DEBUG, "[%s %p] Shutting down subchannel_list %p (%s)", - subchannel_list->tracer->name(), subchannel_list->policy, - subchannel_list, reason); - } - GPR_ASSERT(!subchannel_list->shutting_down); - subchannel_list->shutting_down = true; - for (size_t i = 0; i < subchannel_list->num_subchannels; i++) { - grpc_lb_subchannel_data* sd = &subchannel_list->subchannels[i]; - // If there's a pending notification for this subchannel, cancel it; - // the callback is responsible for unreffing the subchannel. - // Otherwise, unref the subchannel directly. - if (sd->connectivity_notification_pending) { - subchannel_data_cancel_connectivity_watch(sd, reason); - } else if (sd->subchannel != nullptr) { - grpc_lb_subchannel_data_unref_subchannel(sd, reason); - } - } - grpc_lb_subchannel_list_unref(subchannel_list, reason); -} diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index 6889d596ac9..d717ba0e371 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -21,116 +21,388 @@ #include +#include + +#include + #include "src/core/ext/filters/client_channel/lb_policy_registry.h" #include "src/core/ext/filters/client_channel/subchannel.h" +#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/debug/trace.h" +#include "src/core/lib/gprpp/abstract.h" +#include "src/core/lib/gprpp/inlined_vector.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" +#include "src/core/lib/iomgr/combiner.h" +#include "src/core/lib/iomgr/sockaddr_utils.h" #include "src/core/lib/transport/connectivity_state.h" -// TODO(roth): This code is intended to be shared between pick_first and -// round_robin. However, the interface needs more work to provide clean -// encapsulation. For example, the structs here have some fields that are -// only used in one of the two (e.g., the state counters in -// grpc_lb_subchannel_list and the prev_connectivity_state field in -// grpc_lb_subchannel_data are only used in round_robin, and the -// checking_subchannel field in grpc_lb_subchannel_list is only used by -// pick_first). Also, there is probably some code duplication between the -// connectivity state notification callback code in both pick_first and -// round_robin that could be refactored and moved here. In a future PR, -// need to clean this up. - -typedef struct grpc_lb_subchannel_list grpc_lb_subchannel_list; - -typedef struct { - /** backpointer to owning subchannel list */ - grpc_lb_subchannel_list* subchannel_list; - /** subchannel itself */ - grpc_subchannel* subchannel; - grpc_core::RefCountedPtr connected_subchannel; - /** Is a connectivity notification pending? */ - bool connectivity_notification_pending; - /** notification that connectivity has changed on subchannel */ - grpc_closure connectivity_changed_closure; - /** previous and current connectivity states. Updated by \a - * \a connectivity_changed_closure based on - * \a pending_connectivity_state_unsafe. */ - grpc_connectivity_state prev_connectivity_state; - grpc_connectivity_state curr_connectivity_state; - /** connectivity state to be updated by - * grpc_subchannel_notify_on_state_change(), not guarded by - * the combiner. To be copied to \a curr_connectivity_state by - * \a connectivity_changed_closure. */ - grpc_connectivity_state pending_connectivity_state_unsafe; - /** the subchannel's target user data */ - void* user_data; - /** vtable to operate over \a user_data */ - const grpc_lb_user_data_vtable* user_data_vtable; -} grpc_lb_subchannel_data; - -/// Unrefs the subchannel contained in sd. -void grpc_lb_subchannel_data_unref_subchannel(grpc_lb_subchannel_data* sd, - const char* reason); - -/// Starts watching the connectivity state of the subchannel. -/// The connectivity_changed_cb callback must invoke either -/// grpc_lb_subchannel_data_stop_connectivity_watch() or again call -/// grpc_lb_subchannel_data_start_connectivity_watch(). -void grpc_lb_subchannel_data_start_connectivity_watch( - grpc_lb_subchannel_data* sd); - -/// Stops watching the connectivity state of the subchannel. -void grpc_lb_subchannel_data_stop_connectivity_watch( - grpc_lb_subchannel_data* sd); - -struct grpc_lb_subchannel_list { - /** backpointer to owning policy */ - grpc_core::LoadBalancingPolicy* policy; - - grpc_core::TraceFlag* tracer; - - /** all our subchannels */ - size_t num_subchannels; - grpc_lb_subchannel_data* subchannels; - - /** Index into subchannels of the one we're currently checking. - * Used when connecting to subchannels serially instead of in parallel. */ - // TODO(roth): When we have time, we can probably make this go away - // and compute the index dynamically by subtracting - // subchannel_list->subchannels from the subchannel_data pointer. - size_t checking_subchannel; - - /** how many subchannels are in state READY */ - size_t num_ready; - /** how many subchannels are in state TRANSIENT_FAILURE */ - size_t num_transient_failures; - /** how many subchannels are in state IDLE */ - size_t num_idle; - - /** There will be one ref for each entry in subchannels for which there is a - * pending connectivity state watcher callback. */ - gpr_refcount refcount; - - /** Is this list shutting down? This may be true due to the shutdown of the - * policy itself or because a newer update has arrived while this one hadn't - * finished processing. */ - bool shutting_down; +// FIXME: add comments + +namespace grpc_core { + +template +class SubchannelData { + public: + // Returns the index into subchannel_list_ of this object. + size_t Index() const { + return static_cast(static_cast(this) - + subchannel_list_->subchannel(0)); + } + + SubchannelListType* subchannel_list() const { return subchannel_list_; } + + grpc_subchannel* subchannel() const { return subchannel_; } + + ConnectedSubchannel* connected_subchannel() const { + return connected_subchannel_.get(); + } + +// FIXME: maybe do this automatically in OnConnectivityChangedLocked() +// when the new state is TRANSIENT_FAILURE? + void clear_connected_subchannel() { connected_subchannel_.reset(); } + + void GetConnectedSubchannelFromSubchannelLocked() { + connected_subchannel_ = + grpc_subchannel_get_connected_subchannel(subchannel_); + } + + void SetConnectedSubchannelFromLocked(SubchannelData* other) { + connected_subchannel_ = other->connected_subchannel_; // Adds ref. + } + + bool connectivity_notification_pending() const { + return connectivity_notification_pending_; + } + grpc_connectivity_state connectivity_state() const { + return curr_connectivity_state_; + } + + virtual grpc_connectivity_state CheckConnectivityStateLocked() { + pending_connectivity_state_unsafe_ = + grpc_subchannel_check_connectivity(subchannel(), nullptr); + curr_connectivity_state_ = pending_connectivity_state_unsafe_; + return curr_connectivity_state_; + } + + // Unrefs the subchannel. + virtual void UnrefSubchannelLocked(const char* reason); + + /// Starts watching the connectivity state of the subchannel. + /// The connectivity_changed_cb callback must invoke either + /// StopConnectivityWatch() or again call StartConnectivityWatch(). + void StartConnectivityWatchLocked(); + + /// Stops watching the connectivity state of the subchannel. + void StopConnectivityWatchLocked(); + + /// Cancels watching the connectivity state of the subchannel. + void CancelConnectivityWatchLocked(const char* reason); + + void ShutdownLocked(const char* reason); + + GRPC_ABSTRACT_BASE_CLASS + + protected: + SubchannelData( + SubchannelListType* subchannel_list, + const grpc_lb_user_data_vtable* user_data_vtable, + const grpc_lb_address& address, grpc_subchannel* subchannel, + grpc_combiner* combiner); + + virtual ~SubchannelData(); + +// FIXME: define API + virtual void ProcessConnectivityChangeLocked(grpc_error* error) GRPC_ABSTRACT; + + private: + static void OnConnectivityChangedLocked(void* arg, grpc_error* error); + + // Backpointer to owning subchannel list. Not owned. + SubchannelListType* subchannel_list_; + + // The subchannel and connected subchannel. + grpc_subchannel* subchannel_; + RefCountedPtr connected_subchannel_; + + // Notification that connectivity has changed on subchannel. + grpc_closure connectivity_changed_closure_; + // Is a connectivity notification pending? + bool connectivity_notification_pending_; + // Connectivity state to be updated by + // grpc_subchannel_notify_on_state_change(), not guarded by + // the combiner. Will be copied to \a curr_connectivity_state_ by + // \a connectivity_changed_closure_. + grpc_connectivity_state pending_connectivity_state_unsafe_; + // Current connectivity state. + grpc_connectivity_state curr_connectivity_state_; }; -grpc_lb_subchannel_list* grpc_lb_subchannel_list_create( - grpc_core::LoadBalancingPolicy* p, grpc_core::TraceFlag* tracer, +template +class SubchannelList + : public RefCountedWithTracing { + public: + typedef InlinedVector SubchannelVector; + + size_t num_subchannels() const { return subchannels_.size(); } + SubchannelDataType* subchannel(size_t index) { return &subchannels_[index]; } + + // Marks the subchannel_list as discarded. Unsubscribes all its subchannels. + void ShutdownLocked(const char* reason); + + bool shutting_down() const { return shutting_down_; } + + LoadBalancingPolicy* policy() const { return policy_; } + TraceFlag* tracer() const { return tracer_; } + + GRPC_ABSTRACT_BASE_CLASS + + protected: + SubchannelList(LoadBalancingPolicy* policy, TraceFlag* tracer, + const grpc_lb_addresses* addresses, grpc_combiner* combiner, + grpc_client_channel_factory* client_channel_factory, + const grpc_channel_args& args); + + virtual ~SubchannelList(); + + private: + // So New() can call our private ctor. + template + friend T* New(Args&&... args); + + // Backpointer to owning policy. + LoadBalancingPolicy* policy_; + + TraceFlag* tracer_; + + // The list of subchannels. + SubchannelVector subchannels_; + + // Is this list shutting down? This may be true due to the shutdown of the + // policy itself or because a newer update has arrived while this one hadn't + // finished processing. + bool shutting_down_ = false; +}; + +// +// implementation -- no user-servicable parts below +// + +// +// SubchannelData +// + +template +SubchannelData::SubchannelData( + SubchannelListType* subchannel_list, + const grpc_lb_user_data_vtable* user_data_vtable, + const grpc_lb_address& address, grpc_subchannel* subchannel, + grpc_combiner* combiner) + : subchannel_list_(subchannel_list), + subchannel_(subchannel), + // We assume that the current state is IDLE. If not, we'll get a + // callback telling us that. + pending_connectivity_state_unsafe_(GRPC_CHANNEL_IDLE), + curr_connectivity_state_(GRPC_CHANNEL_IDLE) { + GRPC_CLOSURE_INIT( + &connectivity_changed_closure_, + (&SubchannelData::OnConnectivityChangedLocked), + this, grpc_combiner_scheduler(combiner)); +} + +template +SubchannelData::~SubchannelData() { + UnrefSubchannelLocked("subchannel_data_destroy"); +} + +template +void SubchannelData::UnrefSubchannelLocked( + const char* reason) { + if (subchannel_ != nullptr) { + if (subchannel_list_->tracer()->enabled()) { + gpr_log(GPR_DEBUG, + "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR + " (subchannel %p): unreffing subchannel", + subchannel_list_->tracer()->name(), subchannel_list_->policy(), + subchannel_list_, Index(), + subchannel_list_->num_subchannels(), subchannel_); + } + GRPC_SUBCHANNEL_UNREF(subchannel_, reason); + subchannel_ = nullptr; + connected_subchannel_.reset(); + } +} + +template +void SubchannelData::StartConnectivityWatchLocked() { + if (subchannel_list_->tracer()->enabled()) { + gpr_log( + GPR_DEBUG, + "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR + " (subchannel %p): requesting connectivity change " + "notification (from %s)", + subchannel_list_->tracer()->name(), subchannel_list_->policy(), + subchannel_list_, Index(), + subchannel_list_->num_subchannels(), subchannel_, + grpc_connectivity_state_name(pending_connectivity_state_unsafe_)); + } + connectivity_notification_pending_ = true; + grpc_subchannel_notify_on_state_change( + subchannel_, subchannel_list_->policy()->interested_parties(), + &pending_connectivity_state_unsafe_, + &connectivity_changed_closure_); +} + +template +void SubchannelData::StopConnectivityWatchLocked() { + if (subchannel_list_->tracer()->enabled()) { + gpr_log(GPR_DEBUG, + "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR + " (subchannel %p): stopping connectivity watch", + subchannel_list_->tracer()->name(), subchannel_list_->policy(), + subchannel_list_, Index(), + subchannel_list_->num_subchannels(), subchannel_); + } + GPR_ASSERT(connectivity_notification_pending_); + connectivity_notification_pending_ = false; +} + +template +void SubchannelData::CancelConnectivityWatchLocked( + const char* reason) { + if (subchannel_list_->tracer()->enabled()) { + gpr_log(GPR_DEBUG, + "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR + " (subchannel %p): canceling connectivity watch (%s)", + subchannel_list_->tracer()->name(), subchannel_list_->policy(), + subchannel_list_, Index(), + subchannel_list_->num_subchannels(), subchannel_, reason); + } + grpc_subchannel_notify_on_state_change(subchannel_, nullptr, nullptr, + &connectivity_changed_closure_); +} + +template +void SubchannelData::OnConnectivityChangedLocked( + void* arg, grpc_error* error) { + SubchannelData* sd = static_cast(arg); + // Now that we're inside the combiner, copy the pending connectivity + // state (which was set by the connectivity state watcher) to + // curr_connectivity_state_, which is what we use inside of the combiner. + sd->curr_connectivity_state_ = sd->pending_connectivity_state_unsafe_; + sd->ProcessConnectivityChangeLocked(error); +} + +template +void SubchannelData::ShutdownLocked(const char* reason) { + // If there's a pending notification for this subchannel, cancel it; + // the callback is responsible for unreffing the subchannel. + // Otherwise, unref the subchannel directly. + if (connectivity_notification_pending_) { + CancelConnectivityWatchLocked(reason); + } else if (subchannel_ != nullptr) { + UnrefSubchannelLocked(reason); + } +} + +// +// SubchannelList +// + +template +SubchannelList::SubchannelList( + LoadBalancingPolicy* policy, TraceFlag* tracer, const grpc_lb_addresses* addresses, grpc_combiner* combiner, grpc_client_channel_factory* client_channel_factory, - const grpc_channel_args& args, grpc_iomgr_cb_func connectivity_changed_cb); + const grpc_channel_args& args) + : RefCountedWithTracing(tracer), + policy_(policy), + tracer_(tracer) { + if (tracer_->enabled()) { + gpr_log(GPR_DEBUG, + "[%s %p] Creating subchannel list %p for %" PRIuPTR " subchannels", + tracer_->name(), policy, this, addresses->num_addresses); + } + subchannels_.reserve(addresses->num_addresses); + // We need to remove the LB addresses in order to be able to compare the + // subchannel keys of subchannels from a different batch of addresses. + static const char* keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS, + GRPC_ARG_LB_ADDRESSES}; + // Create a subchannel for each address. + grpc_subchannel_args sc_args; + for (size_t i = 0; i < addresses->num_addresses; i++) { + // If there were any balancer, we would have chosen grpclb policy instead. + GPR_ASSERT(!addresses->addresses[i].is_balancer); + memset(&sc_args, 0, sizeof(grpc_subchannel_args)); + grpc_arg addr_arg = + grpc_create_subchannel_address_arg(&addresses->addresses[i].address); + grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove( + &args, keys_to_remove, GPR_ARRAY_SIZE(keys_to_remove), &addr_arg, 1); + gpr_free(addr_arg.value.string); + sc_args.args = new_args; + grpc_subchannel* subchannel = grpc_client_channel_factory_create_subchannel( + client_channel_factory, &sc_args); + grpc_channel_args_destroy(new_args); + if (subchannel == nullptr) { + // Subchannel could not be created. + if (tracer_->enabled()) { + char* address_uri = + grpc_sockaddr_to_uri(&addresses->addresses[i].address); + gpr_log(GPR_DEBUG, + "[%s %p] could not create subchannel for address uri %s, " + "ignoring", + tracer_->name(), policy_, address_uri); + gpr_free(address_uri); + } + continue; + } + if (tracer_->enabled()) { + char* address_uri = + grpc_sockaddr_to_uri(&addresses->addresses[i].address); + gpr_log(GPR_DEBUG, + "[%s %p] subchannel list %p index %" PRIuPTR + ": Created subchannel %p for address uri %s", + tracer_->name(), policy_, this, subchannels_.size(), subchannel, + address_uri); + gpr_free(address_uri); + } + subchannels_.emplace_back(static_cast(this), + addresses->user_data_vtable, + addresses->addresses[i], subchannel, combiner); + } +} -void grpc_lb_subchannel_list_ref(grpc_lb_subchannel_list* subchannel_list, - const char* reason); +template +SubchannelList::~SubchannelList() { + if (tracer_->enabled()) { + gpr_log(GPR_DEBUG, "[%s %p] Destroying subchannel_list %p", + tracer_->name(), policy_, this); + } +} -void grpc_lb_subchannel_list_unref(grpc_lb_subchannel_list* subchannel_list, - const char* reason); +template +void SubchannelList::ShutdownLocked(const char* reason) { + if (tracer_->enabled()) { + gpr_log(GPR_DEBUG, "[%s %p] Shutting down subchannel_list %p (%s)", + tracer_->name(), policy_, this, reason); + } + GPR_ASSERT(!shutting_down_); + shutting_down_ = true; + for (size_t i = 0; i < subchannels_.size(); i++) { + SubchannelDataType* sd = &subchannels_[i]; + sd->ShutdownLocked(reason); + } +} -/// Mark subchannel_list as discarded. Unsubscribes all its subchannels. The -/// connectivity state notification callback will ultimately unref it. -void grpc_lb_subchannel_list_shutdown_and_unref( - grpc_lb_subchannel_list* subchannel_list, const char* reason); +} // namespace grpc_core #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_SUBCHANNEL_LIST_H */ diff --git a/src/core/lib/gprpp/inlined_vector.h b/src/core/lib/gprpp/inlined_vector.h index ca95aecddcb..f36f6cb7066 100644 --- a/src/core/lib/gprpp/inlined_vector.h +++ b/src/core/lib/gprpp/inlined_vector.h @@ -54,43 +54,43 @@ class InlinedVector { InlinedVector(const InlinedVector&) = delete; InlinedVector& operator=(const InlinedVector&) = delete; + T* data() { + return dynamic_ != nullptr ? dynamic_ : reinterpret_cast(inline_); + } + + const T* data() const { + return dynamic_ != nullptr ? dynamic_ : reinterpret_cast(inline_); + } + T& operator[](size_t offset) { assert(offset < size_); - if (offset < N) { - return *reinterpret_cast(inline_ + offset); - } else { - return dynamic_[offset - N]; - } + return data()[offset]; } const T& operator[](size_t offset) const { assert(offset < size_); - if (offset < N) { - return *reinterpret_cast(inline_ + offset); - } else { - return dynamic_[offset - N]; + return data()[offset]; + } + + void reserve(size_t capacity) { + if (capacity > capacity_) { + T* new_dynamic = static_cast(gpr_malloc(sizeof(T) * capacity)); + for (size_t i = 0; i < size_; ++i) { + new (&new_dynamic[i]) T(std::move(data()[i])); + data()[i].~T(); + } + gpr_free(dynamic_); + dynamic_ = new_dynamic; + capacity_ = capacity; } } template void emplace_back(Args&&... args) { - if (size_ < N) { - new (&inline_[size_]) T(std::forward(args)...); - } else { - if (size_ - N == dynamic_capacity_) { - size_t new_capacity = - dynamic_capacity_ == 0 ? 2 : dynamic_capacity_ * 2; - T* new_dynamic = static_cast(gpr_malloc(sizeof(T) * new_capacity)); - for (size_t i = 0; i < dynamic_capacity_; ++i) { - new (&new_dynamic[i]) T(std::move(dynamic_[i])); - dynamic_[i].~T(); - } - gpr_free(dynamic_); - dynamic_ = new_dynamic; - dynamic_capacity_ = new_capacity; - } - new (&dynamic_[size_ - N]) T(std::forward(args)...); + if (size_ == capacity_) { + reserve(capacity_ * 2); } + new (&(data()[size_])) T(std::forward(args)...); ++size_; } @@ -99,6 +99,7 @@ class InlinedVector { void push_back(T&& value) { emplace_back(std::move(value)); } size_t size() const { return size_; } + size_t capacity() const { return capacity_; } void clear() { destroy_elements(); @@ -109,26 +110,21 @@ class InlinedVector { void init_data() { dynamic_ = nullptr; size_ = 0; - dynamic_capacity_ = 0; + capacity_ = N; } void destroy_elements() { - for (size_t i = 0; i < size_ && i < N; ++i) { - T& value = *reinterpret_cast(inline_ + i); + for (size_t i = 0; i < size_; ++i) { + T& value = data()[i]; value.~T(); } - if (size_ > N) { // Avoid subtracting two signed values. - for (size_t i = 0; i < size_ - N; ++i) { - dynamic_[i].~T(); - } - } gpr_free(dynamic_); } typename std::aligned_storage::type inline_[N]; T* dynamic_; size_t size_; - size_t dynamic_capacity_; + size_t capacity_; }; } // namespace grpc_core diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index b1f9d2018ed..234f7634e2a 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -344,7 +344,6 @@ CORE_SOURCE_FILES = [ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', - 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc', diff --git a/test/core/gprpp/inlined_vector_test.cc b/test/core/gprpp/inlined_vector_test.cc index 2a357420f38..ae349477187 100644 --- a/test/core/gprpp/inlined_vector_test.cc +++ b/test/core/gprpp/inlined_vector_test.cc @@ -33,6 +33,7 @@ TEST(InlinedVectorTest, CreateAndIterate) { EXPECT_EQ(static_cast(kNumElements), v.size()); for (int i = 0; i < kNumElements; ++i) { EXPECT_EQ(i, v[i]); + EXPECT_EQ(i, &v[i] - &v[0]); // Ensure contiguous allocation. } } diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index b5869a6231e..b28641156fa 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -895,7 +895,6 @@ src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balan src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ -src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc \ src/core/ext/filters/client_channel/lb_policy/subchannel_list.h \ src/core/ext/filters/client_channel/lb_policy_factory.cc \ src/core/ext/filters/client_channel/lb_policy_factory.h \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 0f5a232b527..fb2b2eb806c 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -9836,7 +9836,6 @@ "language": "c", "name": "grpc_lb_subchannel_list", "src": [ - "src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc", "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h" ], "third_party": false, From db0a475df0f5f866af062177d9e190df9e0a5803 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 30 Mar 2018 14:44:27 -0700 Subject: [PATCH 004/165] more WIP --- .../lb_policy/pick_first/pick_first.cc | 2 +- .../lb_policy/round_robin/round_robin.cc | 17 ++++++++------ .../lb_policy/subchannel_list.h | 23 +++++++++++-------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index b593f93d7b9..5fd4cade9ef 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -508,7 +508,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( case GRPC_CHANNEL_READY: { // Case 2. Promote p->latest_pending_subchannel_list_ to // p->subchannel_list_. - GetConnectedSubchannelFromSubchannelLocked(); + SetConnectedSubchannelFromSubchannelLocked(); if (p->latest_pending_subchannel_list_ == subchannel_list()) { GPR_ASSERT(p->subchannel_list_ != nullptr); p->subchannel_list_->ShutdownLocked("finish_update"); diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index a9d9227ea52..c697ebb402b 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -477,10 +477,11 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( if (grpc_lb_round_robin_trace.enabled()) { gpr_log( GPR_DEBUG, - "[RR %p] connectivity changed for subchannel %p, subchannel_list %p: " - "prev_state=%s new_state=%s p->shutdown=%d " - "sd->subchannel_list->shutting_down=%d error=%s", - p, subchannel(), subchannel_list(), + "[RR %p] connectivity changed for subchannel %p, subchannel_list %p " + "(index %" PRIuPTR " of %" PRIuPTR "): prev_state=%s new_state=%s " + "p->shutdown=%d sd->subchannel_list->shutting_down=%d error=%s", + p, subchannel(), subchannel_list(), Index(), + subchannel_list()->num_subchannels(), grpc_connectivity_state_name(prev_connectivity_state_), grpc_connectivity_state_name(connectivity_state()), p->shutdown_, subchannel_list()->shutting_down(), @@ -510,7 +511,6 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( // subchannel, if any. switch (connectivity_state()) { case GRPC_CHANNEL_TRANSIENT_FAILURE: { - clear_connected_subchannel(); if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, "[RR %p] Subchannel %p has gone into TRANSIENT_FAILURE. " @@ -522,7 +522,7 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( } case GRPC_CHANNEL_READY: { if (connected_subchannel() == nullptr) { - GetConnectedSubchannelFromSubchannelLocked(); + SetConnectedSubchannelFromSubchannelLocked(); } if (p->subchannel_list_ != subchannel_list()) { // promote subchannel_list() to p->subchannel_list_. @@ -657,13 +657,16 @@ void RoundRobin::UpdateLocked(const grpc_channel_args& args) { } if (started_picking_) { for (size_t i = 0; i < subchannel_list->num_subchannels(); ++i) { +// FIXME: this is wrong, because we should not reset +// curr_connectivity_state_ or pending_connectivity_state_unsafe_ unless +// the new state is TRANSIENT_FAILURE const grpc_connectivity_state subchannel_state = subchannel_list->subchannel(i)->CheckConnectivityStateLocked(); // Override the default setting of IDLE for connectivity notification // purposes if the subchannel is already in transient failure. Otherwise // we'd be immediately notified of the IDLE-TRANSIENT_FAILURE // discrepancy, attempt to re-resolve, and end up here again. -// FIXME +// FIXME: do this // TODO(roth): As part of C++-ifying the subchannel_list API, design a // better API for notifying the LB policy of subchannel states, which can // be used both for the subchannel's initial state and for subsequent diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index d717ba0e371..0824fe373c6 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -59,22 +59,22 @@ class SubchannelData { return connected_subchannel_.get(); } -// FIXME: maybe do this automatically in OnConnectivityChangedLocked() -// when the new state is TRANSIENT_FAILURE? - void clear_connected_subchannel() { connected_subchannel_.reset(); } - - void GetConnectedSubchannelFromSubchannelLocked() { + void SetConnectedSubchannelFromSubchannelLocked() { connected_subchannel_ = grpc_subchannel_get_connected_subchannel(subchannel_); } + // An alternative to SetConnectedSubchannelFromSubchannelLocked() for + // cases where we are retaining a connected subchannel from a previous + // subchannel list. This is slightly more efficient than getting the + // connected subchannel from the subchannel, because that approach + // requires the use of a mutex, whereas this one only mutates a + // refcount. void SetConnectedSubchannelFromLocked(SubchannelData* other) { + GPR_ASSERT(subchannel_ == other->subchannel_); connected_subchannel_ = other->connected_subchannel_; // Adds ref. } - bool connectivity_notification_pending() const { - return connectivity_notification_pending_; - } grpc_connectivity_state connectivity_state() const { return curr_connectivity_state_; } @@ -87,6 +87,7 @@ class SubchannelData { } // Unrefs the subchannel. +// FIXME: move this to private in favor of ShutdownLocked()? virtual void UnrefSubchannelLocked(const char* reason); /// Starts watching the connectivity state of the subchannel. @@ -129,7 +130,7 @@ class SubchannelData { // Notification that connectivity has changed on subchannel. grpc_closure connectivity_changed_closure_; // Is a connectivity notification pending? - bool connectivity_notification_pending_; + bool connectivity_notification_pending_ = false; // Connectivity state to be updated by // grpc_subchannel_notify_on_state_change(), not guarded by // the combiner. Will be copied to \a curr_connectivity_state_ by @@ -297,6 +298,10 @@ void SubchannelDatacurr_connectivity_state_ = sd->pending_connectivity_state_unsafe_; + // If we get TRANSIENT_FAILURE, unref the connected subchannel. + if (sd->curr_connectivity_state_ == GRPC_CHANNEL_TRANSIENT_FAILURE) { + sd->connected_subchannel_.reset(); + } sd->ProcessConnectivityChangeLocked(error); } From 1fd44337fc117429955a84b53f2efdee89a15c60 Mon Sep 17 00:00:00 2001 From: Sree Kuchibhotla Date: Fri, 30 Mar 2018 15:41:14 -0700 Subject: [PATCH 005/165] Shutdown documentation --- src/core/lib/surface/server.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index f7505c888ec..cb34def7403 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -1161,6 +1161,22 @@ static void listener_destroy_done(void* s, grpc_error* error) { gpr_mu_unlock(&server->mu_global); } +/* + - Kills all pending requests-for-incoming-RPC-calls (i.e the requests made via + grpc_server_request_call and grpc_server_request_registered call will now be + cancelled). See 'kill_pending_work_locked()' + + - Shuts down the listeners (i.e the server will no longer listen on the port + for new incoming channels). + + - Iterates through all channels on the server and sends shutdown msg (see + 'channel_broadcaster_shutdown()' for details) to the clients via the + transport layer. The transport layer then guarantees the following: + -- Sends shutdown to the client (for eg: HTTP2 transport sends GOAWAY) + -- If the server has outstanding calls that are in the process, the + connection is NOT closed until the server is done with all those calls + -- Once, there are no more calls in progress, the channel is closed + */ void grpc_server_shutdown_and_notify(grpc_server* server, grpc_completion_queue* cq, void* tag) { listener* l; From 5193e97100365ff8cfebf609afad3d2c8d09bb5d Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 3 Apr 2018 08:01:43 -0700 Subject: [PATCH 006/165] Avoid code duplication. --- .../lb_policy/round_robin/round_robin.cc | 73 ++++++++----------- 1 file changed, 29 insertions(+), 44 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index c697ebb402b..3a0937015e7 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -148,6 +148,7 @@ class RoundRobin : public LoadBalancingPolicy { void StartPickingLocked(); size_t GetNextReadySubchannelIndexLocked(); + bool DoPickLocked(PickState* pick); void UpdateLastReadySubchannelIndexLocked(size_t last_ready_index); void UpdateConnectivityStateLocked(grpc_connectivity_state state, grpc_error* error); @@ -351,6 +352,31 @@ void RoundRobin::ExitIdleLocked() { } } +bool RoundRobin::DoPickLocked(PickState* pick) { + const size_t next_ready_index = GetNextReadySubchannelIndexLocked(); + if (next_ready_index < subchannel_list_->num_subchannels()) { + /* readily available, report right away */ + RoundRobinSubchannelData* sd = + subchannel_list_->subchannel(next_ready_index); + pick->connected_subchannel = sd->connected_subchannel()->Ref(); + if (pick->user_data != nullptr) { + *pick->user_data = sd->user_data(); + } + if (grpc_lb_round_robin_trace.enabled()) { + gpr_log( + GPR_DEBUG, + "[RR %p] Picked target <-- Subchannel %p (connected %p) (sl %p, " + "index %" PRIuPTR ")", + this, sd->subchannel(), pick->connected_subchannel.get(), + sd->subchannel_list(), next_ready_index); + } + /* only advance the last picked pointer if the selection was used */ + UpdateLastReadySubchannelIndexLocked(next_ready_index); + return true; + } + return false; +} + bool RoundRobin::PickLocked(PickState* pick) { if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, "[RR %p] Trying to pick (shutdown: %d)", this, @@ -358,27 +384,7 @@ bool RoundRobin::PickLocked(PickState* pick) { } GPR_ASSERT(!shutdown_); if (subchannel_list_ != nullptr) { - const size_t next_ready_index = GetNextReadySubchannelIndexLocked(); - if (next_ready_index < subchannel_list_->num_subchannels()) { - /* readily available, report right away */ - RoundRobinSubchannelData* sd = - subchannel_list_->subchannel(next_ready_index); - pick->connected_subchannel = sd->connected_subchannel()->Ref(); - if (pick->user_data != nullptr) { - *pick->user_data = sd->user_data(); - } - if (grpc_lb_round_robin_trace.enabled()) { - gpr_log( - GPR_DEBUG, - "[RR %p] Picked target <-- Subchannel %p (connected %p) (sl %p, " - "index %" PRIuPTR ")", - this, sd->subchannel(), pick->connected_subchannel.get(), - sd->subchannel_list(), next_ready_index); - } - /* only advance the last picked pointer if the selection was used */ - UpdateLastReadySubchannelIndexLocked(next_ready_index); - return true; - } + if (DoPickLocked(pick)) return true; } /* no pick currently available. Save for later in list of pending picks */ if (!started_picking_) { @@ -548,32 +554,11 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( } p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); } - /* at this point we know there's at least one suitable subchannel. Go - * ahead and pick one and notify the pending suitors in - * p->pending_picks. This preemptively replicates rr_pick()'s actions. */ - const size_t next_ready_index = p->GetNextReadySubchannelIndexLocked(); - GPR_ASSERT(next_ready_index < p->subchannel_list_->num_subchannels()); - RoundRobinSubchannelData* selected = - p->subchannel_list_->subchannel(next_ready_index); - if (p->pending_picks_ != nullptr) { - // if the selected subchannel is going to be used for the pending - // picks, update the last picked pointer - p->UpdateLastReadySubchannelIndexLocked(next_ready_index); - } + // Drain pending picks. PickState* pick; while ((pick = p->pending_picks_)) { p->pending_picks_ = pick->next; - pick->connected_subchannel = selected->connected_subchannel()->Ref(); - if (pick->user_data != nullptr) { - *pick->user_data = selected->user_data(); - } - if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, - "[RR %p] Fulfilling pending pick. Target <-- subchannel %p " - "(subchannel_list %p, index %" PRIuPTR ")", - p, selected->subchannel(), p->subchannel_list_.get(), - next_ready_index); - } + GPR_ASSERT(p->DoPickLocked(pick)); GRPC_CLOSURE_SCHED(pick->on_complete, GRPC_ERROR_NONE); } break; From 8c93fc89fbe4f58f68e620655e619465d82a6129 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 3 Apr 2018 10:42:10 -0700 Subject: [PATCH 007/165] more WIP on RR --- .../lb_policy/round_robin/round_robin.cc | 338 +++++++++--------- .../lb_policy/subchannel_list.h | 12 +- 2 files changed, 173 insertions(+), 177 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 3a0937015e7..dc504a5a399 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -104,11 +104,6 @@ class RoundRobin : public LoadBalancingPolicy { void* user_data() const { return user_data_; } - grpc_connectivity_state CheckConnectivityStateLocked() override { - prev_connectivity_state_ = SubchannelData::CheckConnectivityStateLocked(); - return prev_connectivity_state_; - } - private: const grpc_lb_user_data_vtable* user_data_vtable_; void* user_data_ = nullptr; @@ -125,23 +120,27 @@ class RoundRobin : public LoadBalancingPolicy { grpc_client_channel_factory* client_channel_factory, const grpc_channel_args& args) : SubchannelList(policy, tracer, addresses, combiner, - client_channel_factory, args), - num_idle_(num_subchannels()) {} + client_channel_factory, args) {} void RefForConnectivityWatch(const char* reason); void UnrefForConnectivityWatch(const char* reason); + void StartWatchingLocked(); + void UpdateStateCountersLocked(grpc_connectivity_state old_state, grpc_connectivity_state new_state); - size_t num_ready() const { return num_ready_; } - size_t num_transient_failure() const { return num_transient_failure_; } - size_t num_idle() const { return num_idle_; } + void UpdateConnectivityStateLocked(); + + void UpdateOverallStateLocked(); + + bool initialized() const { return initialized_; } private: + bool initialized_ = false; size_t num_ready_ = 0; + size_t num_connecting_ = 0; size_t num_transient_failure_ = 0; - size_t num_idle_; }; void ShutdownLocked() override; @@ -149,9 +148,8 @@ class RoundRobin : public LoadBalancingPolicy { void StartPickingLocked(); size_t GetNextReadySubchannelIndexLocked(); bool DoPickLocked(PickState* pick); + void DrainPendingPicksLocked(); void UpdateLastReadySubchannelIndexLocked(size_t last_ready_index); - void UpdateConnectivityStateLocked(grpc_connectivity_state state, - grpc_error* error); /** list of subchannels */ RefCountedPtr subchannel_list_; @@ -170,7 +168,7 @@ class RoundRobin : public LoadBalancingPolicy { /** our connectivity state tracker */ grpc_connectivity_state_tracker state_tracker_; /** Index into subchannel_list_ for last pick. */ - size_t last_ready_subchannel_index_ = 0; + size_t last_ready_subchannel_index_ = 0; // FIXME: set to -1? }; RoundRobin::RoundRobin(const Args& args) : LoadBalancingPolicy(args) { @@ -338,12 +336,7 @@ void RoundRobin::CancelMatchingPicksLocked(uint32_t initial_metadata_flags_mask, void RoundRobin::StartPickingLocked() { started_picking_ = true; - for (size_t i = 0; i < subchannel_list_->num_subchannels(); i++) { - if (subchannel_list_->subchannel(i)->subchannel() != nullptr) { - subchannel_list_->RefForConnectivityWatch("connectivity_watch"); - subchannel_list_->subchannel(i)->StartConnectivityWatchLocked(); - } - } + subchannel_list_->StartWatchingLocked(); } void RoundRobin::ExitIdleLocked() { @@ -377,6 +370,15 @@ bool RoundRobin::DoPickLocked(PickState* pick) { return false; } +void RoundRobin::DrainPendingPicksLocked() { + PickState* pick; + while ((pick = pending_picks_)) { + pending_picks_ = pick->next; + GPR_ASSERT(DoPickLocked(pick)); + GRPC_CLOSURE_SCHED(pick->on_complete, GRPC_ERROR_NONE); + } +} + bool RoundRobin::PickLocked(PickState* pick) { if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, "[RR %p] Trying to pick (shutdown: %d)", this, @@ -395,44 +397,6 @@ bool RoundRobin::PickLocked(PickState* pick) { return false; } -/** Sets the policy's connectivity status based on that of the passed-in \a sd - * (the grpc_lb_subchannel_data associated with the updated subchannel) and the - * subchannel list \a sd belongs to (sd->subchannel_list). \a error will be used - * only if the policy transitions to state TRANSIENT_FAILURE. */ -void RoundRobin::UpdateConnectivityStateLocked(grpc_connectivity_state state, - grpc_error* error) { - /* In priority order. The first rule to match terminates the search (ie, if we - * are on rule n, all previous rules were unfulfilled). - * - * 1) RULE: ANY subchannel is READY => policy is READY. - * CHECK: subchannel_list->num_ready > 0. - * - * 2) RULE: ANY subchannel is CONNECTING => policy is CONNECTING. - * CHECK: sd->curr_connectivity_state == CONNECTING. - * - * 3) RULE: ALL subchannels are TRANSIENT_FAILURE => policy is - * TRANSIENT_FAILURE. - * CHECK: subchannel_list->num_transient_failures == - * subchannel_list->num_subchannels. - */ - if (subchannel_list_->num_ready() > 0) { - /* 1) READY */ - grpc_connectivity_state_set(&state_tracker_, GRPC_CHANNEL_READY, - GRPC_ERROR_NONE, "rr_ready"); - } else if (state == GRPC_CHANNEL_CONNECTING) { - /* 2) CONNECTING */ - grpc_connectivity_state_set(&state_tracker_, GRPC_CHANNEL_CONNECTING, - GRPC_ERROR_NONE, "rr_connecting"); - } else if (subchannel_list_->num_transient_failure() == - subchannel_list_->num_subchannels()) { - /* 3) TRANSIENT_FAILURE */ - grpc_connectivity_state_set(&state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, - GRPC_ERROR_REF(error), - "rr_exhausted_subchannels"); - } - GRPC_ERROR_UNREF(error); -} - void RoundRobin::RoundRobinSubchannelList::RefForConnectivityWatch( const char* reason) { // TODO(roth): We currently track these refs manually. Once the new @@ -454,6 +418,24 @@ void RoundRobin::RoundRobinSubchannelList::UnrefForConnectivityWatch( Unref(DEBUG_LOCATION, reason); } +void RoundRobin::RoundRobinSubchannelList::StartWatchingLocked() { +// FIXME: consider moving this to SubchannelList ctor +// FIXME: add explanatory comment +gpr_log(GPR_INFO, "BEFORE: CheckConnectivityStateLocked loop"); + for (size_t i = 0; i < num_subchannels(); ++i) { + subchannel(i)->CheckConnectivityStateLocked(); + } +gpr_log(GPR_INFO, "AFTER: CheckConnectivityStateLocked loop"); + initialized_ = true; + UpdateOverallStateLocked(); + for (size_t i = 0; i < num_subchannels(); i++) { + if (subchannel(i)->subchannel() != nullptr) { + RefForConnectivityWatch("connectivity_watch"); + subchannel(i)->StartConnectivityWatchLocked(); + } + } +} + void RoundRobin::RoundRobinSubchannelList::UpdateStateCountersLocked( grpc_connectivity_state old_state, grpc_connectivity_state new_state) { GPR_ASSERT(old_state != GRPC_CHANNEL_SHUTDOWN); @@ -461,19 +443,94 @@ void RoundRobin::RoundRobinSubchannelList::UpdateStateCountersLocked( if (old_state == GRPC_CHANNEL_READY) { GPR_ASSERT(num_ready_ > 0); --num_ready_; + } else if (old_state == GRPC_CHANNEL_CONNECTING) { + GPR_ASSERT(num_connecting_ > 0); + --num_connecting_; } else if (old_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { GPR_ASSERT(num_transient_failure_ > 0); --num_transient_failure_; - } else if (old_state == GRPC_CHANNEL_IDLE) { - GPR_ASSERT(num_idle_ > 0); - --num_idle_; } if (new_state == GRPC_CHANNEL_READY) { ++num_ready_; + } else if (new_state == GRPC_CHANNEL_CONNECTING) { + ++num_connecting_; } else if (new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { ++num_transient_failure_; - } else if (new_state == GRPC_CHANNEL_IDLE) { - ++num_idle_; + } +} + +/** Sets the policy's connectivity status based on that of the passed-in \a sd + * (the grpc_lb_subchannel_data associated with the updated subchannel) and the + * subchannel list \a sd belongs to (sd->subchannel_list). \a error will be used + * only if the policy transitions to state TRANSIENT_FAILURE. */ +void RoundRobin::RoundRobinSubchannelList::UpdateConnectivityStateLocked() { + RoundRobin* p = static_cast(policy()); + if (p->subchannel_list_ != this) return; + /* In priority order. The first rule to match terminates the search (ie, if we + * are on rule n, all previous rules were unfulfilled). + * + * 1) RULE: ANY subchannel is READY => policy is READY. + * CHECK: subchannel_list->num_ready > 0. + * + * 2) RULE: ANY subchannel is CONNECTING => policy is CONNECTING. + * CHECK: sd->curr_connectivity_state == CONNECTING. + * + * 3) RULE: ALL subchannels are TRANSIENT_FAILURE => policy is + * TRANSIENT_FAILURE. + * CHECK: subchannel_list->num_transient_failures == + * subchannel_list->num_subchannels. + */ + if (num_ready_ > 0) { + /* 1) READY */ + grpc_connectivity_state_set(&p->state_tracker_, GRPC_CHANNEL_READY, + GRPC_ERROR_NONE, "rr_ready"); + } else if (num_connecting_ > 0) { + /* 2) CONNECTING */ + grpc_connectivity_state_set(&p->state_tracker_, GRPC_CHANNEL_CONNECTING, + GRPC_ERROR_NONE, "rr_connecting"); + } else if (num_transient_failure_ == num_subchannels()) { + /* 3) TRANSIENT_FAILURE */ + grpc_connectivity_state_set(&p->state_tracker_, + GRPC_CHANNEL_TRANSIENT_FAILURE, + GRPC_ERROR_NONE, // FIXME: GRPC_ERROR_REF(error), + "rr_exhausted_subchannels"); + } +// FIXME: GRPC_ERROR_UNREF(error); +} + +void RoundRobin::RoundRobinSubchannelList::UpdateOverallStateLocked() { + RoundRobin* p = static_cast(policy()); + if (num_ready_ > 0) { + if (p->subchannel_list_ != this) { + // Promote this list to p->subchannel_list_. + // This list must be p->latest_pending_subchannel_list_, because we + // any previous update would have been shut down already and + // therefore weeded out in ProcessConnectivityChangeLocked(). + GPR_ASSERT(p->latest_pending_subchannel_list_ == this); + GPR_ASSERT(!shutting_down()); + if (grpc_lb_round_robin_trace.enabled()) { + const size_t old_num_subchannels = + p->subchannel_list_ != nullptr + ? p->subchannel_list_->num_subchannels() + : 0; + gpr_log(GPR_DEBUG, + "[RR %p] phasing out subchannel list %p (size %" PRIuPTR + ") in favor of %p (size %" PRIuPTR ")", + p, p->subchannel_list_.get(), old_num_subchannels, this, + num_subchannels()); + } + if (p->subchannel_list_ != nullptr) { + // Dispose of the current subchannel_list. + p->subchannel_list_->ShutdownLocked("sl_phase_out_shutdown"); + } + p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); + } + // Drain pending picks. + p->DrainPendingPicksLocked(); + } + // Only update connectivity based on the selected subchannel list. + if (p->subchannel_list_ == this) { + UpdateConnectivityStateLocked(); } } @@ -494,6 +551,8 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( grpc_error_string(error)); } GPR_ASSERT(subchannel() != nullptr); +// FIXME: this check may not be needed, because subchannel_list should +// always be shutting down if policy is shutting down // If the policy is shutting down, unref and return. if (p->shutdown_) { StopConnectivityWatchLocked(); @@ -508,59 +567,28 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( subchannel_list()->UnrefForConnectivityWatch("rr_sl_shutdown"); return; } - GPR_ASSERT(connectivity_state() != GRPC_CHANNEL_SHUTDOWN); - // If we're still here, the notification must be for a subchannel in - // either the current or latest pending subchannel lists. - GPR_ASSERT(p->subchannel_list_ == subchannel_list() || - p->latest_pending_subchannel_list_ == subchannel_list()); - // If the sd's new state is TRANSIENT_FAILURE, unref the *connected* - // subchannel, if any. + // Process the state change. switch (connectivity_state()) { case GRPC_CHANNEL_TRANSIENT_FAILURE: { - if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, - "[RR %p] Subchannel %p has gone into TRANSIENT_FAILURE. " - "Requesting re-resolution", - p, subchannel()); + // Only re-resolve if we're being called for a state update, not + // for initialization. Otherwise, if the subchannel was already + // in state TRANSIENT_FAILURE when the subchannel list was + // created, we'd wind up in a constant loop of re-resolution. + if (subchannel_list()->initialized()) { + if (grpc_lb_round_robin_trace.enabled()) { + gpr_log(GPR_DEBUG, + "[RR %p] Subchannel %p has gone into TRANSIENT_FAILURE. " + "Requesting re-resolution", + p, subchannel()); + } + p->TryReresolutionLocked(&grpc_lb_round_robin_trace, GRPC_ERROR_NONE); } - p->TryReresolutionLocked(&grpc_lb_round_robin_trace, GRPC_ERROR_NONE); break; } case GRPC_CHANNEL_READY: { if (connected_subchannel() == nullptr) { SetConnectedSubchannelFromSubchannelLocked(); } - if (p->subchannel_list_ != subchannel_list()) { - // promote subchannel_list() to p->subchannel_list_. - // subchannel_list() must be equal to - // p->latest_pending_subchannel_list_ because we have already filtered - // for subchannels belonging to outdated subchannel lists. - GPR_ASSERT(p->latest_pending_subchannel_list_ == subchannel_list()); - GPR_ASSERT(!subchannel_list()->shutting_down()); - if (grpc_lb_round_robin_trace.enabled()) { - const size_t num_subchannels = - p->subchannel_list_ != nullptr - ? p->subchannel_list_->num_subchannels() - : 0; - gpr_log(GPR_DEBUG, - "[RR %p] phasing out subchannel list %p (size %" PRIuPTR - ") in favor of %p (size %" PRIuPTR ")", - p, p->subchannel_list_.get(), num_subchannels, - subchannel_list(), subchannel_list()->num_subchannels()); - } - if (p->subchannel_list_ != nullptr) { - // dispose of the current subchannel_list - p->subchannel_list_->ShutdownLocked("sl_phase_out_shutdown"); - } - p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); - } - // Drain pending picks. - PickState* pick; - while ((pick = p->pending_picks_)) { - p->pending_picks_ = pick->next; - GPR_ASSERT(p->DoPickLocked(pick)); - GRPC_CLOSURE_SCHED(pick->on_complete, GRPC_ERROR_NONE); - } break; } case GRPC_CHANNEL_SHUTDOWN: @@ -572,13 +600,11 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( subchannel_list()->UpdateStateCountersLocked(prev_connectivity_state_, connectivity_state()); prev_connectivity_state_ = connectivity_state(); - // Only update connectivity based on the selected subchannel list. - if (p->subchannel_list_ == subchannel_list()) { - p->UpdateConnectivityStateLocked(connectivity_state(), - GRPC_ERROR_REF(error)); + // If not initializing, update overall state and renew notification. + if (subchannel_list()->initialized()) { + subchannel_list()->UpdateOverallStateLocked(); + StartConnectivityWatchLocked(); } - // Renew notification. - StartConnectivityWatchLocked(); } grpc_connectivity_state RoundRobin::CheckConnectivityLocked( @@ -621,75 +647,41 @@ void RoundRobin::UpdateLocked(const grpc_channel_args& args) { } return; } - grpc_lb_addresses* addresses = (grpc_lb_addresses*)arg->value.pointer.p; + grpc_lb_addresses* addresses = + static_cast(arg->value.pointer.p); if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, "[RR %p] received update with %" PRIuPTR " addresses", this, addresses->num_addresses); } - auto subchannel_list = MakeRefCounted( - this, &grpc_lb_round_robin_trace, addresses, combiner(), - client_channel_factory(), args); - if (subchannel_list->num_subchannels() == 0) { - grpc_connectivity_state_set( - &state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, - GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"), - "rr_update_empty"); - if (subchannel_list_ != nullptr) { - subchannel_list_->ShutdownLocked("sl_shutdown_empty_update"); + // Replace latest_pending_subchannel_list_. + if (latest_pending_subchannel_list_ != nullptr) { + if (grpc_lb_round_robin_trace.enabled()) { + gpr_log(GPR_DEBUG, + "[RR %p] Shutting down previous pending subchannel list %p", + this, latest_pending_subchannel_list_.get()); } - subchannel_list_ = std::move(subchannel_list); // empty list - return; + latest_pending_subchannel_list_->ShutdownLocked("sl_outdated"); } - if (started_picking_) { - for (size_t i = 0; i < subchannel_list->num_subchannels(); ++i) { -// FIXME: this is wrong, because we should not reset -// curr_connectivity_state_ or pending_connectivity_state_unsafe_ unless -// the new state is TRANSIENT_FAILURE - const grpc_connectivity_state subchannel_state = - subchannel_list->subchannel(i)->CheckConnectivityStateLocked(); - // Override the default setting of IDLE for connectivity notification - // purposes if the subchannel is already in transient failure. Otherwise - // we'd be immediately notified of the IDLE-TRANSIENT_FAILURE - // discrepancy, attempt to re-resolve, and end up here again. -// FIXME: do this - // TODO(roth): As part of C++-ifying the subchannel_list API, design a - // better API for notifying the LB policy of subchannel states, which can - // be used both for the subchannel's initial state and for subsequent - // state changes. This will allow us to handle this more generally instead - // of special-casing TRANSIENT_FAILURE (e.g., we can also distribute any - // pending picks across all READY subchannels rather than sending them all - // to the first one). - if (subchannel_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { - subchannel_list->UpdateStateCountersLocked(GRPC_CHANNEL_IDLE, - subchannel_state); - } - } - for (size_t i = 0; i < subchannel_list->num_subchannels(); ++i) { - /* Watch every new subchannel. A subchannel list becomes active the - * moment one of its subchannels is READY. At that moment, we swap - * p->subchannel_list for sd->subchannel_list, provided the subchannel - * list is still valid (ie, isn't shutting down) */ - subchannel_list->RefForConnectivityWatch("connectivity_watch"); - subchannel_list->subchannel(i)->StartConnectivityWatchLocked(); - } - if (latest_pending_subchannel_list_ != nullptr) { - if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, - "[RR %p] Shutting down latest pending subchannel list %p, " - "about to be replaced by newer latest %p", - this, latest_pending_subchannel_list_.get(), - subchannel_list.get()); - } - latest_pending_subchannel_list_->ShutdownLocked("sl_outdated"); + latest_pending_subchannel_list_ = MakeRefCounted( + this, &grpc_lb_round_robin_trace, addresses, combiner(), + client_channel_factory(), args); + // If we haven't started picking yet or the new list is empty, + // immediately promote the new list to the current list. + if (!started_picking_ || + latest_pending_subchannel_list_->num_subchannels() == 0) { + if (latest_pending_subchannel_list_->num_subchannels() == 0) { + grpc_connectivity_state_set( + &state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, + GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"), + "rr_update_empty"); } - latest_pending_subchannel_list_ = std::move(subchannel_list); - } else { - // The policy isn't picking yet. Save the update for later, disposing of - // previous version if any. if (subchannel_list_ != nullptr) { - subchannel_list_->ShutdownLocked("rr_update_before_started_picking"); + subchannel_list_->ShutdownLocked("sl_shutdown_replace_on_update"); } - subchannel_list_ = std::move(subchannel_list); + subchannel_list_ = std::move(latest_pending_subchannel_list_); + } else { + // If we've started picking, start watching the new list. + latest_pending_subchannel_list_->StartWatchingLocked(); } } diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index 0824fe373c6..c643f4cb4b4 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -79,11 +79,15 @@ class SubchannelData { return curr_connectivity_state_; } - virtual grpc_connectivity_state CheckConnectivityStateLocked() { + void CheckConnectivityStateLocked() { + GPR_ASSERT(!connectivity_notification_pending_); + grpc_error* error = GRPC_ERROR_NONE; pending_connectivity_state_unsafe_ = - grpc_subchannel_check_connectivity(subchannel(), nullptr); - curr_connectivity_state_ = pending_connectivity_state_unsafe_; - return curr_connectivity_state_; + grpc_subchannel_check_connectivity(subchannel(), &error); + if (pending_connectivity_state_unsafe_ != curr_connectivity_state_) { + curr_connectivity_state_ = pending_connectivity_state_unsafe_; + ProcessConnectivityChangeLocked(error); + } } // Unrefs the subchannel. From b572910677b8423e1acb4090daeed40346f7dc70 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 3 Apr 2018 10:49:48 -0700 Subject: [PATCH 008/165] Fix handling of connectivity state error in RR. --- .../lb_policy/round_robin/round_robin.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index dc504a5a399..6ed7201fbfd 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -122,13 +122,18 @@ class RoundRobin : public LoadBalancingPolicy { : SubchannelList(policy, tracer, addresses, combiner, client_channel_factory, args) {} + ~RoundRobinSubchannelList() { + GRPC_ERROR_UNREF(last_transient_failure_error_); + } + void RefForConnectivityWatch(const char* reason); void UnrefForConnectivityWatch(const char* reason); void StartWatchingLocked(); void UpdateStateCountersLocked(grpc_connectivity_state old_state, - grpc_connectivity_state new_state); + grpc_connectivity_state new_state, + grpc_error* transient_failure_error); void UpdateConnectivityStateLocked(); @@ -141,6 +146,7 @@ class RoundRobin : public LoadBalancingPolicy { size_t num_ready_ = 0; size_t num_connecting_ = 0; size_t num_transient_failure_ = 0; + grpc_error* last_transient_failure_error_ = GRPC_ERROR_NONE; }; void ShutdownLocked() override; @@ -437,7 +443,8 @@ gpr_log(GPR_INFO, "AFTER: CheckConnectivityStateLocked loop"); } void RoundRobin::RoundRobinSubchannelList::UpdateStateCountersLocked( - grpc_connectivity_state old_state, grpc_connectivity_state new_state) { + grpc_connectivity_state old_state, grpc_connectivity_state new_state, + grpc_error* transient_failure_error) { GPR_ASSERT(old_state != GRPC_CHANNEL_SHUTDOWN); GPR_ASSERT(new_state != GRPC_CHANNEL_SHUTDOWN); if (old_state == GRPC_CHANNEL_READY) { @@ -457,6 +464,8 @@ void RoundRobin::RoundRobinSubchannelList::UpdateStateCountersLocked( } else if (new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { ++num_transient_failure_; } + GRPC_ERROR_UNREF(last_transient_failure_error_); + last_transient_failure_error_ = transient_failure_error; } /** Sets the policy's connectivity status based on that of the passed-in \a sd @@ -492,10 +501,9 @@ void RoundRobin::RoundRobinSubchannelList::UpdateConnectivityStateLocked() { /* 3) TRANSIENT_FAILURE */ grpc_connectivity_state_set(&p->state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, - GRPC_ERROR_NONE, // FIXME: GRPC_ERROR_REF(error), + GRPC_ERROR_REF(last_transient_failure_error_), "rr_exhausted_subchannels"); } -// FIXME: GRPC_ERROR_UNREF(error); } void RoundRobin::RoundRobinSubchannelList::UpdateOverallStateLocked() { @@ -598,7 +606,8 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( } // Update state counters. subchannel_list()->UpdateStateCountersLocked(prev_connectivity_state_, - connectivity_state()); + connectivity_state(), + GRPC_ERROR_REF(error)); prev_connectivity_state_ = connectivity_state(); // If not initializing, update overall state and renew notification. if (subchannel_list()->initialized()) { From 3cfbd98d563ac6a96221f53d538c8e5061ad64d2 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 3 Apr 2018 11:05:31 -0700 Subject: [PATCH 009/165] More connectivity state cleanup. --- .../lb_policy/round_robin/round_robin.cc | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 6ed7201fbfd..43eba1b64a1 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -425,15 +425,21 @@ void RoundRobin::RoundRobinSubchannelList::UnrefForConnectivityWatch( } void RoundRobin::RoundRobinSubchannelList::StartWatchingLocked() { -// FIXME: consider moving this to SubchannelList ctor -// FIXME: add explanatory comment -gpr_log(GPR_INFO, "BEFORE: CheckConnectivityStateLocked loop"); + if (num_subchannels() == 0) return; + // Check current state of each subchannel synchronously, since any + // subchannel already used by some other channel may have a non-IDLE + // state. This will invoke ProcessConnectivityChangeLocked() for each + // subchannel whose state is not IDLE. However, because initialized_ + // is still false, the code there will (a) skip re-resolution for any + // subchannel in state TRANSIENT_FAILURE and (b) not call + // UpdateOverallStateLocked(). for (size_t i = 0; i < num_subchannels(); ++i) { subchannel(i)->CheckConnectivityStateLocked(); } -gpr_log(GPR_INFO, "AFTER: CheckConnectivityStateLocked loop"); + // Now set initialized_ to true and call UpdateOverallStateLocked(). initialized_ = true; UpdateOverallStateLocked(); + // Start connectivity watch for each subchannel. for (size_t i = 0; i < num_subchannels(); i++) { if (subchannel(i)->subchannel() != nullptr) { RefForConnectivityWatch("connectivity_watch"); @@ -468,12 +474,11 @@ void RoundRobin::RoundRobinSubchannelList::UpdateStateCountersLocked( last_transient_failure_error_ = transient_failure_error; } -/** Sets the policy's connectivity status based on that of the passed-in \a sd - * (the grpc_lb_subchannel_data associated with the updated subchannel) and the - * subchannel list \a sd belongs to (sd->subchannel_list). \a error will be used - * only if the policy transitions to state TRANSIENT_FAILURE. */ +// Sets the RR policy's connectivity state based on the current +// subchannel list. void RoundRobin::RoundRobinSubchannelList::UpdateConnectivityStateLocked() { RoundRobin* p = static_cast(policy()); + // Only set connectivity state if this is the current subchannel list. if (p->subchannel_list_ != this) return; /* In priority order. The first rule to match terminates the search (ie, if we * are on rule n, all previous rules were unfulfilled). @@ -536,10 +541,8 @@ void RoundRobin::RoundRobinSubchannelList::UpdateOverallStateLocked() { // Drain pending picks. p->DrainPendingPicksLocked(); } - // Only update connectivity based on the selected subchannel list. - if (p->subchannel_list_ == this) { - UpdateConnectivityStateLocked(); - } + // Update the RR policy's connectivity state if needed. + UpdateConnectivityStateLocked(); } void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( From e2620e14223f6aa823845f7422fe4241f6650d10 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 3 Apr 2018 11:09:58 -0700 Subject: [PATCH 010/165] Address a couple of FIXMEs. --- .../lb_policy/round_robin/round_robin.cc | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 43eba1b64a1..2cfd2d649f7 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -174,7 +174,7 @@ class RoundRobin : public LoadBalancingPolicy { /** our connectivity state tracker */ grpc_connectivity_state_tracker state_tracker_; /** Index into subchannel_list_ for last pick. */ - size_t last_ready_subchannel_index_ = 0; // FIXME: set to -1? + size_t last_ready_subchannel_index_ = -1; }; RoundRobin::RoundRobin(const Args& args) : LoadBalancingPolicy(args) { @@ -562,15 +562,6 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( grpc_error_string(error)); } GPR_ASSERT(subchannel() != nullptr); -// FIXME: this check may not be needed, because subchannel_list should -// always be shutting down if policy is shutting down - // If the policy is shutting down, unref and return. - if (p->shutdown_) { - StopConnectivityWatchLocked(); - UnrefSubchannelLocked("rr_shutdown"); - subchannel_list()->UnrefForConnectivityWatch("rr_shutdown"); - return; - } // If the subchannel list is shutting down, stop watching. if (subchannel_list()->shutting_down() || error == GRPC_ERROR_CANCELLED) { StopConnectivityWatchLocked(); From 485c4ba87c2f2cecce7e3104db7db5d50392be2a Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 3 Apr 2018 11:36:23 -0700 Subject: [PATCH 011/165] WIP on adding comments. --- .../lb_policy/round_robin/round_robin.cc | 12 ++- .../lb_policy/subchannel_list.h | 87 +++++++++++++++---- 2 files changed, 79 insertions(+), 20 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 2cfd2d649f7..89d9f670dfb 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -73,8 +73,15 @@ class RoundRobin : public LoadBalancingPolicy { private: ~RoundRobin(); + // Forward declaration. class RoundRobinSubchannelList; + // Data for a particular subchannel in a subchannel list. + // This subclass adds the following functionality: + // - Tracks user_data associated with each address, which will be + // returned along with picks that select the subchannel. + // - Tracks the previous connectivity state of the subchannel, so that + // we know how many subchannels are in each state. class RoundRobinSubchannelData : public SubchannelData { @@ -91,8 +98,6 @@ class RoundRobin : public LoadBalancingPolicy { ? user_data_vtable_->copy(address.user_data) : nullptr) {} - void ProcessConnectivityChangeLocked(grpc_error* error) override; - void UnrefSubchannelLocked(const char* reason) override { SubchannelData::UnrefSubchannelLocked(reason); if (user_data_ != nullptr) { @@ -105,11 +110,14 @@ class RoundRobin : public LoadBalancingPolicy { void* user_data() const { return user_data_; } private: + void ProcessConnectivityChangeLocked(grpc_error* error) override; + const grpc_lb_user_data_vtable* user_data_vtable_; void* user_data_ = nullptr; grpc_connectivity_state prev_connectivity_state_ = GRPC_CHANNEL_IDLE; }; + // A list of subchannels. class RoundRobinSubchannelList : public SubchannelList { diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index c643f4cb4b4..b647c5d4256 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -38,27 +38,63 @@ #include "src/core/lib/iomgr/sockaddr_utils.h" #include "src/core/lib/transport/connectivity_state.h" -// FIXME: add comments +// Code for maintaining a list of subchannels within an LB policy. +// +// To use this, callers must create their own subclasses, like so: +/* + +class MySubchannelList; // Forward declaration. + +class MySubchannelData + : public SubchannelData { + public: + void ProcessConnectivityChangeLocked(grpc_error* error) override { + // ...code to handle connectivity changes... + } +}; + +class MySubchannelList + : public SubchannelList { +}; + +*/ +// All methods with a Locked() suffix must be called from within the +// client_channel combiner. namespace grpc_core { +// Stores data for a particular subchannel in a subchannel list. +// Callers must create a subclass that implements the +// ProcessConnectivityChangeLocked() method. template class SubchannelData { public: - // Returns the index into subchannel_list_ of this object. + // Returns a pointer to the subchannel list containing this object. + SubchannelListType* subchannel_list() const { return subchannel_list_; } + + // Returns the index into the subchannel list of this object. size_t Index() const { return static_cast(static_cast(this) - subchannel_list_->subchannel(0)); } - SubchannelListType* subchannel_list() const { return subchannel_list_; } - + // Returns a pointer to the subchannel. grpc_subchannel* subchannel() const { return subchannel_; } + // Returns the connected subchannel. Will be null if the subchannel + // is not connected. ConnectedSubchannel* connected_subchannel() const { return connected_subchannel_.get(); } + // The current connectivity state. + // May be called from ProcessConnectivityChangeLocked() to determine + // the state that the subchannel has transitioned into. + grpc_connectivity_state connectivity_state() const { + return curr_connectivity_state_; + } + + // Sets the connected subchannel from the subchannel. void SetConnectedSubchannelFromSubchannelLocked() { connected_subchannel_ = grpc_subchannel_get_connected_subchannel(subchannel_); @@ -75,10 +111,11 @@ class SubchannelData { connected_subchannel_ = other->connected_subchannel_; // Adds ref. } - grpc_connectivity_state connectivity_state() const { - return curr_connectivity_state_; - } - + // Synchronously checks the subchannel's connectivity state. Calls + // ProcessConnectivityChangeLocked() if the state has changed. + // Must not be called while there is a connectivity notification + // pending (i.e., between calling StartConnectivityWatchLocked() and + // the resulting invocation of ProcessConnectivityChangeLocked()). void CheckConnectivityStateLocked() { GPR_ASSERT(!connectivity_notification_pending_); grpc_error* error = GRPC_ERROR_NONE; @@ -90,21 +127,28 @@ class SubchannelData { } } - // Unrefs the subchannel. -// FIXME: move this to private in favor of ShutdownLocked()? + // Unrefs the subchannel. May be used if an individual subchannel is + // no longer needed even though the subchannel list as a whole is not + // being unreffed. virtual void UnrefSubchannelLocked(const char* reason); - /// Starts watching the connectivity state of the subchannel. - /// The connectivity_changed_cb callback must invoke either - /// StopConnectivityWatch() or again call StartConnectivityWatch(). + // Starts or renewes watching the connectivity state of the subchannel. + // ProcessConnectivityChangeLocked() will be called when the + // connectivity state changes. void StartConnectivityWatchLocked(); - /// Stops watching the connectivity state of the subchannel. + // Stops watching the connectivity state of the subchannel. void StopConnectivityWatchLocked(); - /// Cancels watching the connectivity state of the subchannel. + // Cancels watching the connectivity state of the subchannel. + // Must be called only while there is a connectivity notification + // pending (i.e., between calling StartConnectivityWatchLocked() and + // the resulting invocation of ProcessConnectivityChangeLocked()). + // From within ProcessConnectivityChangeLocked(), use + // StopConnectivityWatchLocked() instead. void CancelConnectivityWatchLocked(const char* reason); + // Cancels any pending connectivity watch and unrefs the subchannel. void ShutdownLocked(const char* reason); GRPC_ABSTRACT_BASE_CLASS @@ -118,7 +162,12 @@ class SubchannelData { virtual ~SubchannelData(); -// FIXME: define API + // After StartConnectivityWatchLocked() is called, this method will be + // invoked when the subchannel's connectivity state changes. + // Implementations can use connectivity_state() to get the new + // connectivity state. + // Implementations must invoke either StopConnectivityWatch() or again + // call StartConnectivityWatch() before returning. virtual void ProcessConnectivityChangeLocked(grpc_error* error) GRPC_ABSTRACT; private: @@ -137,13 +186,15 @@ class SubchannelData { bool connectivity_notification_pending_ = false; // Connectivity state to be updated by // grpc_subchannel_notify_on_state_change(), not guarded by - // the combiner. Will be copied to \a curr_connectivity_state_ by - // \a connectivity_changed_closure_. + // the combiner. Will be copied to curr_connectivity_state_ by + // OnConnectivityChangedLocked(). grpc_connectivity_state pending_connectivity_state_unsafe_; // Current connectivity state. grpc_connectivity_state curr_connectivity_state_; }; +// A list of subchannels. +// FIXME: document more template class SubchannelList : public RefCountedWithTracing { From 9b620a2ee38306315fb6f915d0e8d4aab8856757 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 3 Apr 2018 11:57:45 -0700 Subject: [PATCH 012/165] more comments --- .../lb_policy/round_robin/round_robin.cc | 20 +++++++++++++++---- .../lb_policy/subchannel_list.h | 6 +++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 89d9f670dfb..63b10096c45 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -134,19 +134,30 @@ class RoundRobin : public LoadBalancingPolicy { GRPC_ERROR_UNREF(last_transient_failure_error_); } + // Manages references for connectivity watches. void RefForConnectivityWatch(const char* reason); void UnrefForConnectivityWatch(const char* reason); + // Starts watching the subchannels in this list. void StartWatchingLocked(); + // Updates the counters of subchannels in each state when a + // subchannel transitions from old_state to new_state. + // transient_failure_error is the error that is reported when + // new_state is TRANSIENT_FAILURE. void UpdateStateCountersLocked(grpc_connectivity_state old_state, grpc_connectivity_state new_state, grpc_error* transient_failure_error); - void UpdateConnectivityStateLocked(); + // If this subchannel list is the RR policy's current subchannel + // list, updates the RR policy's connectivity state based on the + // subchannel list's state counters. + void MaybeUpdateConnectivityStateLocked(); +// FIXME: rename and document void UpdateOverallStateLocked(); +// FIXME: rename started_watching bool initialized() const { return initialized_; } private: @@ -160,9 +171,9 @@ class RoundRobin : public LoadBalancingPolicy { void ShutdownLocked() override; void StartPickingLocked(); - size_t GetNextReadySubchannelIndexLocked(); bool DoPickLocked(PickState* pick); void DrainPendingPicksLocked(); + size_t GetNextReadySubchannelIndexLocked(); void UpdateLastReadySubchannelIndexLocked(size_t last_ready_index); /** list of subchannels */ @@ -484,7 +495,8 @@ void RoundRobin::RoundRobinSubchannelList::UpdateStateCountersLocked( // Sets the RR policy's connectivity state based on the current // subchannel list. -void RoundRobin::RoundRobinSubchannelList::UpdateConnectivityStateLocked() { +void +RoundRobin::RoundRobinSubchannelList::MaybeUpdateConnectivityStateLocked() { RoundRobin* p = static_cast(policy()); // Only set connectivity state if this is the current subchannel list. if (p->subchannel_list_ != this) return; @@ -550,7 +562,7 @@ void RoundRobin::RoundRobinSubchannelList::UpdateOverallStateLocked() { p->DrainPendingPicksLocked(); } // Update the RR policy's connectivity state if needed. - UpdateConnectivityStateLocked(); + MaybeUpdateConnectivityStateLocked(); } void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index b647c5d4256..5f7810d801e 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -194,21 +194,25 @@ class SubchannelData { }; // A list of subchannels. -// FIXME: document more template class SubchannelList : public RefCountedWithTracing { public: typedef InlinedVector SubchannelVector; + // The number of subchannels in the list. size_t num_subchannels() const { return subchannels_.size(); } + + // The data for the subchannel at a particular index. SubchannelDataType* subchannel(size_t index) { return &subchannels_[index]; } // Marks the subchannel_list as discarded. Unsubscribes all its subchannels. void ShutdownLocked(const char* reason); + // Returns true if the subchannel list is shutting down. bool shutting_down() const { return shutting_down_; } + // Accessors. LoadBalancingPolicy* policy() const { return policy_; } TraceFlag* tracer() const { return tracer_; } From 45afdedaa6122be29846226d1b5e1998f00a0510 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 3 Apr 2018 12:56:43 -0700 Subject: [PATCH 013/165] More cleanup. --- .../lb_policy/round_robin/round_robin.cc | 51 ++++++++++++------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 63b10096c45..06ca89c7231 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -141,6 +141,9 @@ class RoundRobin : public LoadBalancingPolicy { // Starts watching the subchannels in this list. void StartWatchingLocked(); + // Returns true if we have started watching. + bool started_watching() const { return started_watching_; } + // Updates the counters of subchannels in each state when a // subchannel transitions from old_state to new_state. // transient_failure_error is the error that is reported when @@ -154,14 +157,12 @@ class RoundRobin : public LoadBalancingPolicy { // subchannel list's state counters. void MaybeUpdateConnectivityStateLocked(); -// FIXME: rename and document + // Updates the RR policy's overall state based on the counters of + // subchannels in each state. void UpdateOverallStateLocked(); -// FIXME: rename started_watching - bool initialized() const { return initialized_; } - private: - bool initialized_ = false; + bool started_watching_ = false; size_t num_ready_ = 0; size_t num_connecting_ = 0; size_t num_transient_failure_ = 0; @@ -448,15 +449,27 @@ void RoundRobin::RoundRobinSubchannelList::StartWatchingLocked() { // Check current state of each subchannel synchronously, since any // subchannel already used by some other channel may have a non-IDLE // state. This will invoke ProcessConnectivityChangeLocked() for each - // subchannel whose state is not IDLE. However, because initialized_ - // is still false, the code there will (a) skip re-resolution for any - // subchannel in state TRANSIENT_FAILURE and (b) not call - // UpdateOverallStateLocked(). + // subchannel whose state is not IDLE. However, because started_watching_ + // is still false, the code there will do two special things: + // + // - It will skip re-resolution for any subchannel in state + // TRANSIENT_FAILURE, since doing this at start-watching-time would + // cause us to enter an endless loop of re-resolution (i.e., + // re-resolution would cause a new update, and the new update would + // immediately trigger a new re-resolution). + // + // - It will not call UpdateOverallStateLocked(); instead, we call + // that here after all subchannels have been checked. This allows us + // to act more intelligently based on the state of all subchannels, + // rather than just acting on the first one. For example, if there is + // more than one pending pick, this allows us to spread the picks + // across all READY subchannels rather than sending them all to the + // first subchannel that reports READY. for (size_t i = 0; i < num_subchannels(); ++i) { subchannel(i)->CheckConnectivityStateLocked(); } - // Now set initialized_ to true and call UpdateOverallStateLocked(). - initialized_ = true; + // Now set started_watching_ to true and call UpdateOverallStateLocked(). + started_watching_ = true; UpdateOverallStateLocked(); // Start connectivity watch for each subchannel. for (size_t i = 0; i < num_subchannels(); i++) { @@ -557,6 +570,7 @@ void RoundRobin::RoundRobinSubchannelList::UpdateOverallStateLocked() { p->subchannel_list_->ShutdownLocked("sl_phase_out_shutdown"); } p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); + p->last_ready_subchannel_index_ = -1; } // Drain pending picks. p->DrainPendingPicksLocked(); @@ -592,11 +606,11 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( // Process the state change. switch (connectivity_state()) { case GRPC_CHANNEL_TRANSIENT_FAILURE: { - // Only re-resolve if we're being called for a state update, not - // for initialization. Otherwise, if the subchannel was already - // in state TRANSIENT_FAILURE when the subchannel list was - // created, we'd wind up in a constant loop of re-resolution. - if (subchannel_list()->initialized()) { + // Only re-resolve if we've started watching, not at startup time. + // Otherwise, if the subchannel was already in state TRANSIENT_FAILURE + // when the subchannel list was created, we'd wind up in a constant + // loop of re-resolution. + if (subchannel_list()->started_watching()) { if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, "[RR %p] Subchannel %p has gone into TRANSIENT_FAILURE. " @@ -623,8 +637,8 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( connectivity_state(), GRPC_ERROR_REF(error)); prev_connectivity_state_ = connectivity_state(); - // If not initializing, update overall state and renew notification. - if (subchannel_list()->initialized()) { + // If we've started watching, update overall state and renew notification. + if (subchannel_list()->started_watching()) { subchannel_list()->UpdateOverallStateLocked(); StartConnectivityWatchLocked(); } @@ -702,6 +716,7 @@ void RoundRobin::UpdateLocked(const grpc_channel_args& args) { subchannel_list_->ShutdownLocked("sl_shutdown_replace_on_update"); } subchannel_list_ = std::move(latest_pending_subchannel_list_); + last_ready_subchannel_index_ = -1; } else { // If we've started picking, start watching the new list. latest_pending_subchannel_list_->StartWatchingLocked(); From 5dd42ab4bb15130d46a36df6c06da3d72a047ca2 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 4 Apr 2018 07:40:19 -0700 Subject: [PATCH 014/165] clang-format --- .../lb_policy/pick_first/pick_first.cc | 19 +++-- .../lb_policy/round_robin/round_robin.cc | 58 ++++++++------- .../lb_policy/subchannel_list.h | 71 +++++++++---------- 3 files changed, 69 insertions(+), 79 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 5fd4cade9ef..7d66d0acd9a 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -73,8 +73,8 @@ class PickFirst : public LoadBalancingPolicy { const grpc_lb_address& address, grpc_subchannel* subchannel, grpc_combiner* combiner) - : SubchannelData(subchannel_list, user_data_vtable, address, - subchannel, combiner) {} + : SubchannelData(subchannel_list, user_data_vtable, address, subchannel, + combiner) {} void ProcessConnectivityChangeLocked(grpc_error* error) override; }; @@ -83,11 +83,11 @@ class PickFirst : public LoadBalancingPolicy { : public SubchannelList { public: - PickFirstSubchannelList( - PickFirst* policy, TraceFlag* tracer, - const grpc_lb_addresses* addresses, grpc_combiner* combiner, - grpc_client_channel_factory* client_channel_factory, - const grpc_channel_args& args) + PickFirstSubchannelList(PickFirst* policy, TraceFlag* tracer, + const grpc_lb_addresses* addresses, + grpc_combiner* combiner, + grpc_client_channel_factory* client_channel_factory, + const grpc_channel_args& args) : SubchannelList(policy, tracer, addresses, combiner, client_channel_factory, args) {} @@ -430,9 +430,8 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( "sd->subchannel_list->shutting_down=%d error=%s", p, subchannel(), Index(), subchannel_list()->num_subchannels(), subchannel_list(), - grpc_connectivity_state_name(connectivity_state()), - p->shutdown_, subchannel_list()->shutting_down(), - grpc_error_string(error)); + grpc_connectivity_state_name(connectivity_state()), p->shutdown_, + subchannel_list()->shutting_down(), grpc_error_string(error)); } // If the policy is shutting down, unref and return. if (p->shutdown_) { diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 06ca89c7231..db093c8f53e 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -91,12 +91,12 @@ class RoundRobin : public LoadBalancingPolicy { const grpc_lb_address& address, grpc_subchannel* subchannel, grpc_combiner* combiner) - : SubchannelData(subchannel_list, user_data_vtable, address, - subchannel, combiner), + : SubchannelData(subchannel_list, user_data_vtable, address, subchannel, + combiner), user_data_vtable_(user_data_vtable), user_data_(user_data_vtable_ != nullptr - ? user_data_vtable_->copy(address.user_data) - : nullptr) {} + ? user_data_vtable_->copy(address.user_data) + : nullptr) {} void UnrefSubchannelLocked(const char* reason) override { SubchannelData::UnrefSubchannelLocked(reason); @@ -255,8 +255,8 @@ size_t RoundRobin::GetNextReadySubchannelIndexLocked() { gpr_log(GPR_DEBUG, "[RR %p] found next ready subchannel (%p) at index %" PRIuPTR " of subchannel_list %p", - this, subchannel_list_->subchannel(index)->subchannel(), - index, subchannel_list_.get()); + this, subchannel_list_->subchannel(index)->subchannel(), index, + subchannel_list_.get()); } return index; } @@ -272,13 +272,13 @@ void RoundRobin::UpdateLastReadySubchannelIndexLocked(size_t last_ready_index) { GPR_ASSERT(last_ready_index < subchannel_list_->num_subchannels()); last_ready_subchannel_index_ = last_ready_index; if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, - "[RR %p] setting last_ready_subchannel_index=%" PRIuPTR - " (SC %p, CSC %p)", - this, last_ready_index, - subchannel_list_->subchannel(last_ready_index)->subchannel(), - subchannel_list_->subchannel(last_ready_index) - ->connected_subchannel()); + gpr_log( + GPR_DEBUG, + "[RR %p] setting last_ready_subchannel_index=%" PRIuPTR + " (SC %p, CSC %p)", + this, last_ready_index, + subchannel_list_->subchannel(last_ready_index)->subchannel(), + subchannel_list_->subchannel(last_ready_index)->connected_subchannel()); } } @@ -382,12 +382,11 @@ bool RoundRobin::DoPickLocked(PickState* pick) { *pick->user_data = sd->user_data(); } if (grpc_lb_round_robin_trace.enabled()) { - gpr_log( - GPR_DEBUG, - "[RR %p] Picked target <-- Subchannel %p (connected %p) (sl %p, " - "index %" PRIuPTR ")", - this, sd->subchannel(), pick->connected_subchannel.get(), - sd->subchannel_list(), next_ready_index); + gpr_log(GPR_DEBUG, + "[RR %p] Picked target <-- Subchannel %p (connected %p) (sl %p, " + "index %" PRIuPTR ")", + this, sd->subchannel(), pick->connected_subchannel.get(), + sd->subchannel_list(), next_ready_index); } /* only advance the last picked pointer if the selection was used */ UpdateLastReadySubchannelIndexLocked(next_ready_index); @@ -508,8 +507,8 @@ void RoundRobin::RoundRobinSubchannelList::UpdateStateCountersLocked( // Sets the RR policy's connectivity state based on the current // subchannel list. -void -RoundRobin::RoundRobinSubchannelList::MaybeUpdateConnectivityStateLocked() { +void RoundRobin::RoundRobinSubchannelList:: + MaybeUpdateConnectivityStateLocked() { RoundRobin* p = static_cast(policy()); // Only set connectivity state if this is the current subchannel list. if (p->subchannel_list_ != this) return; @@ -586,14 +585,14 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( gpr_log( GPR_DEBUG, "[RR %p] connectivity changed for subchannel %p, subchannel_list %p " - "(index %" PRIuPTR " of %" PRIuPTR "): prev_state=%s new_state=%s " + "(index %" PRIuPTR " of %" PRIuPTR + "): prev_state=%s new_state=%s " "p->shutdown=%d sd->subchannel_list->shutting_down=%d error=%s", p, subchannel(), subchannel_list(), Index(), subchannel_list()->num_subchannels(), grpc_connectivity_state_name(prev_connectivity_state_), - grpc_connectivity_state_name(connectivity_state()), - p->shutdown_, subchannel_list()->shutting_down(), - grpc_error_string(error)); + grpc_connectivity_state_name(connectivity_state()), p->shutdown_, + subchannel_list()->shutting_down(), grpc_error_string(error)); } GPR_ASSERT(subchannel() != nullptr); // If the subchannel list is shutting down, stop watching. @@ -633,9 +632,8 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( case GRPC_CHANNEL_IDLE:; // fallthrough } // Update state counters. - subchannel_list()->UpdateStateCountersLocked(prev_connectivity_state_, - connectivity_state(), - GRPC_ERROR_REF(error)); + subchannel_list()->UpdateStateCountersLocked( + prev_connectivity_state_, connectivity_state(), GRPC_ERROR_REF(error)); prev_connectivity_state_ = connectivity_state(); // If we've started watching, update overall state and renew notification. if (subchannel_list()->started_watching()) { @@ -694,8 +692,8 @@ void RoundRobin::UpdateLocked(const grpc_channel_args& args) { if (latest_pending_subchannel_list_ != nullptr) { if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, - "[RR %p] Shutting down previous pending subchannel list %p", - this, latest_pending_subchannel_list_.get()); + "[RR %p] Shutting down previous pending subchannel list %p", this, + latest_pending_subchannel_list_.get()); } latest_pending_subchannel_list_->ShutdownLocked("sl_outdated"); } diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index 5f7810d801e..73d598e9f19 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -154,11 +154,10 @@ class SubchannelData { GRPC_ABSTRACT_BASE_CLASS protected: - SubchannelData( - SubchannelListType* subchannel_list, - const grpc_lb_user_data_vtable* user_data_vtable, - const grpc_lb_address& address, grpc_subchannel* subchannel, - grpc_combiner* combiner); + SubchannelData(SubchannelListType* subchannel_list, + const grpc_lb_user_data_vtable* user_data_vtable, + const grpc_lb_address& address, grpc_subchannel* subchannel, + grpc_combiner* combiner); virtual ~SubchannelData(); @@ -195,8 +194,7 @@ class SubchannelData { // A list of subchannels. template -class SubchannelList - : public RefCountedWithTracing { +class SubchannelList : public RefCountedWithTracing { public: typedef InlinedVector SubchannelVector; @@ -278,17 +276,16 @@ SubchannelData::~SubchannelData() { } template -void SubchannelData::UnrefSubchannelLocked( - const char* reason) { +void SubchannelData:: + UnrefSubchannelLocked(const char* reason) { if (subchannel_ != nullptr) { if (subchannel_list_->tracer()->enabled()) { gpr_log(GPR_DEBUG, "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR " (subchannel %p): unreffing subchannel", subchannel_list_->tracer()->name(), subchannel_list_->policy(), - subchannel_list_, Index(), - subchannel_list_->num_subchannels(), subchannel_); + subchannel_list_, Index(), subchannel_list_->num_subchannels(), + subchannel_); } GRPC_SUBCHANNEL_UNREF(subchannel_, reason); subchannel_ = nullptr; @@ -300,21 +297,19 @@ template void SubchannelData::StartConnectivityWatchLocked() { if (subchannel_list_->tracer()->enabled()) { - gpr_log( - GPR_DEBUG, - "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR - " (subchannel %p): requesting connectivity change " - "notification (from %s)", - subchannel_list_->tracer()->name(), subchannel_list_->policy(), - subchannel_list_, Index(), - subchannel_list_->num_subchannels(), subchannel_, - grpc_connectivity_state_name(pending_connectivity_state_unsafe_)); + gpr_log(GPR_DEBUG, + "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR + " (subchannel %p): requesting connectivity change " + "notification (from %s)", + subchannel_list_->tracer()->name(), subchannel_list_->policy(), + subchannel_list_, Index(), subchannel_list_->num_subchannels(), + subchannel_, + grpc_connectivity_state_name(pending_connectivity_state_unsafe_)); } connectivity_notification_pending_ = true; grpc_subchannel_notify_on_state_change( subchannel_, subchannel_list_->policy()->interested_parties(), - &pending_connectivity_state_unsafe_, - &connectivity_changed_closure_); + &pending_connectivity_state_unsafe_, &connectivity_changed_closure_); } template @@ -325,33 +320,31 @@ void SubchannelDatatracer()->name(), subchannel_list_->policy(), - subchannel_list_, Index(), - subchannel_list_->num_subchannels(), subchannel_); + subchannel_list_, Index(), subchannel_list_->num_subchannels(), + subchannel_); } GPR_ASSERT(connectivity_notification_pending_); connectivity_notification_pending_ = false; } template -void SubchannelData::CancelConnectivityWatchLocked( - const char* reason) { +void SubchannelData:: + CancelConnectivityWatchLocked(const char* reason) { if (subchannel_list_->tracer()->enabled()) { gpr_log(GPR_DEBUG, "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR " (subchannel %p): canceling connectivity watch (%s)", subchannel_list_->tracer()->name(), subchannel_list_->policy(), - subchannel_list_, Index(), - subchannel_list_->num_subchannels(), subchannel_, reason); + subchannel_list_, Index(), subchannel_list_->num_subchannels(), + subchannel_, reason); } grpc_subchannel_notify_on_state_change(subchannel_, nullptr, nullptr, &connectivity_changed_closure_); } template -void SubchannelData::OnConnectivityChangedLocked( - void* arg, grpc_error* error) { +void SubchannelData:: + OnConnectivityChangedLocked(void* arg, grpc_error* error) { SubchannelData* sd = static_cast(arg); // Now that we're inside the combiner, copy the pending connectivity // state (which was set by the connectivity state watcher) to @@ -365,8 +358,8 @@ void SubchannelData -void SubchannelData::ShutdownLocked(const char* reason) { +void SubchannelData::ShutdownLocked( + const char* reason) { // If there's a pending notification for this subchannel, cancel it; // the callback is responsible for unreffing the subchannel. // Otherwise, unref the subchannel directly. @@ -447,14 +440,14 @@ SubchannelList::SubchannelList( template SubchannelList::~SubchannelList() { if (tracer_->enabled()) { - gpr_log(GPR_DEBUG, "[%s %p] Destroying subchannel_list %p", - tracer_->name(), policy_, this); + gpr_log(GPR_DEBUG, "[%s %p] Destroying subchannel_list %p", tracer_->name(), + policy_, this); } } template -void SubchannelList::ShutdownLocked(const char* reason) { +void SubchannelList::ShutdownLocked( + const char* reason) { if (tracer_->enabled()) { gpr_log(GPR_DEBUG, "[%s %p] Shutting down subchannel_list %p (%s)", tracer_->name(), policy_, this, reason); From b7489ad6ee05172268b31213eabc4b44a2c82617 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 4 Apr 2018 07:50:00 -0700 Subject: [PATCH 015/165] Fix build failure. --- src/core/lib/slice/slice_weak_hash_table.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/lib/slice/slice_weak_hash_table.h b/src/core/lib/slice/slice_weak_hash_table.h index 9d0ddfc2d2a..dc3ccc5dadd 100644 --- a/src/core/lib/slice/slice_weak_hash_table.h +++ b/src/core/lib/slice/slice_weak_hash_table.h @@ -65,6 +65,10 @@ class SliceWeakHashTable : public RefCounted> { template friend T2* New(Args&&... args); + // So Delete() can call our private dtor. + template + friend void Delete(T2*); + SliceWeakHashTable() = default; ~SliceWeakHashTable() = default; From 99dbd7a975704135b0b4d20c43c57c6af90b7485 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 4 Apr 2018 14:05:53 -0700 Subject: [PATCH 016/165] Fix error refcounting. Remove unnecessary check in PF. --- .../client_channel/lb_policy/pick_first/pick_first.cc | 10 +++------- .../lb_policy/round_robin/round_robin.cc | 2 ++ .../filters/client_channel/lb_policy/subchannel_list.h | 4 +++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 7d66d0acd9a..03e5c892813 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -433,18 +433,12 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( grpc_connectivity_state_name(connectivity_state()), p->shutdown_, subchannel_list()->shutting_down(), grpc_error_string(error)); } - // If the policy is shutting down, unref and return. - if (p->shutdown_) { - StopConnectivityWatchLocked(); - UnrefSubchannelLocked("pf_shutdown"); - subchannel_list()->UnrefForConnectivityWatch("pf_shutdown"); - return; - } // If the subchannel list is shutting down, stop watching. if (subchannel_list()->shutting_down() || error == GRPC_ERROR_CANCELLED) { StopConnectivityWatchLocked(); UnrefSubchannelLocked("pf_sl_shutdown"); subchannel_list()->UnrefForConnectivityWatch("pf_sl_shutdown"); + GRPC_ERROR_UNREF(error); return; } // If we're still here, the notification must be for a subchannel in @@ -492,6 +486,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( StartConnectivityWatchLocked(); } } + GRPC_ERROR_UNREF(error); return; } // If we get here, there are two possible cases: @@ -574,6 +569,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( case GRPC_CHANNEL_SHUTDOWN: GPR_UNREACHABLE_CODE(break); } + GRPC_ERROR_UNREF(error); } // diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index db093c8f53e..555ae62aa2d 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -600,6 +600,7 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( StopConnectivityWatchLocked(); UnrefSubchannelLocked("rr_sl_shutdown"); subchannel_list()->UnrefForConnectivityWatch("rr_sl_shutdown"); + GRPC_ERROR_UNREF(error); return; } // Process the state change. @@ -640,6 +641,7 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( subchannel_list()->UpdateOverallStateLocked(); StartConnectivityWatchLocked(); } + GRPC_ERROR_UNREF(error); } grpc_connectivity_state RoundRobin::CheckConnectivityLocked( diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index 73d598e9f19..b3fc5fefe9c 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -124,6 +124,8 @@ class SubchannelData { if (pending_connectivity_state_unsafe_ != curr_connectivity_state_) { curr_connectivity_state_ = pending_connectivity_state_unsafe_; ProcessConnectivityChangeLocked(error); + } else { + GRPC_ERROR_UNREF(error); } } @@ -354,7 +356,7 @@ void SubchannelData:: if (sd->curr_connectivity_state_ == GRPC_CHANNEL_TRANSIENT_FAILURE) { sd->connected_subchannel_.reset(); } - sd->ProcessConnectivityChangeLocked(error); + sd->ProcessConnectivityChangeLocked(GRPC_ERROR_REF(error)); } template From b16fcf58e5908a18fa3f17180b7548a050b647f1 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Mon, 26 Mar 2018 10:57:31 -0700 Subject: [PATCH 017/165] Query ResultStore for tests instead of targets --- .../python_utils/upload_rbe_results.py | 126 ++++++++++-------- 1 file changed, 73 insertions(+), 53 deletions(-) diff --git a/tools/run_tests/python_utils/upload_rbe_results.py b/tools/run_tests/python_utils/upload_rbe_results.py index c959b50ac62..d3020248832 100644 --- a/tools/run_tests/python_utils/upload_rbe_results.py +++ b/tools/run_tests/python_utils/upload_rbe_results.py @@ -37,30 +37,13 @@ _RESULTS_SCHEMA = [ ('build_id', 'INTEGER', 'Build ID of Kokoro job'), ('build_url', 'STRING', 'URL of Kokoro build'), ('test_target', 'STRING', 'Bazel target path'), + ('test_case', 'STRING', 'Name of test case'), ('result', 'STRING', 'Test or build result'), - ('type', 'STRING', 'Type of Bazel target'), - ('language', 'STRING', 'Language of target'), ('timestamp', 'TIMESTAMP', 'Timestamp of test run'), - ('size', 'STRING', 'Size of Bazel target'), ] _TABLE_ID = 'rbe_test_results' -def _fill_missing_fields(target): - """Inserts 'N/A' to missing expected fields of Bazel target - - Args: - target: A dictionary of a Bazel target's ResultStore data - """ - if 'type' not in target['targetAttributes']: - target['targetAttributes']['type'] = 'N/A' - if 'language' not in target['targetAttributes']: - target['targetAttributes']['language'] = 'N/A' - if 'testAttributes' not in target: - target['testAttributes'] = {'size': 'N/A'} - return target - - def _get_api_key(): """Returns string with API key to access ResultStore. Intended to be used in Kokoro envrionment.""" @@ -114,6 +97,33 @@ def _upload_results_to_bq(rows): sys.exit(1) +def _get_resultstore_data(api_key, invocation_id): + """Returns dictionary of test results by querying ResultStore API. + Args: + api_key: String of ResultStore API key + invocation_id: String of ResultStore invocation ID to results from + """ + all_actions = [] + page_token = '' + # ResultStore's API returns data on a limited number of tests. When we exceed + # that limit, the 'nextPageToken' field is included in the request to get + # subsequent data, so keep requesting until 'nextPageToken' field is omitted. + while True: + req = urllib2.Request( + url= + 'https://resultstore.googleapis.com/v2/invocations/%s/targets/-/configuredTargets/-/actions?key=%s&pageToken=%s' + % (invocation_id, api_key, page_token), + headers={ + 'Content-Type': 'application/json' + }) + results = json.loads(urllib2.urlopen(req).read()) + all_actions.extend(results['actions']) + if 'nextPageToken' not in results: + break + page_token = results['nextPageToken'] + return all_actions + + if __name__ == "__main__": # Arguments are necessary if running in a non-Kokoro envrionment. argp = argparse.ArgumentParser(description='Upload RBE results.') @@ -123,40 +133,50 @@ if __name__ == "__main__": api_key = args.api_key or _get_api_key() invocation_id = args.invocation_id or _get_invocation_id() + resultstore_actions = _get_resultstore_data(api_key, invocation_id) - req = urllib2.Request( - url='https://resultstore.googleapis.com/v2/invocations/%s/targets?key=%s' - % (invocation_id, api_key), - headers={ - 'Content-Type': 'application/json' - }) - - results = json.loads(urllib2.urlopen(req).read()) bq_rows = [] - for target in map(_fill_missing_fields, results['targets']): - bq_rows.append({ - 'insertId': str(uuid.uuid4()), - 'json': { - 'build_id': - os.getenv('KOKORO_BUILD_NUMBER'), - 'build_url': - 'https://sponge.corp.google.com/invocation?id=%s' % - os.getenv('KOKORO_BUILD_ID'), - 'job_name': - os.getenv('KOKORO_JOB_NAME'), - 'test_target': - target['id']['targetId'], - 'result': - target['statusAttributes']['status'], - 'type': - target['targetAttributes']['type'], - 'language': - target['targetAttributes']['language'], - 'timestamp': - target['timing']['startTime'], - 'size': - target['testAttributes']['size'] - } - }) - - _upload_results_to_bq(bq_rows) + for action in resultstore_actions: + # Filter out non-test related data, such as build results. + if 'testAction' not in action: + continue + # Some test results contain the fileProcessingErrors field, which indicates + # an issue with parsing results individual test cases. + if 'fileProcessingErrors' in action: + test_cases = [{ + 'testCase': { + 'caseName': str(action['id']['actionId']), + 'result': str(action['statusAttributes']['status']) + } + }] + else: + test_cases = action['testAction']['testSuite']['tests'][0][ + 'testSuite']['tests'] + for test_case in test_cases: + if 'errors' in test_case['testCase']: + result = 'FAILED' + else: + result = 'PASSED' + bq_rows.append({ + 'insertId': str(uuid.uuid4()), + 'json': { + 'job_name': + os.getenv('KOKORO_JOB_NAME'), + 'build_id': + os.getenv('KOKORO_BUILD_NUMBER'), + 'build_url': + 'https://sponge.corp.google.com/invocation?id=%s' % + os.getenv('KOKORO_BUILD_ID'), + 'test_target': + action['id']['targetId'], + 'test_case': + test_case['testCase']['caseName'], + 'result': + result, + 'timestamp': + action['timing']['startTime'], + } + }) + # BigQuery sometimes fails with large uploads, so batch 1,000 rows at a time. + for i in range((len(bq_rows) / 1000) + 1): + _upload_results_to_bq(bq_rows[i * 1000:(i + 1) * 1000]) From 75d9edab09f90d70dee2483feffe3e465d870bf1 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 10 Apr 2018 14:12:57 -0700 Subject: [PATCH 018/165] Code review changes. --- .../lb_policy/round_robin/round_robin.cc | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 555ae62aa2d..f9bd0c0eb4e 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -155,11 +155,11 @@ class RoundRobin : public LoadBalancingPolicy { // If this subchannel list is the RR policy's current subchannel // list, updates the RR policy's connectivity state based on the // subchannel list's state counters. - void MaybeUpdateConnectivityStateLocked(); + void MaybeUpdateRoundRobinConnectivityStateLocked(); // Updates the RR policy's overall state based on the counters of // subchannels in each state. - void UpdateOverallStateLocked(); + void UpdateRoundRobinStateFromSubchannelStateCountsLocked(); private: bool started_watching_ = false; @@ -457,19 +457,20 @@ void RoundRobin::RoundRobinSubchannelList::StartWatchingLocked() { // re-resolution would cause a new update, and the new update would // immediately trigger a new re-resolution). // - // - It will not call UpdateOverallStateLocked(); instead, we call - // that here after all subchannels have been checked. This allows us - // to act more intelligently based on the state of all subchannels, - // rather than just acting on the first one. For example, if there is - // more than one pending pick, this allows us to spread the picks - // across all READY subchannels rather than sending them all to the - // first subchannel that reports READY. + // - It will not call UpdateRoundRobinStateFromSubchannelStateCountsLocked(); + // instead, we call that here after all subchannels have been checked. + // This allows us to act more intelligently based on the state of all + // subchannels, rather than just acting on the first one. For example, + // if there is more than one pending pick, this allows us to spread the + // picks across all READY subchannels rather than sending them all to + // the first subchannel that reports READY. for (size_t i = 0; i < num_subchannels(); ++i) { subchannel(i)->CheckConnectivityStateLocked(); } - // Now set started_watching_ to true and call UpdateOverallStateLocked(). + // Now set started_watching_ to true and call + // UpdateRoundRobinStateFromSubchannelStateCountsLocked(). started_watching_ = true; - UpdateOverallStateLocked(); + UpdateRoundRobinStateFromSubchannelStateCountsLocked(); // Start connectivity watch for each subchannel. for (size_t i = 0; i < num_subchannels(); i++) { if (subchannel(i)->subchannel() != nullptr) { @@ -508,7 +509,7 @@ void RoundRobin::RoundRobinSubchannelList::UpdateStateCountersLocked( // Sets the RR policy's connectivity state based on the current // subchannel list. void RoundRobin::RoundRobinSubchannelList:: - MaybeUpdateConnectivityStateLocked() { + MaybeUpdateRoundRobinConnectivityStateLocked() { RoundRobin* p = static_cast(policy()); // Only set connectivity state if this is the current subchannel list. if (p->subchannel_list_ != this) return; @@ -543,12 +544,13 @@ void RoundRobin::RoundRobinSubchannelList:: } } -void RoundRobin::RoundRobinSubchannelList::UpdateOverallStateLocked() { +void RoundRobin::RoundRobinSubchannelList:: + UpdateRoundRobinStateFromSubchannelStateCountsLocked() { RoundRobin* p = static_cast(policy()); if (num_ready_ > 0) { if (p->subchannel_list_ != this) { // Promote this list to p->subchannel_list_. - // This list must be p->latest_pending_subchannel_list_, because we + // This list must be p->latest_pending_subchannel_list_, because // any previous update would have been shut down already and // therefore weeded out in ProcessConnectivityChangeLocked(). GPR_ASSERT(p->latest_pending_subchannel_list_ == this); @@ -575,7 +577,7 @@ void RoundRobin::RoundRobinSubchannelList::UpdateOverallStateLocked() { p->DrainPendingPicksLocked(); } // Update the RR policy's connectivity state if needed. - MaybeUpdateConnectivityStateLocked(); + MaybeUpdateRoundRobinConnectivityStateLocked(); } void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( @@ -638,7 +640,7 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( prev_connectivity_state_ = connectivity_state(); // If we've started watching, update overall state and renew notification. if (subchannel_list()->started_watching()) { - subchannel_list()->UpdateOverallStateLocked(); + subchannel_list()->UpdateRoundRobinStateFromSubchannelStateCountsLocked(); StartConnectivityWatchLocked(); } GRPC_ERROR_UNREF(error); From de077acf5da5c720253ab1232d90872a494a64ce Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 12 Apr 2018 08:05:44 -0700 Subject: [PATCH 019/165] Fix retry code handling of internally triggered recv_trailing_metadata. --- CMakeLists.txt | 2 + Makefile | 2 + gRPC-Core.podspec | 1 + grpc.gyp | 2 + .../filters/client_channel/client_channel.cc | 353 ++++++++----- test/core/end2end/end2end_nosec_tests.cc | 8 + test/core/end2end/end2end_tests.cc | 8 + test/core/end2end/gen_build_yaml.py | 3 + test/core/end2end/generate_tests.bzl | 2 + ...s_before_recv_trailing_metadata_started.cc | 266 ++++++++++ .../generated/sources_and_headers.json | 2 + tools/run_tests/generated/tests.json | 477 ++++++++++++++++++ 12 files changed, 994 insertions(+), 132 deletions(-) create mode 100644 test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index 18400ea22a3..75146d35b6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5248,6 +5248,7 @@ add_library(end2end_tests test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc test/core/end2end/tests/retry_non_retriable_status.cc + test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc test/core/end2end/tests/retry_recv_initial_metadata.cc test/core/end2end/tests/retry_recv_message.cc test/core/end2end/tests/retry_server_pushback_delay.cc @@ -5365,6 +5366,7 @@ add_library(end2end_nosec_tests test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc test/core/end2end/tests/retry_non_retriable_status.cc + test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc test/core/end2end/tests/retry_recv_initial_metadata.cc test/core/end2end/tests/retry_recv_message.cc test/core/end2end/tests/retry_server_pushback_delay.cc diff --git a/Makefile b/Makefile index da5f2efebf9..1a12b5abbe8 100644 --- a/Makefile +++ b/Makefile @@ -9876,6 +9876,7 @@ LIBEND2END_TESTS_SRC = \ test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc \ test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc \ test/core/end2end/tests/retry_non_retriable_status.cc \ + test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc \ test/core/end2end/tests/retry_recv_initial_metadata.cc \ test/core/end2end/tests/retry_recv_message.cc \ test/core/end2end/tests/retry_server_pushback_delay.cc \ @@ -9991,6 +9992,7 @@ LIBEND2END_NOSEC_TESTS_SRC = \ test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc \ test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc \ test/core/end2end/tests/retry_non_retriable_status.cc \ + test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc \ test/core/end2end/tests/retry_recv_initial_metadata.cc \ test/core/end2end/tests/retry_recv_message.cc \ test/core/end2end/tests/retry_server_pushback_delay.cc \ diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index bd192b43ca2..fc6b31fd23c 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1214,6 +1214,7 @@ Pod::Spec.new do |s| 'test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc', 'test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc', 'test/core/end2end/tests/retry_non_retriable_status.cc', + 'test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc', 'test/core/end2end/tests/retry_recv_initial_metadata.cc', 'test/core/end2end/tests/retry_recv_message.cc', 'test/core/end2end/tests/retry_server_pushback_delay.cc', diff --git a/grpc.gyp b/grpc.gyp index 8d9422eee6e..5dd77b3b6dd 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -2622,6 +2622,7 @@ 'test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc', 'test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc', 'test/core/end2end/tests/retry_non_retriable_status.cc', + 'test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc', 'test/core/end2end/tests/retry_recv_initial_metadata.cc', 'test/core/end2end/tests/retry_recv_message.cc', 'test/core/end2end/tests/retry_server_pushback_delay.cc', @@ -2711,6 +2712,7 @@ 'test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc', 'test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc', 'test/core/end2end/tests/retry_non_retriable_status.cc', + 'test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc', 'test/core/end2end/tests/retry_recv_initial_metadata.cc', 'test/core/end2end/tests/retry_recv_message.cc', 'test/core/end2end/tests/retry_server_pushback_delay.cc', diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index a10bfea8b19..33cf56519ef 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -842,10 +842,11 @@ typedef struct { bool completed_recv_trailing_metadata : 1; // State for callback processing. bool retry_dispatched : 1; - bool recv_initial_metadata_ready_deferred : 1; - bool recv_message_ready_deferred : 1; + subchannel_batch_data* recv_initial_metadata_ready_deferred_batch; grpc_error* recv_initial_metadata_error; + subchannel_batch_data* recv_message_ready_deferred_batch; grpc_error* recv_message_error; + subchannel_batch_data* recv_trailing_metadata_internal_batch; } subchannel_call_retry_state; // Pending batches stored in call data. @@ -994,6 +995,39 @@ static void maybe_cache_send_ops_for_batch(call_data* calld, } } +// Frees cached send_initial_metadata. +static void free_cached_send_initial_metadata(channel_data* chand, + call_data* calld) { + if (grpc_client_channel_trace.enabled()) { + gpr_log(GPR_DEBUG, + "chand=%p calld=%p: destroying calld->send_initial_metadata", chand, + calld); + } + grpc_metadata_batch_destroy(&calld->send_initial_metadata); +} + +// Frees cached send_message at index idx. +static void free_cached_send_message(channel_data* chand, call_data* calld, + size_t idx) { + if (grpc_client_channel_trace.enabled()) { + gpr_log(GPR_DEBUG, + "chand=%p calld=%p: destroying calld->send_messages[%" PRIuPTR "]", + chand, calld, idx); + } + (*calld->send_messages)[idx]->Destroy(); +} + +// Frees cached send_trailing_metadata. +static void free_cached_send_trailing_metadata(channel_data* chand, + call_data* calld) { + if (grpc_client_channel_trace.enabled()) { + gpr_log(GPR_DEBUG, + "chand=%p calld=%p: destroying calld->send_trailing_metadata", + chand, calld); + } + grpc_metadata_batch_destroy(&calld->send_trailing_metadata); +} + // Frees cached send ops that have already been completed after // committing the call. static void free_cached_send_op_data_after_commit( @@ -1001,19 +1035,13 @@ static void free_cached_send_op_data_after_commit( channel_data* chand = static_cast(elem->channel_data); call_data* calld = static_cast(elem->call_data); if (retry_state->completed_send_initial_metadata) { - grpc_metadata_batch_destroy(&calld->send_initial_metadata); + free_cached_send_initial_metadata(chand, calld); } for (size_t i = 0; i < retry_state->completed_send_message_count; ++i) { - if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, - "chand=%p calld=%p: destroying calld->send_messages[%" PRIuPTR - "]", - chand, calld, i); - } - (*calld->send_messages)[i]->Destroy(); + free_cached_send_message(chand, calld, i); } if (retry_state->completed_send_trailing_metadata) { - grpc_metadata_batch_destroy(&calld->send_trailing_metadata); + free_cached_send_trailing_metadata(chand, calld); } } @@ -1025,20 +1053,14 @@ static void free_cached_send_op_data_for_completed_batch( channel_data* chand = static_cast(elem->channel_data); call_data* calld = static_cast(elem->call_data); if (batch_data->batch.send_initial_metadata) { - grpc_metadata_batch_destroy(&calld->send_initial_metadata); + free_cached_send_initial_metadata(chand, calld); } if (batch_data->batch.send_message) { - if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, - "chand=%p calld=%p: destroying calld->send_messages[%" PRIuPTR - "]", - chand, calld, retry_state->completed_send_message_count - 1); - } - (*calld->send_messages)[retry_state->completed_send_message_count - 1] - ->Destroy(); + free_cached_send_message(chand, calld, + retry_state->completed_send_message_count - 1); } if (batch_data->batch.send_trailing_metadata) { - grpc_metadata_batch_destroy(&calld->send_trailing_metadata); + free_cached_send_trailing_metadata(chand, calld); } } @@ -1642,7 +1664,7 @@ static void recv_initial_metadata_ready(void* arg, grpc_error* error) { "(Trailers-Only)", chand, calld); } - retry_state->recv_initial_metadata_ready_deferred = true; + retry_state->recv_initial_metadata_ready_deferred_batch = batch_data; retry_state->recv_initial_metadata_error = GRPC_ERROR_REF(error); if (!retry_state->started_recv_trailing_metadata) { // recv_trailing_metadata not yet started by application; start it @@ -1731,7 +1753,7 @@ static void recv_message_ready(void* arg, grpc_error* error) { "message and recv_trailing_metadata pending)", chand, calld); } - retry_state->recv_message_ready_deferred = true; + retry_state->recv_message_ready_deferred_batch = batch_data; retry_state->recv_message_error = GRPC_ERROR_REF(error); if (!retry_state->started_recv_trailing_metadata) { // recv_trailing_metadata not yet started by application; start it @@ -1749,6 +1771,59 @@ static void recv_message_ready(void* arg, grpc_error* error) { GRPC_ERROR_UNREF(error); } +// +// list of closures to execute in call combiner +// + +// Represents a closure that needs to run in the call combiner as part of +// starting or completing a batch. +typedef struct { + grpc_closure* closure; + grpc_error* error; + const char* reason; + bool free_reason = false; +} closure_to_execute; + +static void execute_closures_in_call_combiner(grpc_call_element* elem, + const char* caller, + closure_to_execute* closures, + size_t num_closures) { + channel_data* chand = static_cast(elem->channel_data); + call_data* calld = static_cast(elem->call_data); + // Note that the call combiner will be yielded for each closure that + // we schedule. We're already running in the call combiner, so one of + // the closures can be scheduled directly, but the others will + // have to re-enter the call combiner. + if (num_closures > 0) { + if (grpc_client_channel_trace.enabled()) { + gpr_log(GPR_DEBUG, "chand=%p calld=%p: %s starting closure: %s", chand, + calld, caller, closures[0].reason); + } + GRPC_CLOSURE_SCHED(closures[0].closure, closures[0].error); + if (closures[0].free_reason) { + gpr_free(const_cast(closures[0].reason)); + } + for (size_t i = 1; i < num_closures; ++i) { + if (grpc_client_channel_trace.enabled()) { + gpr_log(GPR_DEBUG, + "chand=%p calld=%p: %s starting closure in call combiner: %s", + chand, calld, caller, closures[i].reason); + } + GRPC_CALL_COMBINER_START(calld->call_combiner, closures[i].closure, + closures[i].error, closures[i].reason); + if (closures[i].free_reason) { + gpr_free(const_cast(closures[i].reason)); + } + } + } else { + if (grpc_client_channel_trace.enabled()) { + gpr_log(GPR_DEBUG, "chand=%p calld=%p: no closures to run for %s", chand, + calld, caller); + } + GRPC_CALL_COMBINER_STOP(calld->call_combiner, "no closures to run"); + } +} + // // on_complete callback handling // @@ -1777,36 +1852,35 @@ static void update_retry_state_for_completed_batch( } } -// Represents a closure that needs to run as a result of a completed batch. -typedef struct { - grpc_closure* closure; - grpc_error* error; - const char* reason; -} closure_to_execute; - // Adds any necessary closures for deferred recv_initial_metadata and // recv_message callbacks to closures, updating *num_closures as needed. static void add_closures_for_deferred_recv_callbacks( subchannel_batch_data* batch_data, subchannel_call_retry_state* retry_state, closure_to_execute* closures, size_t* num_closures) { - if (batch_data->batch.recv_trailing_metadata && - retry_state->recv_initial_metadata_ready_deferred) { - closure_to_execute* closure = &closures[(*num_closures)++]; - closure->closure = - GRPC_CLOSURE_INIT(&batch_data->recv_initial_metadata_ready, - invoke_recv_initial_metadata_callback, batch_data, - grpc_schedule_on_exec_ctx); - closure->error = retry_state->recv_initial_metadata_error; - closure->reason = "resuming recv_initial_metadata_ready"; - } - if (batch_data->batch.recv_trailing_metadata && - retry_state->recv_message_ready_deferred) { - closure_to_execute* closure = &closures[(*num_closures)++]; - closure->closure = GRPC_CLOSURE_INIT(&batch_data->recv_message_ready, - invoke_recv_message_callback, - batch_data, grpc_schedule_on_exec_ctx); - closure->error = retry_state->recv_message_error; - closure->reason = "resuming recv_message_ready"; + if (batch_data->batch.recv_trailing_metadata) { + // Add closure for deferred recv_initial_metadata_ready. + if (retry_state->recv_initial_metadata_ready_deferred_batch != nullptr) { + closure_to_execute* closure = &closures[(*num_closures)++]; + closure->closure = GRPC_CLOSURE_INIT( + &batch_data->recv_initial_metadata_ready, + invoke_recv_initial_metadata_callback, + retry_state->recv_initial_metadata_ready_deferred_batch, + grpc_schedule_on_exec_ctx); + closure->error = retry_state->recv_initial_metadata_error; + closure->reason = "resuming recv_initial_metadata_ready"; + retry_state->recv_initial_metadata_ready_deferred_batch = nullptr; + } + // Add closure for deferred recv_message_ready. + if (retry_state->recv_message_ready_deferred_batch != nullptr) { + closure_to_execute* closure = &closures[(*num_closures)++]; + closure->closure = GRPC_CLOSURE_INIT( + &batch_data->recv_message_ready, invoke_recv_message_callback, + retry_state->recv_message_ready_deferred_batch, + grpc_schedule_on_exec_ctx); + closure->error = retry_state->recv_message_error; + closure->reason = "resuming recv_message_ready"; + retry_state->recv_message_ready_deferred_batch = nullptr; + } } } @@ -1951,6 +2025,8 @@ static void on_complete(void* arg, grpc_error* error) { // If we have previously completed recv_trailing_metadata, then the // call is finished. bool call_finished = retry_state->completed_recv_trailing_metadata; + // Record whether we were already committed before receiving this callback. + const bool previously_committed = calld->retry_committed; // Update bookkeeping in retry_state. update_retry_state_for_completed_batch(batch_data, retry_state); if (call_finished) { @@ -1979,35 +2055,39 @@ static void on_complete(void* arg, grpc_error* error) { if (md_batch->idx.named.grpc_retry_pushback_ms != nullptr) { server_pushback_md = &md_batch->idx.named.grpc_retry_pushback_ms->md; } - } else if (retry_state->completed_recv_trailing_metadata) { - call_finished = true; - } - if (call_finished && grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: call finished, status=%s", chand, - calld, grpc_status_code_to_string(status)); } - // If the call is finished, check if we should retry. - if (call_finished && - maybe_retry(elem, batch_data, status, server_pushback_md)) { - // Unref batch_data for deferred recv_initial_metadata_ready or - // recv_message_ready callbacks, if any. - if (batch_data->batch.recv_trailing_metadata && - retry_state->recv_initial_metadata_ready_deferred) { - batch_data_unref(batch_data); - GRPC_ERROR_UNREF(retry_state->recv_initial_metadata_error); + // If the call just finished, check if we should retry. + if (call_finished) { + if (grpc_client_channel_trace.enabled()) { + gpr_log(GPR_DEBUG, "chand=%p calld=%p: call finished, status=%s", chand, + calld, grpc_status_code_to_string(status)); } - if (batch_data->batch.recv_trailing_metadata && - retry_state->recv_message_ready_deferred) { + if (maybe_retry(elem, batch_data, status, server_pushback_md)) { + // Unref batch_data for deferred recv_initial_metadata_ready or + // recv_message_ready callbacks, if any. + if (batch_data->batch.recv_trailing_metadata && + retry_state->recv_initial_metadata_ready_deferred_batch != + nullptr) { + batch_data_unref(batch_data); + GRPC_ERROR_UNREF(retry_state->recv_initial_metadata_error); + } + if (batch_data->batch.recv_trailing_metadata && + retry_state->recv_message_ready_deferred_batch != nullptr) { + batch_data_unref(batch_data); + GRPC_ERROR_UNREF(retry_state->recv_message_error); + } batch_data_unref(batch_data); - GRPC_ERROR_UNREF(retry_state->recv_message_error); + return; } - batch_data_unref(batch_data); - return; + // Not retrying, so commit the call. + retry_commit(elem, retry_state); } } - // If the call is finished or retries are committed, free cached data for - // send ops that we've just completed. - if (call_finished || calld->retry_committed) { + // If we were already committed before receiving this callback, free + // cached data for send ops that we've just completed. (If the call has + // just now finished, the call to retry_commit() above will have freed all + // cached send ops, so we don't need to do it here.) + if (previously_committed) { free_cached_send_op_data_for_completed_batch(elem, batch_data, retry_state); } // Call not being retried. @@ -2042,20 +2122,8 @@ static void on_complete(void* arg, grpc_error* error) { // Don't need batch_data anymore. batch_data_unref(batch_data); // Schedule all of the closures identified above. - // Note that the call combiner will be yielded for each closure that - // we schedule. We're already running in the call combiner, so one of - // the closures can be scheduled directly, but the others will - // have to re-enter the call combiner. - if (num_closures > 0) { - GRPC_CLOSURE_SCHED(closures[0].closure, closures[0].error); - for (size_t i = 1; i < num_closures; ++i) { - GRPC_CALL_COMBINER_START(calld->call_combiner, closures[i].closure, - closures[i].error, closures[i].reason); - } - } else { - GRPC_CALL_COMBINER_STOP(calld->call_combiner, - "no closures to run for on_complete"); - } + execute_closures_in_call_combiner(elem, "on_complete", closures, + num_closures); } // @@ -2072,6 +2140,31 @@ static void start_batch_in_call_combiner(void* arg, grpc_error* ignored) { grpc_subchannel_call_process_op(subchannel_call, batch); } +// Adds a closure to closures that will execute batch in the call combiner. +static void add_closure_for_subchannel_batch( + call_data* calld, grpc_transport_stream_op_batch* batch, + closure_to_execute* closures, size_t* num_closures) { + batch->handler_private.extra_arg = calld->subchannel_call; + GRPC_CLOSURE_INIT(&batch->handler_private.closure, + start_batch_in_call_combiner, batch, + grpc_schedule_on_exec_ctx); + closure_to_execute* closure = &closures[(*num_closures)++]; + closure->closure = &batch->handler_private.closure; + closure->error = GRPC_ERROR_NONE; + // If the tracer is enabled, we log a more detailed message, which + // requires dynamic allocation. This will be freed in + // start_retriable_subchannel_batches(). + if (grpc_client_channel_trace.enabled()) { + char* batch_str = grpc_transport_stream_op_batch_string(batch); + gpr_asprintf(const_cast(&closure->reason), + "starting batch in call combiner: %s", batch_str); + gpr_free(batch_str); + closure->free_reason = true; + } else { + closure->reason = "start_subchannel_batch"; + } +} + // Adds retriable send_initial_metadata op to batch_data. static void add_retriable_send_initial_metadata_op( call_data* calld, subchannel_call_retry_state* retry_state, @@ -2227,8 +2320,12 @@ static void start_internal_recv_trailing_metadata(grpc_call_element* elem) { static_cast( grpc_connected_subchannel_call_get_parent_data( calld->subchannel_call)); - subchannel_batch_data* batch_data = batch_data_create(elem, 1); + // Create batch_data with 2 refs, since this batch will be unreffed twice: + // once when the subchannel batch returns, and again when we actually get + // a recv_trailing_metadata op from the surface. + subchannel_batch_data* batch_data = batch_data_create(elem, 2); add_retriable_recv_trailing_metadata_op(calld, retry_state, batch_data); + retry_state->recv_trailing_metadata_internal_batch = batch_data; // Note: This will release the call combiner. grpc_subchannel_call_process_op(calld->subchannel_call, &batch_data->batch); } @@ -2299,7 +2396,7 @@ static subchannel_batch_data* maybe_create_subchannel_batch_for_replay( // *num_batches as needed. static void add_subchannel_batches_for_pending_batches( grpc_call_element* elem, subchannel_call_retry_state* retry_state, - grpc_transport_stream_op_batch** batches, size_t* num_batches) { + closure_to_execute* closures, size_t* num_closures) { call_data* calld = static_cast(elem->call_data); for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches); ++i) { pending_batch* pending = &calld->pending_batches[i]; @@ -2342,13 +2439,37 @@ static void add_subchannel_batches_for_pending_batches( } if (batch->recv_trailing_metadata && retry_state->started_recv_trailing_metadata) { + // If we previously completed a recv_trailing_metadata op + // initiated by start_internal_recv_trailing_metadata(), use the + // result of that instead of trying to re-start this op. + if (retry_state->recv_trailing_metadata_internal_batch != nullptr) { + // If the batch completed, then trigger the completion callback + // directly, so that we return the previously returned results to + // the application. Otherwise, just unref the internally + // started subchannel batch, since we'll propagate the + // completion when it completes. + if (retry_state->completed_recv_trailing_metadata) { + subchannel_batch_data* batch_data = + retry_state->recv_trailing_metadata_internal_batch; + closure_to_execute* closure = &closures[(*num_closures)++]; + closure->closure = &batch_data->on_complete; + // Batches containing recv_trailing_metadata always succeed. + closure->error = GRPC_ERROR_NONE; + closure->reason = + "re-executing on_complete for recv_trailing_metadata " + "to propagate internally triggered result"; + } else { + batch_data_unref(retry_state->recv_trailing_metadata_internal_batch); + } + retry_state->recv_trailing_metadata_internal_batch = nullptr; + } continue; } // If we're not retrying, just send the batch as-is. if (calld->method_params == nullptr || calld->method_params->retry_policy() == nullptr || calld->retry_committed) { - batches[(*num_batches)++] = batch; + add_closure_for_subchannel_batch(calld, batch, closures, num_closures); pending_batch_clear(calld, pending); continue; } @@ -2385,7 +2506,8 @@ static void add_subchannel_batches_for_pending_batches( GPR_ASSERT(batch->collect_stats); add_retriable_recv_trailing_metadata_op(calld, retry_state, batch_data); } - batches[(*num_batches)++] = &batch_data->batch; + add_closure_for_subchannel_batch(calld, &batch_data->batch, closures, + num_closures); } } @@ -2403,62 +2525,29 @@ static void start_retriable_subchannel_batches(void* arg, grpc_error* ignored) { static_cast( grpc_connected_subchannel_call_get_parent_data( calld->subchannel_call)); + // Construct list of closures to execute, one for each pending batch. // We can start up to 6 batches. - grpc_transport_stream_op_batch* - batches[GPR_ARRAY_SIZE(calld->pending_batches)]; - size_t num_batches = 0; + closure_to_execute closures[GPR_ARRAY_SIZE(calld->pending_batches)]; + size_t num_closures = 0; // Replay previously-returned send_* ops if needed. subchannel_batch_data* replay_batch_data = maybe_create_subchannel_batch_for_replay(elem, retry_state); if (replay_batch_data != nullptr) { - batches[num_batches++] = &replay_batch_data->batch; + add_closure_for_subchannel_batch(calld, &replay_batch_data->batch, closures, + &num_closures); } // Now add pending batches. - add_subchannel_batches_for_pending_batches(elem, retry_state, batches, - &num_batches); + add_subchannel_batches_for_pending_batches(elem, retry_state, closures, + &num_closures); // Start batches on subchannel call. - // Note that the call combiner will be yielded for each batch that we - // send down. We're already running in the call combiner, so one of - // the batches can be started directly, but the others will have to - // re-enter the call combiner. if (grpc_client_channel_trace.enabled()) { gpr_log(GPR_DEBUG, "chand=%p calld=%p: starting %" PRIuPTR " retriable batches on subchannel_call=%p", - chand, calld, num_batches, calld->subchannel_call); - } - if (num_batches == 0) { - // This should be fairly rare, but it can happen when (e.g.) an - // attempt completes before it has finished replaying all - // previously sent messages. - GRPC_CALL_COMBINER_STOP(calld->call_combiner, - "no retriable subchannel batches to start"); - } else { - for (size_t i = 1; i < num_batches; ++i) { - if (grpc_client_channel_trace.enabled()) { - char* batch_str = grpc_transport_stream_op_batch_string(batches[i]); - gpr_log(GPR_DEBUG, - "chand=%p calld=%p: starting batch in call combiner: %s", chand, - calld, batch_str); - gpr_free(batch_str); - } - batches[i]->handler_private.extra_arg = calld->subchannel_call; - GRPC_CLOSURE_INIT(&batches[i]->handler_private.closure, - start_batch_in_call_combiner, batches[i], - grpc_schedule_on_exec_ctx); - GRPC_CALL_COMBINER_START(calld->call_combiner, - &batches[i]->handler_private.closure, - GRPC_ERROR_NONE, "start_subchannel_batch"); - } - if (grpc_client_channel_trace.enabled()) { - char* batch_str = grpc_transport_stream_op_batch_string(batches[0]); - gpr_log(GPR_DEBUG, "chand=%p calld=%p: starting batch: %s", chand, calld, - batch_str); - gpr_free(batch_str); - } - // Note: This will release the call combiner. - grpc_subchannel_call_process_op(calld->subchannel_call, batches[0]); + chand, calld, num_closures, calld->subchannel_call); } + execute_closures_in_call_combiner(elem, "start_retriable_subchannel_batches", + closures, num_closures); } // diff --git a/test/core/end2end/end2end_nosec_tests.cc b/test/core/end2end/end2end_nosec_tests.cc index 297408cd92b..59eb643a93b 100644 --- a/test/core/end2end/end2end_nosec_tests.cc +++ b/test/core/end2end/end2end_nosec_tests.cc @@ -132,6 +132,8 @@ extern void retry_exceeds_buffer_size_in_subsequent_batch(grpc_end2end_test_conf extern void retry_exceeds_buffer_size_in_subsequent_batch_pre_init(void); extern void retry_non_retriable_status(grpc_end2end_test_config config); extern void retry_non_retriable_status_pre_init(void); +extern void retry_non_retriable_status_before_recv_trailing_metadata_started(grpc_end2end_test_config config); +extern void retry_non_retriable_status_before_recv_trailing_metadata_started_pre_init(void); extern void retry_recv_initial_metadata(grpc_end2end_test_config config); extern void retry_recv_initial_metadata_pre_init(void); extern void retry_recv_message(grpc_end2end_test_config config); @@ -236,6 +238,7 @@ void grpc_end2end_tests_pre_init(void) { retry_exceeds_buffer_size_in_initial_batch_pre_init(); retry_exceeds_buffer_size_in_subsequent_batch_pre_init(); retry_non_retriable_status_pre_init(); + retry_non_retriable_status_before_recv_trailing_metadata_started_pre_init(); retry_recv_initial_metadata_pre_init(); retry_recv_message_pre_init(); retry_server_pushback_delay_pre_init(); @@ -320,6 +323,7 @@ void grpc_end2end_tests(int argc, char **argv, retry_exceeds_buffer_size_in_initial_batch(config); retry_exceeds_buffer_size_in_subsequent_batch(config); retry_non_retriable_status(config); + retry_non_retriable_status_before_recv_trailing_metadata_started(config); retry_recv_initial_metadata(config); retry_recv_message(config); retry_server_pushback_delay(config); @@ -552,6 +556,10 @@ void grpc_end2end_tests(int argc, char **argv, retry_non_retriable_status(config); continue; } + if (0 == strcmp("retry_non_retriable_status_before_recv_trailing_metadata_started", argv[i])) { + retry_non_retriable_status_before_recv_trailing_metadata_started(config); + continue; + } if (0 == strcmp("retry_recv_initial_metadata", argv[i])) { retry_recv_initial_metadata(config); continue; diff --git a/test/core/end2end/end2end_tests.cc b/test/core/end2end/end2end_tests.cc index 9b3f6552545..9f164b4eadf 100644 --- a/test/core/end2end/end2end_tests.cc +++ b/test/core/end2end/end2end_tests.cc @@ -134,6 +134,8 @@ extern void retry_exceeds_buffer_size_in_subsequent_batch(grpc_end2end_test_conf extern void retry_exceeds_buffer_size_in_subsequent_batch_pre_init(void); extern void retry_non_retriable_status(grpc_end2end_test_config config); extern void retry_non_retriable_status_pre_init(void); +extern void retry_non_retriable_status_before_recv_trailing_metadata_started(grpc_end2end_test_config config); +extern void retry_non_retriable_status_before_recv_trailing_metadata_started_pre_init(void); extern void retry_recv_initial_metadata(grpc_end2end_test_config config); extern void retry_recv_initial_metadata_pre_init(void); extern void retry_recv_message(grpc_end2end_test_config config); @@ -239,6 +241,7 @@ void grpc_end2end_tests_pre_init(void) { retry_exceeds_buffer_size_in_initial_batch_pre_init(); retry_exceeds_buffer_size_in_subsequent_batch_pre_init(); retry_non_retriable_status_pre_init(); + retry_non_retriable_status_before_recv_trailing_metadata_started_pre_init(); retry_recv_initial_metadata_pre_init(); retry_recv_message_pre_init(); retry_server_pushback_delay_pre_init(); @@ -324,6 +327,7 @@ void grpc_end2end_tests(int argc, char **argv, retry_exceeds_buffer_size_in_initial_batch(config); retry_exceeds_buffer_size_in_subsequent_batch(config); retry_non_retriable_status(config); + retry_non_retriable_status_before_recv_trailing_metadata_started(config); retry_recv_initial_metadata(config); retry_recv_message(config); retry_server_pushback_delay(config); @@ -560,6 +564,10 @@ void grpc_end2end_tests(int argc, char **argv, retry_non_retriable_status(config); continue; } + if (0 == strcmp("retry_non_retriable_status_before_recv_trailing_metadata_started", argv[i])) { + retry_non_retriable_status_before_recv_trailing_metadata_started(config); + continue; + } if (0 == strcmp("retry_recv_initial_metadata", argv[i])) { retry_recv_initial_metadata(config); continue; diff --git a/test/core/end2end/gen_build_yaml.py b/test/core/end2end/gen_build_yaml.py index c7b03625748..c355fc24b54 100755 --- a/test/core/end2end/gen_build_yaml.py +++ b/test/core/end2end/gen_build_yaml.py @@ -170,6 +170,9 @@ END2END_TESTS = { proxyable=False), 'retry_non_retriable_status': default_test_options._replace( cpu_cost=LOWCPU, needs_client_channel=True, proxyable=False), + 'retry_non_retriable_status_before_recv_trailing_metadata_started': + default_test_options._replace( + cpu_cost=LOWCPU, needs_client_channel=True, proxyable=False), 'retry_recv_initial_metadata': default_test_options._replace( cpu_cost=LOWCPU, needs_client_channel=True, proxyable=False), 'retry_recv_message': default_test_options._replace( diff --git a/test/core/end2end/generate_tests.bzl b/test/core/end2end/generate_tests.bzl index 37fd1837f41..11fc576165b 100755 --- a/test/core/end2end/generate_tests.bzl +++ b/test/core/end2end/generate_tests.bzl @@ -158,6 +158,8 @@ END2END_TESTS = { needs_client_channel=True, proxyable=False), 'retry_non_retriable_status': test_options(needs_client_channel=True, proxyable=False), + 'retry_non_retriable_status_before_recv_trailing_metadata_started': + test_options(needs_client_channel=True, proxyable=False), 'retry_recv_initial_metadata': test_options(needs_client_channel=True, proxyable=False), 'retry_recv_message': test_options(needs_client_channel=True, diff --git a/test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc b/test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc new file mode 100644 index 00000000000..eb016a3de98 --- /dev/null +++ b/test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc @@ -0,0 +1,266 @@ +/* + * + * Copyright 2018 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 "test/core/end2end/end2end_tests.h" + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/gpr/string.h" +#include "src/core/lib/gpr/useful.h" +#include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/lib/transport/static_metadata.h" + +#include "test/core/end2end/cq_verifier.h" +#include "test/core/end2end/tests/cancel_test_helpers.h" + +static void* tag(intptr_t t) { return (void*)t; } + +static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { + grpc_end2end_test_fixture f; + gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); + f = config.create_fixture(client_args, server_args); + config.init_server(&f, server_args); + config.init_client(&f, client_args); + return f; +} + +static gpr_timespec n_seconds_from_now(int n) { + return grpc_timeout_seconds_to_deadline(n); +} + +static gpr_timespec five_seconds_from_now(void) { + return n_seconds_from_now(5); +} + +static void drain_cq(grpc_completion_queue* cq) { + grpc_event ev; + do { + ev = grpc_completion_queue_next(cq, five_seconds_from_now(), nullptr); + } while (ev.type != GRPC_QUEUE_SHUTDOWN); +} + +static void shutdown_server(grpc_end2end_test_fixture* f) { + if (!f->server) return; + grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), + grpc_timeout_seconds_to_deadline(5), + nullptr) + .type == GRPC_OP_COMPLETE); + grpc_server_destroy(f->server); + f->server = nullptr; +} + +static void shutdown_client(grpc_end2end_test_fixture* f) { + if (!f->client) return; + grpc_channel_destroy(f->client); + f->client = nullptr; +} + +static void end_test(grpc_end2end_test_fixture* f) { + shutdown_server(f); + shutdown_client(f); + + grpc_completion_queue_shutdown(f->cq); + drain_cq(f->cq); + grpc_completion_queue_destroy(f->cq); + grpc_completion_queue_destroy(f->shutdown_cq); +} + +// Tests that we don't retry for non-retryable status codes, even if +// status is received before the recv_trailing_metadata op is started. +// - 1 retry allowed for ABORTED status +// - first attempt gets INVALID_ARGUMENT, so no retry is done +static void +test_retry_non_retriable_status_before_recv_trailing_metadata_started( + grpc_end2end_test_config config) { + grpc_call* c; + grpc_call* s; + grpc_op ops[6]; + grpc_op* op; + grpc_metadata_array initial_metadata_recv; + grpc_metadata_array trailing_metadata_recv; + grpc_metadata_array request_metadata_recv; + grpc_call_details call_details; + grpc_slice request_payload_slice = grpc_slice_from_static_string("foo"); + grpc_slice response_payload_slice = grpc_slice_from_static_string("bar"); + grpc_byte_buffer* request_payload = + grpc_raw_byte_buffer_create(&request_payload_slice, 1); + grpc_byte_buffer* response_payload = + grpc_raw_byte_buffer_create(&response_payload_slice, 1); + grpc_byte_buffer* request_payload_recv = nullptr; + grpc_byte_buffer* response_payload_recv = nullptr; + grpc_status_code status; + grpc_call_error error; + grpc_slice details; + int was_cancelled = 2; + char* peer; + + grpc_arg arg; + arg.type = GRPC_ARG_STRING; + arg.key = const_cast(GRPC_ARG_SERVICE_CONFIG); + arg.value.string = const_cast( + "{\n" + " \"methodConfig\": [ {\n" + " \"name\": [\n" + " { \"service\": \"service\", \"method\": \"method\" }\n" + " ],\n" + " \"retryPolicy\": {\n" + " \"maxAttempts\": 2,\n" + " \"initialBackoff\": \"1s\",\n" + " \"maxBackoff\": \"120s\",\n" + " \"backoffMultiplier\": 1.6,\n" + " \"retryableStatusCodes\": [ \"ABORTED\" ]\n" + " }\n" + " } ]\n" + "}"); + grpc_channel_args client_args = {1, &arg}; + grpc_end2end_test_fixture f = + begin_test(config, "retry_non_retriable_status", &client_args, nullptr); + + cq_verifier* cqv = cq_verifier_create(f.cq); + + gpr_timespec deadline = five_seconds_from_now(); + c = grpc_channel_create_call(f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq, + grpc_slice_from_static_string("/service/method"), + nullptr, deadline, nullptr); + GPR_ASSERT(c); + + peer = grpc_call_get_peer(c); + GPR_ASSERT(peer != nullptr); + gpr_log(GPR_DEBUG, "client_peer_before_call=%s", peer); + gpr_free(peer); + + grpc_metadata_array_init(&initial_metadata_recv); + grpc_metadata_array_init(&trailing_metadata_recv); + grpc_metadata_array_init(&request_metadata_recv); + grpc_call_details_init(&call_details); + grpc_slice status_details = grpc_slice_from_static_string("xyz"); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_SEND_INITIAL_METADATA; + op->data.send_initial_metadata.count = 0; + op++; + op->op = GRPC_OP_SEND_MESSAGE; + op->data.send_message.send_message = request_payload; + op++; + op->op = GRPC_OP_RECV_MESSAGE; + op->data.recv_message.recv_message = &response_payload_recv; + op++; + op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; + op++; + op->op = GRPC_OP_RECV_INITIAL_METADATA; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; + op++; + error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr); + GPR_ASSERT(GRPC_CALL_OK == error); + + error = + grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); + CQ_EXPECT_COMPLETION(cqv, tag(101), true); + cq_verify(cqv); + + peer = grpc_call_get_peer(s); + GPR_ASSERT(peer != nullptr); + gpr_log(GPR_DEBUG, "server_peer=%s", peer); + gpr_free(peer); + peer = grpc_call_get_peer(c); + GPR_ASSERT(peer != nullptr); + gpr_log(GPR_DEBUG, "client_peer=%s", peer); + gpr_free(peer); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_SEND_INITIAL_METADATA; + op->data.send_initial_metadata.count = 0; + op++; + op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; + op->data.send_status_from_server.trailing_metadata_count = 0; + op->data.send_status_from_server.status = GRPC_STATUS_INVALID_ARGUMENT; + op->data.send_status_from_server.status_details = &status_details; + op++; + op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; + op->data.recv_close_on_server.cancelled = &was_cancelled; + op++; + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + GPR_ASSERT(GRPC_CALL_OK == error); + + CQ_EXPECT_COMPLETION(cqv, tag(102), true); + CQ_EXPECT_COMPLETION(cqv, tag(1), true); + cq_verify(cqv); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; + op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; + op->data.recv_status_on_client.status = &status; + op->data.recv_status_on_client.status_details = &details; + op++; + error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + GPR_ASSERT(GRPC_CALL_OK == error); + + CQ_EXPECT_COMPLETION(cqv, tag(2), true); + cq_verify(cqv); + + GPR_ASSERT(status == GRPC_STATUS_INVALID_ARGUMENT); + GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz")); + GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/service/method")); + GPR_ASSERT(0 == call_details.flags); + GPR_ASSERT(was_cancelled == 1); + + grpc_slice_unref(details); + grpc_metadata_array_destroy(&initial_metadata_recv); + grpc_metadata_array_destroy(&trailing_metadata_recv); + grpc_metadata_array_destroy(&request_metadata_recv); + grpc_call_details_destroy(&call_details); + grpc_byte_buffer_destroy(request_payload); + grpc_byte_buffer_destroy(response_payload); + grpc_byte_buffer_destroy(request_payload_recv); + grpc_byte_buffer_destroy(response_payload_recv); + + grpc_call_unref(c); + grpc_call_unref(s); + + cq_verifier_destroy(cqv); + + end_test(&f); + config.tear_down_data(&f); +} + +void retry_non_retriable_status_before_recv_trailing_metadata_started( + grpc_end2end_test_config config) { + GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL); + test_retry_non_retriable_status_before_recv_trailing_metadata_started(config); +} + +void retry_non_retriable_status_before_recv_trailing_metadata_started_pre_init() { +} diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index c79996f8188..60f1bc3a1bf 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -8566,6 +8566,7 @@ "test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc", "test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc", "test/core/end2end/tests/retry_non_retriable_status.cc", + "test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc", "test/core/end2end/tests/retry_recv_initial_metadata.cc", "test/core/end2end/tests/retry_recv_message.cc", "test/core/end2end/tests/retry_server_pushback_delay.cc", @@ -8664,6 +8665,7 @@ "test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc", "test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc", "test/core/end2end/tests/retry_non_retriable_status.cc", + "test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc", "test/core/end2end/tests/retry_recv_initial_metadata.cc", "test/core/end2end/tests/retry_recv_message.cc", "test/core/end2end/tests/retry_server_pushback_delay.cc", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index d8c1a125a1a..067d9b300d3 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -8029,6 +8029,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_census_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -9735,6 +9758,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_compress_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -11413,6 +11459,28 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_fakesec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -14314,6 +14382,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -15835,6 +15926,25 @@ "linux" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_test", + "platforms": [ + "linux" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -17422,6 +17532,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -19151,6 +19284,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full+workarounds_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -20951,6 +21107,30 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_http_proxy_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -22704,6 +22884,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_load_reporting_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -24480,6 +24683,30 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_oauth2_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -31159,6 +31386,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_ssl_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -34014,6 +34264,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_uds_test", + "platforms": [ + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -36663,6 +36936,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_census_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -38346,6 +38642,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_compress_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -41225,6 +41544,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -42727,6 +43069,25 @@ "linux" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -44291,6 +44652,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -45997,6 +46381,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full+workarounds_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -47773,6 +48180,30 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_http_proxy_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -49503,6 +49934,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_load_reporting_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" @@ -55987,6 +56441,29 @@ "posix" ] }, + { + "args": [ + "retry_non_retriable_status_before_recv_trailing_metadata_started" + ], + "ci_platforms": [ + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_uds_nosec_test", + "platforms": [ + "linux", + "mac", + "posix" + ] + }, { "args": [ "retry_recv_initial_metadata" From 542bceb573b4c52a883f95ff240c6aba473790bc Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 12 Apr 2018 15:08:36 -0700 Subject: [PATCH 020/165] Fix race between READY notification and reffing connected subchannel. --- .../lb_policy/pick_first/pick_first.cc | 3 +- .../lb_policy/round_robin/round_robin.cc | 41 ++++++------------ .../lb_policy/subchannel_list.h | 43 ++++++++++++++----- 3 files changed, 49 insertions(+), 38 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 03e5c892813..24a0c83b1a6 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -350,6 +350,7 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { subchannel_list->num_subchannels()); } if (selected_->connected_subchannel() != nullptr) { +// FIXME: restructure to work more like RR? sd->SetConnectedSubchannelFromLocked(selected_); } selected_ = sd; @@ -433,6 +434,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( grpc_connectivity_state_name(connectivity_state()), p->shutdown_, subchannel_list()->shutting_down(), grpc_error_string(error)); } +// FIXME: move this to SubchannelData::OnConnectivityChangedLocked() // If the subchannel list is shutting down, stop watching. if (subchannel_list()->shutting_down() || error == GRPC_ERROR_CANCELLED) { StopConnectivityWatchLocked(); @@ -502,7 +504,6 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( case GRPC_CHANNEL_READY: { // Case 2. Promote p->latest_pending_subchannel_list_ to // p->subchannel_list_. - SetConnectedSubchannelFromSubchannelLocked(); if (p->latest_pending_subchannel_list_ == subchannel_list()) { GPR_ASSERT(p->subchannel_list_ != nullptr); p->subchannel_list_->ShutdownLocked("finish_update"); diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index f9bd0c0eb4e..889616e0561 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -597,6 +597,7 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( subchannel_list()->shutting_down(), grpc_error_string(error)); } GPR_ASSERT(subchannel() != nullptr); +// FIXME: move this to SubchannelData::OnConnectivityChangedLocked() // If the subchannel list is shutting down, stop watching. if (subchannel_list()->shutting_down() || error == GRPC_ERROR_CANCELLED) { StopConnectivityWatchLocked(); @@ -605,34 +606,20 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( GRPC_ERROR_UNREF(error); return; } - // Process the state change. - switch (connectivity_state()) { - case GRPC_CHANNEL_TRANSIENT_FAILURE: { - // Only re-resolve if we've started watching, not at startup time. - // Otherwise, if the subchannel was already in state TRANSIENT_FAILURE - // when the subchannel list was created, we'd wind up in a constant - // loop of re-resolution. - if (subchannel_list()->started_watching()) { - if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, - "[RR %p] Subchannel %p has gone into TRANSIENT_FAILURE. " - "Requesting re-resolution", - p, subchannel()); - } - p->TryReresolutionLocked(&grpc_lb_round_robin_trace, GRPC_ERROR_NONE); - } - break; - } - case GRPC_CHANNEL_READY: { - if (connected_subchannel() == nullptr) { - SetConnectedSubchannelFromSubchannelLocked(); - } - break; + // If the new state is TRANSIENT_FAILURE, re-resolve. + // Only do this if we've started watching, not at startup time. + // Otherwise, if the subchannel was already in state TRANSIENT_FAILURE + // when the subchannel list was created, we'd wind up in a constant + // loop of re-resolution. + if (connectivity_state() == GRPC_CHANNEL_TRANSIENT_FAILURE && + subchannel_list()->started_watching()) { + if (grpc_lb_round_robin_trace.enabled()) { + gpr_log(GPR_DEBUG, + "[RR %p] Subchannel %p has gone into TRANSIENT_FAILURE. " + "Requesting re-resolution", + p, subchannel()); } - case GRPC_CHANNEL_SHUTDOWN: - GPR_UNREACHABLE_CODE(return ); - case GRPC_CHANNEL_CONNECTING: - case GRPC_CHANNEL_IDLE:; // fallthrough + p->TryReresolutionLocked(&grpc_lb_round_robin_trace, GRPC_ERROR_NONE); } // Update state counters. subchannel_list()->UpdateStateCountersLocked( diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index b3fc5fefe9c..e13504313d6 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -94,12 +94,7 @@ class SubchannelData { return curr_connectivity_state_; } - // Sets the connected subchannel from the subchannel. - void SetConnectedSubchannelFromSubchannelLocked() { - connected_subchannel_ = - grpc_subchannel_get_connected_subchannel(subchannel_); - } - +// FIXME: remove // An alternative to SetConnectedSubchannelFromSubchannelLocked() for // cases where we are retaining a connected subchannel from a previous // subchannel list. This is slightly more efficient than getting the @@ -191,10 +186,16 @@ class SubchannelData { // OnConnectivityChangedLocked(). grpc_connectivity_state pending_connectivity_state_unsafe_; // Current connectivity state. +// FIXME: move this into RR, not needed in PF because connectivity_state +// is only used in ProcessConnectivityChangeLocked() +// (maybe pass it as a param and eliminate the accessor method?) grpc_connectivity_state curr_connectivity_state_; }; // A list of subchannels. +// FIXME: make this InternallyRefCounted, and have Orphan() do +// ShutdownLocked()? +// (also, maybe we don't need to take a ref to the LB policy anymore?) template class SubchannelList : public RefCountedWithTracing { public: @@ -348,14 +349,36 @@ template void SubchannelData:: OnConnectivityChangedLocked(void* arg, grpc_error* error) { SubchannelData* sd = static_cast(arg); +// FIXME: add trace logging + // If the subchannel is READY, get a ref to the connected subchannel. + if (sd->pending_connectivity_state_unsafe_ == GRPC_CHANNEL_READY) { + sd->connected_subchannel_ = + grpc_subchannel_get_connected_subchannel(sd->subchannel_); + // If the subchannel became disconnected between the time that this + // callback was scheduled and the time that it was actually run in the + // combiner, then the connected subchannel may have disappeared out from + // under us. In that case, instead of propagating the READY notification, + // we simply renew our watch and wait for the next notification. + // Note that we start the renewed watch from IDLE to make sure we + // get a notification for the next state, even if that state is + // READY again (e.g., if the subchannel has transitioned back to + // READY before the callback gets scheduled). + if (sd->connected_subchannel_ == nullptr) { + sd->pending_connectivity_state_unsafe_ = GRPC_CHANNEL_IDLE; + sd->StartConnectivityWatchLocked(); + return; + } + } + // If we get TRANSIENT_FAILURE, unref the connected subchannel. + else if (sd->pending_connectivity_state_unsafe_ == + GRPC_CHANNEL_TRANSIENT_FAILURE) { + sd->connected_subchannel_.reset(); + } // Now that we're inside the combiner, copy the pending connectivity // state (which was set by the connectivity state watcher) to // curr_connectivity_state_, which is what we use inside of the combiner. sd->curr_connectivity_state_ = sd->pending_connectivity_state_unsafe_; - // If we get TRANSIENT_FAILURE, unref the connected subchannel. - if (sd->curr_connectivity_state_ == GRPC_CHANNEL_TRANSIENT_FAILURE) { - sd->connected_subchannel_.reset(); - } + // Call the subclass's ProcessConnectivityChangeLocked() method. sd->ProcessConnectivityChangeLocked(GRPC_ERROR_REF(error)); } From 10c2ea3ca298d3e9fe50b64fd466edbe1fbf1b61 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Thu, 12 Apr 2018 18:11:45 -0400 Subject: [PATCH 021/165] Do not reach into BoringSSL internals. SSL_SESSION is a private struct and should not be accessed by calling code. There is no need to assert on the reference count in that test; the test already asserts on whether the SSL_SESSION was destroyed. --- test/core/tsi/ssl_session_cache_test.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/test/core/tsi/ssl_session_cache_test.cc b/test/core/tsi/ssl_session_cache_test.cc index 72df0e545c3..c86cefb3ff4 100644 --- a/test/core/tsi/ssl_session_cache_test.cc +++ b/test/core/tsi/ssl_session_cache_test.cc @@ -88,7 +88,6 @@ TEST(SslSessionCacheTest, InitialState) { // Verify session initial state. { tsi::SslSessionPtr tmp_sess = tracker.NewSession(1); - EXPECT_EQ(tmp_sess->references, 1); EXPECT_TRUE(tracker.IsAlive(1)); EXPECT_EQ(tracker.AliveCount(), 1); } From 44b3908bfc2c9b6369940d2b8974396c18d6a27d Mon Sep 17 00:00:00 2001 From: jiangtaoli2016 Date: Tue, 17 Apr 2018 08:46:17 -0700 Subject: [PATCH 022/165] update SSL root certificate from Mozilla --- etc/roots.pem | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/etc/roots.pem b/etc/roots.pem index 15d819ba23a..5dbd1ae6edb 100644 --- a/etc/roots.pem +++ b/etc/roots.pem @@ -3525,39 +3525,6 @@ AAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3CekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ 5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su -----END CERTIFICATE----- -# Issuer: CN=TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H5 O=TÜRKTRUST Bilgi İletişim ve Bilişim Güvenliği Hizmetleri A.Ş. -# Subject: CN=TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H5 O=TÜRKTRUST Bilgi İletişim ve Bilişim Güvenliği Hizmetleri A.Ş. -# Label: "TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H5" -# Serial: 156233699172481 -# MD5 Fingerprint: da:70:8e:f0:22:df:93:26:f6:5f:9f:d3:15:06:52:4e -# SHA1 Fingerprint: c4:18:f6:4d:46:d1:df:00:3d:27:30:13:72:43:a9:12:11:c6:75:fb -# SHA256 Fingerprint: 49:35:1b:90:34:44:c1:85:cc:dc:5c:69:3d:24:d8:55:5c:b2:08:d6:a8:14:13:07:69:9f:4a:f0:63:19:9d:78 ------BEGIN CERTIFICATE----- -MIIEJzCCAw+gAwIBAgIHAI4X/iQggTANBgkqhkiG9w0BAQsFADCBsTELMAkGA1UE -BhMCVFIxDzANBgNVBAcMBkFua2FyYTFNMEsGA1UECgxEVMOcUktUUlVTVCBCaWxn -aSDEsGxldGnFn2ltIHZlIEJpbGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkg -QS7Fni4xQjBABgNVBAMMOVTDnFJLVFJVU1QgRWxla3Ryb25payBTZXJ0aWZpa2Eg -SGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSBINTAeFw0xMzA0MzAwODA3MDFaFw0yMzA0 -MjgwODA3MDFaMIGxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMU0wSwYD -VQQKDERUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8 -dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBF -bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIEg1MIIB -IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApCUZ4WWe60ghUEoI5RHwWrom -/4NZzkQqL/7hzmAD/I0Dpe3/a6i6zDQGn1k19uwsu537jVJp45wnEFPzpALFp/kR -Gml1bsMdi9GYjZOHp3GXDSHHmflS0yxjXVW86B8BSLlg/kJK9siArs1mep5Fimh3 -4khon6La8eHBEJ/rPCmBp+EyCNSgBbGM+42WAA4+Jd9ThiI7/PS98wl+d+yG6w8z -5UNP9FR1bSmZLmZaQ9/LXMrI5Tjxfjs1nQ/0xVqhzPMggCTTV+wVunUlm+hkS7M0 -hO8EuPbJbKoCPrZV4jI3X/xml1/N1p7HIL9Nxqw/dV8c7TKcfGkAaZHjIxhT6QID -AQABo0IwQDAdBgNVHQ4EFgQUVpkHHtOsDGlktAxQR95DLL4gwPswDgYDVR0PAQH/ -BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAJ5FdnsX -SDLyOIspve6WSk6BGLFRRyDN0GSxDsnZAdkJzsiZ3GglE9Rc8qPoBP5yCccLqh0l -VX6Wmle3usURehnmp349hQ71+S4pL+f5bFgWV1Al9j4uPqrtd3GqqpmWRgqujuwq -URawXs3qZwQcWDD1YIq9pr1N5Za0/EKJAWv2cMhQOQwt1WbZyNKzMrcbGW3LM/nf -peYVhDfwwvJllpKQd/Ct9JDpEXjXk4nAPQu6KfTomZ1yju2dL+6SfaHx/126M2CF -Yv4HAqGEVka+lgqaE9chTLd8B59OTj+RdPsnnRHM3eaxynFNExc5JsUpISuTKWqW -+qtB4Uu2NQvAmxU= ------END CERTIFICATE----- - # Issuer: CN=Certinomis - Root CA O=Certinomis OU=0002 433998903 # Subject: CN=Certinomis - Root CA O=Certinomis OU=0002 433998903 # Label: "Certinomis - Root CA" From bb5482f944e6d3964b15552ec08b69afd2b1ff17 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 17 Apr 2018 10:29:27 -0700 Subject: [PATCH 023/165] Fix _channel ref count issue --- src/objective-c/GRPCClient/private/GRPCHost.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m index 283306262a1..07cfe1329b0 100644 --- a/src/objective-c/GRPCClient/private/GRPCHost.m +++ b/src/objective-c/GRPCClient/private/GRPCHost.m @@ -108,7 +108,7 @@ static NSMutableDictionary *kHostCache; serverName:(NSString *)serverName timeout:(NSTimeInterval)timeout completionQueue:(GRPCCompletionQueue *)queue { - GRPCChannel *channel; + __block GRPCChannel *channel; // This is racing -[GRPCHost disconnect]. @synchronized(self) { if (!_channel) { From bc1a1b4411aa6e6e955a95f9219a9afb009274e6 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 17 Apr 2018 14:39:25 -0700 Subject: [PATCH 024/165] Comment on the fix --- src/objective-c/GRPCClient/private/GRPCHost.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m index 07cfe1329b0..bfb1fd352c5 100644 --- a/src/objective-c/GRPCClient/private/GRPCHost.m +++ b/src/objective-c/GRPCClient/private/GRPCHost.m @@ -108,6 +108,9 @@ static NSMutableDictionary *kHostCache; serverName:(NSString *)serverName timeout:(NSTimeInterval)timeout completionQueue:(GRPCCompletionQueue *)queue { + // The __block attribute is to allow channel take refcount inside @synchronized block. Without + // this attribute, retain of channel object happens after objc_sync_exit in release builds, which + // may result in channel released before used. See grpc/#15033. __block GRPCChannel *channel; // This is racing -[GRPCHost disconnect]. @synchronized(self) { From dc4d01f6efa8ffc94d8c0223ca9fab44822ca691 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 17 Apr 2018 14:58:34 -0700 Subject: [PATCH 025/165] Add tracer for handshakers. --- doc/environment_variables.md | 1 + .../client_channel/http_connect_handshaker.cc | 2 +- src/core/lib/channel/channel_args.cc | 27 ++++++++++++ src/core/lib/channel/channel_args.h | 4 ++ src/core/lib/channel/handshaker.cc | 44 +++++++++++++++++++ src/core/lib/channel/handshaker.h | 4 ++ .../security/transport/security_handshaker.cc | 4 +- .../readahead_handshaker_server_ssl.cc | 2 +- 8 files changed, 84 insertions(+), 4 deletions(-) diff --git a/doc/environment_variables.md b/doc/environment_variables.md index ed46a48e5e9..587ab83ebdb 100644 --- a/doc/environment_variables.md +++ b/doc/environment_variables.md @@ -50,6 +50,7 @@ some configuration as environment variables that can be set. - channel_stack_builder - traces information about channel stacks being built - executor - traces grpc's internal thread pool ('the executor') - glb - traces the grpclb load balancer + - handshaker - traces handshaking state - http - traces state in the http2 transport engine - http2_stream_state - traces all http2 stream state mutations. - http1 - traces HTTP/1.x operations performed by gRPC diff --git a/src/core/ext/filters/client_channel/http_connect_handshaker.cc b/src/core/ext/filters/client_channel/http_connect_handshaker.cc index fb29fa788d0..4e8b8b71dbd 100644 --- a/src/core/ext/filters/client_channel/http_connect_handshaker.cc +++ b/src/core/ext/filters/client_channel/http_connect_handshaker.cc @@ -326,7 +326,7 @@ static void http_connect_handshaker_do_handshake( static const grpc_handshaker_vtable http_connect_handshaker_vtable = { http_connect_handshaker_destroy, http_connect_handshaker_shutdown, - http_connect_handshaker_do_handshake}; + http_connect_handshaker_do_handshake, "http_connect"}; static grpc_handshaker* grpc_http_connect_handshaker_create() { http_connect_handshaker* handshaker = diff --git a/src/core/lib/channel/channel_args.cc b/src/core/lib/channel/channel_args.cc index 66a86c2286d..2c93117dfc0 100644 --- a/src/core/lib/channel/channel_args.cc +++ b/src/core/lib/channel/channel_args.cc @@ -411,3 +411,30 @@ grpc_arg grpc_channel_arg_pointer_create( arg.value.pointer.vtable = vtable; return arg; } + +char* grpc_channel_args_string(const grpc_channel_args* args) { + gpr_strvec v; + gpr_strvec_init(&v); + for (size_t i = 0; i < args->num_args; ++i) { + const grpc_arg& arg = args->args[i]; + char* s; + switch (arg.type) { + case GRPC_ARG_INTEGER: + gpr_asprintf(&s, "%s=%d", arg.key, arg.value.integer); + break; + case GRPC_ARG_STRING: + gpr_asprintf(&s, "%s=%s", arg.key, arg.value.string); + break; + case GRPC_ARG_POINTER: + gpr_asprintf(&s, "%s=%p", arg.key, arg.value.pointer.p); + break; + default: + gpr_asprintf(&s, "arg with unknown type"); + } + gpr_strvec_add(&v, s); + } + char* result = + gpr_strjoin_sep(const_cast(v.strs), v.count, ", ", nullptr); + gpr_strvec_destroy(&v); + return result; +} diff --git a/src/core/lib/channel/channel_args.h b/src/core/lib/channel/channel_args.h index c0d6a17356b..5ff303a9dc6 100644 --- a/src/core/lib/channel/channel_args.h +++ b/src/core/lib/channel/channel_args.h @@ -124,4 +124,8 @@ grpc_arg grpc_channel_arg_integer_create(char* name, int value); grpc_arg grpc_channel_arg_pointer_create(char* name, void* value, const grpc_arg_pointer_vtable* vtable); +// Returns a string representing channel args in human-readable form. +// Callers takes ownership of result. +char* grpc_channel_args_string(const grpc_channel_args* args); + #endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H */ diff --git a/src/core/lib/channel/handshaker.cc b/src/core/lib/channel/handshaker.cc index 9b1af8d6cbd..00cca9a518b 100644 --- a/src/core/lib/channel/handshaker.cc +++ b/src/core/lib/channel/handshaker.cc @@ -22,11 +22,15 @@ #include #include +#include #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/handshaker.h" +#include "src/core/lib/debug/trace.h" #include "src/core/lib/iomgr/timer.h" +grpc_core::TraceFlag grpc_handshaker_trace(false, "handshaker"); + // // grpc_handshaker // @@ -52,6 +56,10 @@ void grpc_handshaker_do_handshake(grpc_handshaker* handshaker, args); } +const char* grpc_handshaker_name(grpc_handshaker* handshaker) { + return handshaker->vtable->name; +} + // // grpc_handshake_manager // @@ -127,6 +135,12 @@ static bool is_power_of_2(size_t n) { return (n & (n - 1)) == 0; } void grpc_handshake_manager_add(grpc_handshake_manager* mgr, grpc_handshaker* handshaker) { + if (grpc_handshaker_trace.enabled()) { + gpr_log( + GPR_DEBUG, + "handshake_manager %p: adding handshaker %s [%p] at index %" PRIuPTR, + mgr, grpc_handshaker_name(handshaker), handshaker, mgr->count); + } gpr_mu_lock(&mgr->mu); // To avoid allocating memory for each handshaker we add, we double // the number of elements every time we need more. @@ -172,23 +186,53 @@ void grpc_handshake_manager_shutdown(grpc_handshake_manager* mgr, GRPC_ERROR_UNREF(why); } +static char* handshaker_args_string(grpc_handshaker_args* args) { + char* args_str = grpc_channel_args_string(args->args); + char* str; + gpr_asprintf(&str, + "{endpoint=%p, args=%p {size=%" PRIuPTR + ": %s}, read_buffer=%p (length=%" PRIuPTR "), exit_early=%d}", + args->endpoint, args->args, args->args->num_args, args_str, + args->read_buffer, args->read_buffer->length, args->exit_early); + gpr_free(args_str); + return str; +} + // Helper function to call either the next handshaker or the // on_handshake_done callback. // Returns true if we've scheduled the on_handshake_done callback. static bool call_next_handshaker_locked(grpc_handshake_manager* mgr, grpc_error* error) { + if (grpc_handshaker_trace.enabled()) { + char* args_str = handshaker_args_string(&mgr->args); + gpr_log(GPR_DEBUG, + "handshake_manager %p: error=%s shutdown=%d index=%" PRIuPTR + ", args=%s", + mgr, grpc_error_string(error), mgr->shutdown, mgr->index, args_str); + gpr_free(args_str); + } GPR_ASSERT(mgr->index <= mgr->count); // If we got an error or we've been shut down or we're exiting early or // we've finished the last handshaker, invoke the on_handshake_done // callback. Otherwise, call the next handshaker. if (error != GRPC_ERROR_NONE || mgr->shutdown || mgr->args.exit_early || mgr->index == mgr->count) { + if (grpc_handshaker_trace.enabled()) { + gpr_log(GPR_DEBUG, "handshake_manager %p: handshaking complete", mgr); + } // Cancel deadline timer, since we're invoking the on_handshake_done // callback now. grpc_timer_cancel(&mgr->deadline_timer); GRPC_CLOSURE_SCHED(&mgr->on_handshake_done, error); mgr->shutdown = true; } else { + if (grpc_handshaker_trace.enabled()) { + gpr_log( + GPR_DEBUG, + "handshake_manager %p: calling handshaker %s [%p] at index %" PRIuPTR, + mgr, grpc_handshaker_name(mgr->handshakers[mgr->index]), + mgr->handshakers[mgr->index], mgr->index); + } grpc_handshaker_do_handshake(mgr->handshakers[mgr->index], mgr->acceptor, &mgr->call_next_handshaker, &mgr->args); } diff --git a/src/core/lib/channel/handshaker.h b/src/core/lib/channel/handshaker.h index dfecd81004e..be7fd127e4c 100644 --- a/src/core/lib/channel/handshaker.h +++ b/src/core/lib/channel/handshaker.h @@ -84,6 +84,9 @@ typedef struct { grpc_tcp_server_acceptor* acceptor, grpc_closure* on_handshake_done, grpc_handshaker_args* args); + + /// The name of the handshaker, for debugging purposes. + const char* name; } grpc_handshaker_vtable; /// Base struct. To subclass, make this the first member of the @@ -102,6 +105,7 @@ void grpc_handshaker_do_handshake(grpc_handshaker* handshaker, grpc_tcp_server_acceptor* acceptor, grpc_closure* on_handshake_done, grpc_handshaker_args* args); +const char* grpc_handshaker_name(grpc_handshaker* handshaker); /// /// grpc_handshake_manager diff --git a/src/core/lib/security/transport/security_handshaker.cc b/src/core/lib/security/transport/security_handshaker.cc index 0c97dfa6b3a..57dd3406bc7 100644 --- a/src/core/lib/security/transport/security_handshaker.cc +++ b/src/core/lib/security/transport/security_handshaker.cc @@ -406,7 +406,7 @@ static void security_handshaker_do_handshake(grpc_handshaker* handshaker, static const grpc_handshaker_vtable security_handshaker_vtable = { security_handshaker_destroy, security_handshaker_shutdown, - security_handshaker_do_handshake}; + security_handshaker_do_handshake, "security"}; static grpc_handshaker* security_handshaker_create( tsi_handshaker* handshaker, grpc_security_connector* connector) { @@ -456,7 +456,7 @@ static void fail_handshaker_do_handshake(grpc_handshaker* handshaker, static const grpc_handshaker_vtable fail_handshaker_vtable = { fail_handshaker_destroy, fail_handshaker_shutdown, - fail_handshaker_do_handshake}; + fail_handshaker_do_handshake, "security_fail"}; static grpc_handshaker* fail_handshaker_create() { grpc_handshaker* h = static_cast(gpr_malloc(sizeof(*h))); diff --git a/test/core/handshake/readahead_handshaker_server_ssl.cc b/test/core/handshake/readahead_handshaker_server_ssl.cc index 9788320e0d2..97e9c20ee4f 100644 --- a/test/core/handshake/readahead_handshaker_server_ssl.cc +++ b/test/core/handshake/readahead_handshaker_server_ssl.cc @@ -64,7 +64,7 @@ static void readahead_handshaker_do_handshake( const grpc_handshaker_vtable readahead_handshaker_vtable = { readahead_handshaker_destroy, readahead_handshaker_shutdown, - readahead_handshaker_do_handshake}; + readahead_handshaker_do_handshake, "read_ahead"}; static grpc_handshaker* readahead_handshaker_create() { grpc_handshaker* h = From c00f929da2803f0277243b1482cde4d51159f59f Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Tue, 17 Apr 2018 18:39:21 -0700 Subject: [PATCH 026/165] Update xcode version for macOS Obj-C tests to 9.2 --- tools/internal_ci/helper_scripts/prepare_build_macos_rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/internal_ci/helper_scripts/prepare_build_macos_rc b/tools/internal_ci/helper_scripts/prepare_build_macos_rc index 47c1d4b103c..d84bebd4ea0 100644 --- a/tools/internal_ci/helper_scripts/prepare_build_macos_rc +++ b/tools/internal_ci/helper_scripts/prepare_build_macos_rc @@ -67,7 +67,7 @@ pip install -U Mako six tox setuptools twisted pyyaml --user python export PYTHONPATH=/Library/Python/3.4/site-packages # set xcode version for Obj-C tests -sudo xcode-select -switch /Applications/Xcode_8.2.1.app/Contents/Developer +sudo xcode-select -switch /Applications/Xcode_9.2.app/Contents/Developer/ # TODO(jtattermusch): better debugging of clock skew, remove once not needed date From 908a2173fe7d3ec5e9c37275651a9fd1b272c0b7 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 18 Apr 2018 08:04:11 -0700 Subject: [PATCH 027/165] Avoid warnings from LLVM -Wself-assign. --- test/core/gprpp/ref_counted_ptr_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/gprpp/ref_counted_ptr_test.cc b/test/core/gprpp/ref_counted_ptr_test.cc index 2e398a77228..c8103451661 100644 --- a/test/core/gprpp/ref_counted_ptr_test.cc +++ b/test/core/gprpp/ref_counted_ptr_test.cc @@ -88,7 +88,7 @@ TEST(RefCountedPtr, CopyAssignmentWhenEmpty) { TEST(RefCountedPtr, CopyAssignmentToSelf) { RefCountedPtr foo(New()); - foo = foo; + foo = *&foo; // The "*&" avoids warnings from LLVM -Wself-assign. } TEST(RefCountedPtr, EnclosedScope) { From a0b5696652ec4e5d01acd4eae23dbe01b2a1fad1 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 18 Apr 2018 13:36:53 -0700 Subject: [PATCH 028/165] BoringSSL 10.0.2 --- src/objective-c/BoringSSL.podspec | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/objective-c/BoringSSL.podspec b/src/objective-c/BoringSSL.podspec index 8a32e9735da..ff55320d412 100644 --- a/src/objective-c/BoringSSL.podspec +++ b/src/objective-c/BoringSSL.podspec @@ -31,7 +31,7 @@ Pod::Spec.new do |s| s.name = 'BoringSSL' - version = '10.0' + version = '10.0.2' s.version = version s.summary = 'BoringSSL is a fork of OpenSSL that is designed to meet Google’s needs.' # Adapted from the homepage: @@ -67,11 +67,9 @@ Pod::Spec.new do |s| # "The name and email addresses of the library maintainers, not the Podspec maintainer." s.authors = 'Adam Langley', 'David Benjamin', 'Matt Braithwaite' - versions = version.split('.') - major_version = versions[0] + '.0' s.source = { :git => 'https://boringssl.googlesource.com/boringssl', - :tag => "version_for_cocoapods_#{major_version}", + :commit => "a20bb7ff8bb5057065a2e7941249773f9676cf45", } s.ios.deployment_target = '5.0' @@ -123,7 +121,8 @@ Pod::Spec.new do |s| 'ssl/**/*.{h,cc}', '*.{h,c}', 'crypto/*.{h,c}', - 'crypto/**/*.{h,c}' + 'crypto/**/*.{h,c}', + 'third_party/fiat/*.{h,c}' ss.private_header_files = 'ssl/*.h', 'ssl/**/*.h', '*.h', From b9424d07e234eec09413659f237a861d34a05132 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 12:30:28 -0700 Subject: [PATCH 029/165] Run pylint on Python test code The test modules were not under pylint jurisdiction, and actual bugs have been found in tests that would have been prevented had we run static analysis on the test code as we do on the core modules. This is the first step to enable pylint on tests. Due to numerous warnings since the code is not ready and needs refactoring, a new `.pylintrc` specific to tests is added that suppresses a number of valid warnings. The goal is stepwise elimination of each class of warning while refactoring the code such that it will not emit any warnings in future commits, always keeping the sanity checks passing and keeping the disruption minimal. --- .pylintrc-tests | 120 +++++++++++++++++++++++++++++++++++ tools/distrib/pylint_code.sh | 8 +++ 2 files changed, 128 insertions(+) create mode 100644 .pylintrc-tests diff --git a/.pylintrc-tests b/.pylintrc-tests new file mode 100644 index 00000000000..e68fd47b08f --- /dev/null +++ b/.pylintrc-tests @@ -0,0 +1,120 @@ +[VARIABLES] + +# TODO(https://github.com/PyCQA/pylint/issues/1345): How does the inspection +# not include "unused_" and "ignored_" by default? +dummy-variables-rgx=^ignored_|^unused_ + +[DESIGN] + +# NOTE(nathaniel): Not particularly attached to this value; it just seems to +# be what works for us at the moment (excepting the dead-code-walking Beta +# API). +max-args=6 + +[MISCELLANEOUS] + +# NOTE(nathaniel): We are big fans of "TODO(): " and +# "NOTE(): ". We do not allow "TODO:", +# "TODO():", "FIXME:", or anything else. +notes=FIXME,XXX + +[MESSAGES CONTROL] + +disable= + # These suppressions are specific to tests: + # + # TODO(https://github.com/grpc/grpc/issues/261): investigate + # each of the following one by one and consider eliminating + # the suppression category. + # Eventually, the hope is to eliminate the .pylintrc-tests + # altogether and rely on .pylintrc for everything. + pointless-statement, + no-member, + no-self-use, + attribute-defined-outside-init, + unused-argument, + unused-variable, + unused-import, + redefined-builtin, + too-many-public-methods, + too-many-locals, + redefined-variable-type, + old-style-class, + redefined-outer-name, + bare-except, + broad-except, + ungrouped-imports, + too-many-branches, + too-many-arguments, + too-many-format-args, + too-many-return-statements, + too-many-statements, + undefined-variable, + function-redefined, + unnecessary-lambda, + wildcard-import, + line-too-long, + unreachable, + wrong-import-position, + wrong-import-order, + non-iterator-returned, + undefined-loop-variable, + raising-bad-type, + bad-continuation, + # -- END OF TEST-SPECIFIC SUPPRESSIONS -- + + + # TODO(https://github.com/PyCQA/pylint/issues/59#issuecomment-283774279): + # Enable cyclic-import after a 1.7-or-later pylint release that + # recognizes our disable=cyclic-import suppressions. + cyclic-import, + # TODO(https://github.com/grpc/grpc/issues/8622): Enable this after the + # Beta API is removed. + duplicate-code, + # TODO(https://github.com/grpc/grpc/issues/261): Doesn't seem to + # understand enum and concurrent.futures; look into this later with the + # latest pylint version. + import-error, + # TODO(https://github.com/grpc/grpc/issues/261): Enable this one. + # Should take a little configuration but not much. + invalid-name, + # TODO(https://github.com/grpc/grpc/issues/261): This doesn't seem to + # work for now? Try with a later pylint? + locally-disabled, + # NOTE(nathaniel): What even is this? *Enabling* an inspection results + # in a warning? How does that encourage more analysis and coverage? + locally-enabled, + # NOTE(nathaniel): We don't write doc strings for most private code + # elements. + missing-docstring, + # NOTE(nathaniel): In numeric comparisons it is better to have the + # lesser (or lesser-or-equal-to) quantity on the left when the + # expression is true than it is to worry about which is an identifier + # and which a literal value. + misplaced-comparison-constant, + # NOTE(nathaniel): Our completely abstract interface classes don't have + # constructors. + no-init, + # TODO(https://github.com/grpc/grpc/issues/261): Doesn't yet play + # nicely with some of our code being implemented in Cython. Maybe in a + # later version? + no-name-in-module, + # TODO(https://github.com/grpc/grpc/issues/261): Suppress these where + # the odd shape of the authentication portion of the API forces them on + # us and enable everywhere else. + protected-access, + # NOTE(nathaniel): Pylint and I will probably never agree on this. + too-few-public-methods, + # NOTE(nathaniel): Pylint and I wil probably never agree on this for + # private classes. For public classes maybe? + too-many-instance-attributes, + # NOTE(nathaniel): Some of our modules have a lot of lines... of + # specification and documentation. Maybe if this were + # lines-of-code-based we would use it. + too-many-lines, + # TODO(https://github.com/grpc/grpc/issues/261): Maybe we could have + # this one if we extracted just a few more helper functions... + too-many-nested-blocks, + # NOTE(nathaniel): I have disputed the premise of this inspection from + # the beginning and will continue to do so until it goes away for good. + useless-else-on-loop, diff --git a/tools/distrib/pylint_code.sh b/tools/distrib/pylint_code.sh index bbacd48737a..307fe6c0c0c 100755 --- a/tools/distrib/pylint_code.sh +++ b/tools/distrib/pylint_code.sh @@ -25,6 +25,10 @@ DIRS=( 'src/python/grpcio_testing/grpc_testing' ) +TEST_DIRS=( + 'src/python/grpcio_tests/tests' +) + VIRTUALENV=python_pylint_venv virtualenv $VIRTUALENV @@ -36,4 +40,8 @@ for dir in "${DIRS[@]}"; do $PYTHON -m pylint --rcfile=.pylintrc -rn "$dir" || exit $? done +for dir in "${TEST_DIRS[@]}"; do + $PYTHON -m pylint --rcfile=.pylintrc-tests -rn "$dir" || exit $? +done + exit 0 From 344634c198ce71940f9b1682d675d1ededc05772 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 18 Apr 2018 13:05:40 -0700 Subject: [PATCH 030/165] Don't crash on null channel args or read buffer. --- src/core/lib/channel/channel_args.cc | 1 + src/core/lib/channel/handshaker.cc | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/lib/channel/channel_args.cc b/src/core/lib/channel/channel_args.cc index 2c93117dfc0..e49d532e11d 100644 --- a/src/core/lib/channel/channel_args.cc +++ b/src/core/lib/channel/channel_args.cc @@ -413,6 +413,7 @@ grpc_arg grpc_channel_arg_pointer_create( } char* grpc_channel_args_string(const grpc_channel_args* args) { + if (args == nullptr) return nullptr; gpr_strvec v; gpr_strvec_init(&v); for (size_t i = 0; i < args->num_args; ++i) { diff --git a/src/core/lib/channel/handshaker.cc b/src/core/lib/channel/handshaker.cc index 00cca9a518b..9cd97823d48 100644 --- a/src/core/lib/channel/handshaker.cc +++ b/src/core/lib/channel/handshaker.cc @@ -188,12 +188,15 @@ void grpc_handshake_manager_shutdown(grpc_handshake_manager* mgr, static char* handshaker_args_string(grpc_handshaker_args* args) { char* args_str = grpc_channel_args_string(args->args); + size_t num_args = args->args != nullptr ? args->args->num_args : 0; + size_t read_buffer_length = + args->read_buffer != nullptr ? args->read_buffer->length : 0; char* str; gpr_asprintf(&str, "{endpoint=%p, args=%p {size=%" PRIuPTR ": %s}, read_buffer=%p (length=%" PRIuPTR "), exit_early=%d}", - args->endpoint, args->args, args->args->num_args, args_str, - args->read_buffer, args->read_buffer->length, args->exit_early); + args->endpoint, args->args, num_args, args_str, + args->read_buffer, read_buffer_length, args->exit_early); gpr_free(args_str); return str; } From e7aa6c77a13b83842562726076b733fd94dc7bd9 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 23 Aug 2017 17:43:57 -0700 Subject: [PATCH 031/165] Convert SwiftSample to Swift 3 style --- .../examples/SwiftSample/ViewController.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/objective-c/examples/SwiftSample/ViewController.swift b/src/objective-c/examples/SwiftSample/ViewController.swift index 5931914b7b2..873d0923b74 100644 --- a/src/objective-c/examples/SwiftSample/ViewController.swift +++ b/src/objective-c/examples/SwiftSample/ViewController.swift @@ -36,7 +36,7 @@ class ViewController: UIViewController { // Example gRPC call using a generated proto client library: let service = RMTTestService(host: RemoteHost) - service.unaryCallWithRequest(request) { response, error in + service.unaryCall(with: request) { response, error in if let response = response { NSLog("1. Finished successfully with response:\n\(response)") } else { @@ -48,7 +48,7 @@ class ViewController: UIViewController { // Same but manipulating headers: var RPC : GRPCProtoCall! // Needed to convince Swift to capture by reference (__block) - RPC = service.RPCToUnaryCallWithRequest(request) { response, error in + RPC = service.rpcToUnaryCall(with: request) { response, error in if let response = response { NSLog("2. Finished successfully with response:\n\(response)") } else { @@ -59,7 +59,7 @@ class ViewController: UIViewController { } // TODO(jcanizales): Revert to using subscript syntax once XCode 8 is released. - RPC.requestHeaders.setObject("My value", forKey: "My-Header") + RPC.requestHeaders.setObject("My value", forKey: "My-Header" as NSCopying) RPC.start() @@ -70,18 +70,18 @@ class ViewController: UIViewController { let requestsWriter = GRXWriter(value: request.data()) - let call = GRPCCall(host: RemoteHost, path: method.HTTPPath, requestsWriter: requestsWriter) + let call = GRPCCall(host: RemoteHost, path: method?.httpPath, requestsWriter: requestsWriter) - call.requestHeaders.setObject("My value", forKey: "My-Header") + call?.requestHeaders.setObject("My value", forKey: "My-Header" as NSCopying) - call.startWithWriteable(GRXWriteable { response, error in - if let response = response as? NSData { + call?.start(with: GRXWriteable { response, error in + if let response = response as? Data { NSLog("3. Received response:\n\(try! RMTSimpleResponse(data: response))") } else { NSLog("3. Finished with error: \(error!)") } - NSLog("3. Response headers: \(call.responseHeaders)") - NSLog("3. Response trailers: \(call.responseTrailers)") + NSLog("3. Response headers: \(call?.responseHeaders)") + NSLog("3. Response trailers: \(call?.responseTrailers)") }) } } From 731d3e17dafb234bf52070db68339791e2a37c35 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Thu, 1 Feb 2018 14:00:27 -0800 Subject: [PATCH 032/165] Update Swift version in xcodeproj --- .../SwiftSample.xcodeproj/project.pbxproj | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/project.pbxproj b/src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/project.pbxproj index 6247d0b4e6f..0113d9c5d6a 100644 --- a/src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/project.pbxproj +++ b/src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/project.pbxproj @@ -168,13 +168,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwiftSample-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; A1738A987353B0BF2C64F0F7 /* [CP] Embed Pods Frameworks */ = { @@ -183,9 +186,26 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-SwiftSample/Pods-SwiftSample-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/BoringSSL/openssl.framework", + "${BUILT_PRODUCTS_DIR}/Protobuf/Protobuf.framework", + "${BUILT_PRODUCTS_DIR}/RemoteTest/RemoteTest.framework", + "${BUILT_PRODUCTS_DIR}/gRPC/GRPCClient.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-Core/grpc.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-ProtoRPC/ProtoRPC.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-RxLibrary/RxLibrary.framework", + "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RemoteTest.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GRPCClient.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/grpc.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ProtoRPC.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxLibrary.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -329,7 +349,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = ""; - SWIFT_VERSION = 2.3; + SWIFT_VERSION = 4.0; USER_HEADER_SEARCH_PATHS = ""; }; name = Debug; @@ -344,7 +364,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = ""; - SWIFT_VERSION = 2.3; + SWIFT_VERSION = 4.0; USER_HEADER_SEARCH_PATHS = ""; }; name = Release; From 68b906882c135d926c8aff695784c279745f8c25 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 18 Apr 2018 15:36:26 -0700 Subject: [PATCH 033/165] Address comments --- .../examples/SwiftSample/ViewController.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/objective-c/examples/SwiftSample/ViewController.swift b/src/objective-c/examples/SwiftSample/ViewController.swift index 873d0923b74..0ba6e21f02a 100644 --- a/src/objective-c/examples/SwiftSample/ViewController.swift +++ b/src/objective-c/examples/SwiftSample/ViewController.swift @@ -59,29 +59,29 @@ class ViewController: UIViewController { } // TODO(jcanizales): Revert to using subscript syntax once XCode 8 is released. - RPC.requestHeaders.setObject("My value", forKey: "My-Header" as NSCopying) + RPC.requestHeaders["My-Header"] = "My value" RPC.start() // Same example call using the generic gRPC client library: - let method = GRPCProtoMethod(package: "grpc.testing", service: "TestService", method: "UnaryCall") + let method = GRPCProtoMethod(package: "grpc.testing", service: "TestService", method: "UnaryCall")! let requestsWriter = GRXWriter(value: request.data()) - let call = GRPCCall(host: RemoteHost, path: method?.httpPath, requestsWriter: requestsWriter) + let call = GRPCCall(host: RemoteHost, path: method.httpPath, requestsWriter: requestsWriter)! - call?.requestHeaders.setObject("My value", forKey: "My-Header" as NSCopying) + call.requestHeaders["My-Header"] = "My value" - call?.start(with: GRXWriteable { response, error in + call.start(with: GRXWriteable { response, error in if let response = response as? Data { NSLog("3. Received response:\n\(try! RMTSimpleResponse(data: response))") } else { NSLog("3. Finished with error: \(error!)") } - NSLog("3. Response headers: \(call?.responseHeaders)") - NSLog("3. Response trailers: \(call?.responseTrailers)") + NSLog("3. Response headers: \(call.responseHeaders)") + NSLog("3. Response trailers: \(call.responseTrailers)") }) } } From 3d0aab0d587c1d8f6b431ec8f098359c35904ee9 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 20:04:33 -0400 Subject: [PATCH 034/165] Add 1.11.0 to portability tests --- tools/interop_matrix/client_matrix.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index 7b4b23425e1..730fe64dc0e 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -87,6 +87,9 @@ LANG_RELEASE_MATRIX = { { 'v1.10.0': None }, + { + 'v1.11.0': None + }, ], 'go': [ { @@ -192,6 +195,9 @@ LANG_RELEASE_MATRIX = { { 'v1.10.0': None }, + { + 'v1.11.0': None + }, ], 'node': [ { @@ -262,6 +268,9 @@ LANG_RELEASE_MATRIX = { { 'v1.10.0': None }, + { + 'v1.11.0': None + }, ], 'php': [ { @@ -294,6 +303,9 @@ LANG_RELEASE_MATRIX = { { 'v1.10.0': None }, + { + 'v1.11.0': None + }, ], 'csharp': [ #{'v1.0.1': None}, @@ -324,6 +336,9 @@ LANG_RELEASE_MATRIX = { { 'v1.10.0': None }, + { + 'v1.11.0': None + }, ], } From f7ca378ac9ed5d9fd9babe3f05c0839064449606 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Thu, 19 Apr 2018 00:48:54 -0400 Subject: [PATCH 035/165] Bump protobuf submodule to 3.5.2 --- third_party/protobuf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/protobuf b/third_party/protobuf index 2761122b810..b5fbb742af1 160000 --- a/third_party/protobuf +++ b/third_party/protobuf @@ -1 +1 @@ -Subproject commit 2761122b810fe8861004ae785cc3ab39f384d342 +Subproject commit b5fbb742af122b565925987e65c08957739976a7 From 12faa21c1a4e72c2d3ea9265d17b6e968f088d48 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Thu, 19 Apr 2018 00:49:59 -0400 Subject: [PATCH 036/165] Update sanity test to validate protobuf 3.5.2 --- tools/run_tests/sanity/check_submodules.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index b22bbd60e13..723d18565d7 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -31,7 +31,7 @@ cat << EOF | awk '{ print $1 }' | sort > "$want_submodules" 886e7d75368e3f4fab3f4d0d3584e4abfc557755 third_party/boringssl-with-bazel (version_for_cocoapods_7.0-857-g886e7d7) 30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e third_party/gflags (v2.2.0) ec44c6c1675c25b9827aacd08c02433cccde7780 third_party/googletest (release-1.8.0) - 2761122b810fe8861004ae785cc3ab39f384d342 third_party/protobuf (v3.5.0) + b5fbb742af122b565925987e65c08957739976a7 third_party/protobuf (v3.5.2) cacf7f1d4e3d44d871b605da3b647f07d718623f third_party/zlib (v1.2.11) 3be1924221e1326df520f8498d704a5c4c8d0cce third_party/cares/cares (cares-1_13_0) 73594cde8c9a52a102c4341c244c833aa61b9c06 third_party/bloaty From b7d49bbe1f4cc3db769b3a77013db616b8783e57 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Thu, 19 Apr 2018 00:59:37 -0400 Subject: [PATCH 037/165] Regenerate grpcio_tools protobuf dependencies --- tools/distrib/python/grpcio_tools/protoc_lib_deps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/distrib/python/grpcio_tools/protoc_lib_deps.py b/tools/distrib/python/grpcio_tools/protoc_lib_deps.py index 2c65fca628e..a0e1419ac12 100644 --- a/tools/distrib/python/grpcio_tools/protoc_lib_deps.py +++ b/tools/distrib/python/grpcio_tools/protoc_lib_deps.py @@ -20,4 +20,4 @@ PROTO_FILES=['google/protobuf/wrappers.proto', 'google/protobuf/type.proto', 'go CC_INCLUDE='third_party/protobuf/src' PROTO_INCLUDE='third_party/protobuf/src' -PROTOBUF_SUBMODULE_VERSION="2761122b810fe8861004ae785cc3ab39f384d342" +PROTOBUF_SUBMODULE_VERSION="b5fbb742af122b565925987e65c08957739976a7" From 7a20c962dfa547a7b7fc1a49e4ff3b2e92eae5e1 Mon Sep 17 00:00:00 2001 From: kpayson64 Date: Wed, 18 Apr 2018 15:19:55 -0700 Subject: [PATCH 038/165] Break out qps services into seperate protos --- CMakeLists.txt | 72 +- Makefile | 90 ++- build.yaml | 12 +- grpc.gyp | 4 +- .../BenchmarkService.cs | 46 ++ .../BenchmarkServiceGrpc.cs | 329 ++++++++ .../ReportQpsScenarioService.cs | 39 + .../ReportQpsScenarioServiceGrpc.cs | 148 ++++ .../Grpc.IntegrationTesting/Services.cs | 55 -- .../Grpc.IntegrationTesting/ServicesGrpc.cs | 745 ------------------ .../Grpc.IntegrationTesting/WorkerService.cs | 43 + .../WorkerServiceGrpc.cs | 326 ++++++++ src/csharp/generate_proto_csharp.sh | 2 +- .../Proto/Grpc/Testing/BenchmarkService.php | 41 + .../Src/Proto/Grpc/Testing/CompilerTest.php | 37 + .../Src/Proto/Grpc/Testing/Control.php | 163 ++-- .../Src/Proto/Grpc/Testing/Echo.php | 43 + .../Src/Proto/Grpc/Testing/EchoMessages.php | 54 ++ .../Src/Proto/Grpc/Testing/GPBEmpty.php | 26 + .../Src/Proto/Grpc/Testing/Metrics.php | 36 + .../Grpc/Testing/ReportQpsScenarioService.php | 30 + .../Src/Proto/Grpc/Testing/Test.php | 60 ++ .../Src/Proto/Grpc/Testing/WorkerService.php | 36 + .../Grpc/Testing/ClientConfig.php | 32 + .../generated_code/Grpc/Testing/DebugInfo.php | 77 ++ .../Grpc/Testing/EchoRequest.php | 75 ++ .../Grpc/Testing/EchoResponse.php | 75 ++ .../Grpc/Testing/EchoTestServiceClient.php | 93 +++ .../Grpc/Testing/EmptyMessage.php | 23 + .../Grpc/Testing/ErrorStatus.php | 103 +++ .../Grpc/Testing/GaugeRequest.php | 51 ++ .../Grpc/Testing/GaugeResponse.php | 126 +++ .../Grpc/Testing/MetricsServiceClient.php | 69 ++ .../Grpc/Testing/NoRpcServiceClient.php | 35 + .../generated_code/Grpc/Testing/PBEmpty.php | 30 + .../generated_code/Grpc/Testing/PBVoid.php | 23 + .../Grpc/Testing/ProxyClientServiceClient.php | 8 +- .../Grpc/Testing/ReconnectServiceClient.php | 64 ++ .../ReportQpsScenarioServiceClient.php | 2 +- .../generated_code/Grpc/Testing/Request.php | 23 + .../Grpc/Testing/RequestParams.php | 431 ++++++++++ .../generated_code/Grpc/Testing/Response.php | 23 + .../Grpc/Testing/ResponseParams.php | 101 +++ .../Grpc/Testing/ServiceAClient.php | 97 +++ .../Grpc/Testing/ServiceBClient.php | 54 ++ .../Grpc/Testing/TestServiceClient.php | 152 ++++ .../UnimplementedEchoServiceClient.php | 47 ++ .../Testing/UnimplementedServiceClient.php | 53 ++ .../Grpc/Testing/WorkerServiceClient.php | 6 +- src/proto/grpc/testing/BUILD | 23 +- ...services.proto => benchmark_service.proto} | 30 - .../testing/report_qps_scenario_service.proto | 26 + src/proto/grpc/testing/worker_service.proto | 45 ++ .../tests/qps/benchmark_client.py | 5 +- .../tests/qps/benchmark_server.py | 7 +- .../grpcio_tests/tests/qps/qps_worker.py | 5 +- .../grpcio_tests/tests/qps/worker_server.py | 6 +- .../tests/testing/_server_test.py | 5 - src/ruby/pb/generate_proto_ruby.sh | 8 +- src/ruby/qps/client.rb | 2 +- src/ruby/qps/proxy-worker.rb | 2 +- src/ruby/qps/server.rb | 2 +- src/ruby/qps/src/proto/grpc/core/stats_pb.rb | 33 + ...services_pb.rb => benchmark_service_pb.rb} | 3 +- .../testing/benchmark_service_services_pb.rb | 56 ++ .../qps/src/proto/grpc/testing/control_pb.rb | 27 + .../testing/report_qps_scenario_service_pb.rb | 13 + ...report_qps_scenario_service_services_pb.rb | 42 + .../qps/src/proto/grpc/testing/stats_pb.rb | 13 + .../proto/grpc/testing/worker_service_pb.rb | 13 + ...es_pb.rb => worker_service_services_pb.rb} | 23 +- src/ruby/qps/worker.rb | 2 +- test/cpp/qps/BUILD | 6 +- test/cpp/qps/client.h | 2 +- test/cpp/qps/client_async.cc | 2 +- test/cpp/qps/client_sync.cc | 2 +- test/cpp/qps/driver.cc | 1 + test/cpp/qps/qps_worker.cc | 2 +- test/cpp/qps/report.cc | 2 +- test/cpp/qps/report.h | 2 +- test/cpp/qps/server_async.cc | 2 +- test/cpp/qps/server_sync.cc | 2 +- .../generated/sources_and_headers.json | 40 +- 83 files changed, 3735 insertions(+), 1029 deletions(-) create mode 100644 src/csharp/Grpc.IntegrationTesting/BenchmarkService.cs create mode 100644 src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs create mode 100644 src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioService.cs create mode 100644 src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs delete mode 100644 src/csharp/Grpc.IntegrationTesting/Services.cs delete mode 100644 src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs create mode 100644 src/csharp/Grpc.IntegrationTesting/WorkerService.cs create mode 100644 src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs create mode 100644 src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/BenchmarkService.php create mode 100644 src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/CompilerTest.php create mode 100644 src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Echo.php create mode 100644 src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/EchoMessages.php create mode 100644 src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/GPBEmpty.php create mode 100644 src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Metrics.php create mode 100644 src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/ReportQpsScenarioService.php create mode 100644 src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Test.php create mode 100644 src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/WorkerService.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/DebugInfo.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/EchoRequest.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/EchoResponse.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/EchoTestServiceClient.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/EmptyMessage.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/ErrorStatus.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/GaugeRequest.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/GaugeResponse.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/MetricsServiceClient.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/NoRpcServiceClient.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/PBEmpty.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/PBVoid.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/ReconnectServiceClient.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/Request.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/RequestParams.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/Response.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/ResponseParams.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/ServiceAClient.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/ServiceBClient.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/TestServiceClient.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/UnimplementedEchoServiceClient.php create mode 100644 src/php/tests/qps/generated_code/Grpc/Testing/UnimplementedServiceClient.php rename src/proto/grpc/testing/{services.proto => benchmark_service.proto} (59%) create mode 100644 src/proto/grpc/testing/report_qps_scenario_service.proto create mode 100644 src/proto/grpc/testing/worker_service.proto create mode 100644 src/ruby/qps/src/proto/grpc/core/stats_pb.rb rename src/ruby/qps/src/proto/grpc/testing/{services_pb.rb => benchmark_service_pb.rb} (71%) create mode 100644 src/ruby/qps/src/proto/grpc/testing/benchmark_service_services_pb.rb create mode 100644 src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_pb.rb create mode 100644 src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_services_pb.rb create mode 100644 src/ruby/qps/src/proto/grpc/testing/worker_service_pb.rb rename src/ruby/qps/src/proto/grpc/testing/{services_services_pb.rb => worker_service_services_pb.rb} (74%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18400ea22a3..88df3fb0fbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4993,10 +4993,18 @@ add_library(qps ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/control.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/control.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/control.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/benchmark_service.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/benchmark_service.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/benchmark_service.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/benchmark_service.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/report_qps_scenario_service.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/report_qps_scenario_service.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/worker_service.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/worker_service.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/worker_service.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/worker_service.grpc.pb.h test/cpp/qps/benchmark_config.cc test/cpp/qps/client_async.cc test/cpp/qps/client_sync.cc @@ -5033,7 +5041,13 @@ protobuf_generate_grpc_cpp( src/proto/grpc/testing/control.proto ) protobuf_generate_grpc_cpp( - src/proto/grpc/testing/services.proto + src/proto/grpc/testing/benchmark_service.proto +) +protobuf_generate_grpc_cpp( + src/proto/grpc/testing/report_qps_scenario_service.proto +) +protobuf_generate_grpc_cpp( + src/proto/grpc/testing/worker_service.proto ) target_include_directories(qps @@ -10733,10 +10747,18 @@ add_executable(codegen_test_full ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/payloads.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/payloads.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/payloads.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/benchmark_service.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/benchmark_service.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/benchmark_service.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/benchmark_service.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/report_qps_scenario_service.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/report_qps_scenario_service.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/worker_service.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/worker_service.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/worker_service.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/worker_service.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/stats.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/stats.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/stats.pb.h @@ -10756,7 +10778,13 @@ protobuf_generate_grpc_cpp( src/proto/grpc/testing/payloads.proto ) protobuf_generate_grpc_cpp( - src/proto/grpc/testing/services.proto + src/proto/grpc/testing/benchmark_service.proto +) +protobuf_generate_grpc_cpp( + src/proto/grpc/testing/report_qps_scenario_service.proto +) +protobuf_generate_grpc_cpp( + src/proto/grpc/testing/worker_service.proto ) protobuf_generate_grpc_cpp( src/proto/grpc/testing/stats.proto @@ -10805,10 +10833,18 @@ add_executable(codegen_test_minimal ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/payloads.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/payloads.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/payloads.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/benchmark_service.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/benchmark_service.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/benchmark_service.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/benchmark_service.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/report_qps_scenario_service.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/report_qps_scenario_service.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/worker_service.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/worker_service.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/worker_service.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/worker_service.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/stats.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/stats.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/stats.pb.h @@ -10829,7 +10865,13 @@ protobuf_generate_grpc_cpp( src/proto/grpc/testing/payloads.proto ) protobuf_generate_grpc_cpp( - src/proto/grpc/testing/services.proto + src/proto/grpc/testing/benchmark_service.proto +) +protobuf_generate_grpc_cpp( + src/proto/grpc/testing/report_qps_scenario_service.proto +) +protobuf_generate_grpc_cpp( + src/proto/grpc/testing/worker_service.proto ) protobuf_generate_grpc_cpp( src/proto/grpc/testing/stats.proto diff --git a/Makefile b/Makefile index da5f2efebf9..dce07b2d7fb 100644 --- a/Makefile +++ b/Makefile @@ -2569,6 +2569,22 @@ $(GENDIR)/src/proto/grpc/status/status.grpc.pb.cc: src/proto/grpc/status/status. $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< endif +ifeq ($(NO_PROTOC),true) +$(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc: protoc_dep_error +$(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc: protoc_dep_error +else + +$(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc: src/proto/grpc/testing/benchmark_service.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/messages.pb.cc + $(E) "[PROTOC] Generating protobuf CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --cpp_out=$(GENDIR) $< + +$(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc: src/proto/grpc/testing/benchmark_service.proto $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc + $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< +endif + ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc: protoc_dep_error @@ -2716,16 +2732,16 @@ $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc: src/proto/grpc/testing/pay endif ifeq ($(NO_PROTOC),true) -$(GENDIR)/src/proto/grpc/testing/services.pb.cc: protoc_dep_error -$(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc: protoc_dep_error +$(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc: protoc_dep_error +$(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc: protoc_dep_error else -$(GENDIR)/src/proto/grpc/testing/services.pb.cc: src/proto/grpc/testing/services.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc +$(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc: src/proto/grpc/testing/report_qps_scenario_service.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --cpp_out=$(GENDIR) $< -$(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc: src/proto/grpc/testing/services.proto $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc +$(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc: src/proto/grpc/testing/report_qps_scenario_service.proto $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" $(Q) mkdir -p `dirname $@` $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< @@ -2763,6 +2779,22 @@ $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc: src/proto/grpc/testing/test.pr $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< endif +ifeq ($(NO_PROTOC),true) +$(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc: protoc_dep_error +$(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc: protoc_dep_error +else + +$(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc: src/proto/grpc/testing/worker_service.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/control.pb.cc + $(E) "[PROTOC] Generating protobuf CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --cpp_out=$(GENDIR) $< + +$(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc: src/proto/grpc/testing/worker_service.proto $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc + $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< +endif + ifeq ($(CONFIG),stapprof) src/core/profiling/stap_timers.c: $(GENDIR)/src/core/profiling/stap_probes.h @@ -7180,7 +7212,9 @@ LIBQPS_SRC = \ $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc \ - $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc \ test/cpp/qps/benchmark_config.cc \ test/cpp/qps/client_async.cc \ test/cpp/qps/client_sync.cc \ @@ -7236,16 +7270,16 @@ ifneq ($(NO_DEPS),true) -include $(LIBQPS_OBJS:.o=.dep) endif endif -$(OBJDIR)/$(CONFIG)/test/cpp/qps/benchmark_config.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_sync.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/driver.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/parse_json.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_worker.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/report.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_async.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_sync.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/test/cpp/qps/usage_timer.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/benchmark_config.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_sync.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/driver.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/parse_json.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_worker.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/report.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_async.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_sync.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/qps/usage_timer.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc LIBGRPC_CSHARP_EXT_SRC = \ @@ -16496,7 +16530,9 @@ CODEGEN_TEST_FULL_SRC = \ $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc \ - $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc \ test/cpp/codegen/codegen_test_full.cc \ @@ -16535,7 +16571,11 @@ $(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/messages.o: $(LIBDIR)/$(CONFIG)/libg $(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/payloads.o: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a -$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/services.o: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/benchmark_service.o: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + +$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/report_qps_scenario_service.o: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + +$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/worker_service.o: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/stats.o: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a @@ -16548,14 +16588,16 @@ ifneq ($(NO_DEPS),true) -include $(CODEGEN_TEST_FULL_OBJS:.o=.dep) endif endif -$(OBJDIR)/$(CONFIG)/test/cpp/codegen/codegen_test_full.o: $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/codegen/codegen_test_full.o: $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc CODEGEN_TEST_MINIMAL_SRC = \ $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc \ - $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc \ test/cpp/codegen/codegen_test_minimal.cc \ src/cpp/codegen/codegen_init.cc \ @@ -16595,7 +16637,11 @@ $(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/messages.o: $(LIBDIR)/$(CONFIG)/libg $(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/payloads.o: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a -$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/services.o: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/benchmark_service.o: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + +$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/report_qps_scenario_service.o: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + +$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/worker_service.o: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/stats.o: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a @@ -16610,8 +16656,8 @@ ifneq ($(NO_DEPS),true) -include $(CODEGEN_TEST_MINIMAL_OBJS:.o=.dep) endif endif -$(OBJDIR)/$(CONFIG)/test/cpp/codegen/codegen_test_minimal.o: $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc -$(OBJDIR)/$(CONFIG)/src/cpp/codegen/codegen_init.o: $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/codegen/codegen_test_minimal.o: $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/src/cpp/codegen/codegen_init.o: $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.pb.cc $(GENDIR)/src/proto/grpc/testing/benchmark_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.pb.cc $(GENDIR)/src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.pb.cc $(GENDIR)/src/proto/grpc/testing/worker_service.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc CREDENTIALS_TEST_SRC = \ diff --git a/build.yaml b/build.yaml index fde95d7fcd2..e9ad25d7114 100644 --- a/build.yaml +++ b/build.yaml @@ -1910,7 +1910,9 @@ libs: - src/proto/grpc/testing/payloads.proto - src/proto/grpc/testing/stats.proto - src/proto/grpc/testing/control.proto - - src/proto/grpc/testing/services.proto + - src/proto/grpc/testing/benchmark_service.proto + - src/proto/grpc/testing/report_qps_scenario_service.proto + - src/proto/grpc/testing/worker_service.proto - test/cpp/qps/benchmark_config.cc - test/cpp/qps/client_async.cc - test/cpp/qps/client_sync.cc @@ -4266,7 +4268,9 @@ targets: - src/proto/grpc/testing/control.proto - src/proto/grpc/testing/messages.proto - src/proto/grpc/testing/payloads.proto - - src/proto/grpc/testing/services.proto + - src/proto/grpc/testing/benchmark_service.proto + - src/proto/grpc/testing/report_qps_scenario_service.proto + - src/proto/grpc/testing/worker_service.proto - src/proto/grpc/testing/stats.proto - test/cpp/codegen/codegen_test_full.cc deps: @@ -4285,7 +4289,9 @@ targets: - src/proto/grpc/testing/control.proto - src/proto/grpc/testing/messages.proto - src/proto/grpc/testing/payloads.proto - - src/proto/grpc/testing/services.proto + - src/proto/grpc/testing/benchmark_service.proto + - src/proto/grpc/testing/report_qps_scenario_service.proto + - src/proto/grpc/testing/worker_service.proto - src/proto/grpc/testing/stats.proto - test/cpp/codegen/codegen_test_minimal.cc deps: diff --git a/grpc.gyp b/grpc.gyp index 8d9422eee6e..a32dec1b404 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -1652,7 +1652,9 @@ 'src/proto/grpc/testing/payloads.proto', 'src/proto/grpc/testing/stats.proto', 'src/proto/grpc/testing/control.proto', - 'src/proto/grpc/testing/services.proto', + 'src/proto/grpc/testing/benchmark_service.proto', + 'src/proto/grpc/testing/report_qps_scenario_service.proto', + 'src/proto/grpc/testing/worker_service.proto', 'test/cpp/qps/benchmark_config.cc', 'test/cpp/qps/client_async.cc', 'test/cpp/qps/client_sync.cc', diff --git a/src/csharp/Grpc.IntegrationTesting/BenchmarkService.cs b/src/csharp/Grpc.IntegrationTesting/BenchmarkService.cs new file mode 100644 index 00000000000..11d34c6341d --- /dev/null +++ b/src/csharp/Grpc.IntegrationTesting/BenchmarkService.cs @@ -0,0 +1,46 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/benchmark_service.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Grpc.Testing { + + /// Holder for reflection information generated from src/proto/grpc/testing/benchmark_service.proto + public static partial class BenchmarkServiceReflection { + + #region Descriptor + /// File descriptor for src/proto/grpc/testing/benchmark_service.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static BenchmarkServiceReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci5zcmMvcHJvdG8vZ3JwYy90ZXN0aW5nL2JlbmNobWFya19zZXJ2aWNlLnBy", + "b3RvEgxncnBjLnRlc3RpbmcaJXNyYy9wcm90by9ncnBjL3Rlc3RpbmcvbWVz", + "c2FnZXMucHJvdG8ypgMKEEJlbmNobWFya1NlcnZpY2USRgoJVW5hcnlDYWxs", + "EhsuZ3JwYy50ZXN0aW5nLlNpbXBsZVJlcXVlc3QaHC5ncnBjLnRlc3Rpbmcu", + "U2ltcGxlUmVzcG9uc2USTgoNU3RyZWFtaW5nQ2FsbBIbLmdycGMudGVzdGlu", + "Zy5TaW1wbGVSZXF1ZXN0GhwuZ3JwYy50ZXN0aW5nLlNpbXBsZVJlc3BvbnNl", + "KAEwARJSChNTdHJlYW1pbmdGcm9tQ2xpZW50EhsuZ3JwYy50ZXN0aW5nLlNp", + "bXBsZVJlcXVlc3QaHC5ncnBjLnRlc3RpbmcuU2ltcGxlUmVzcG9uc2UoARJS", + "ChNTdHJlYW1pbmdGcm9tU2VydmVyEhsuZ3JwYy50ZXN0aW5nLlNpbXBsZVJl", + "cXVlc3QaHC5ncnBjLnRlc3RpbmcuU2ltcGxlUmVzcG9uc2UwARJSChFTdHJl", + "YW1pbmdCb3RoV2F5cxIbLmdycGMudGVzdGluZy5TaW1wbGVSZXF1ZXN0Ghwu", + "Z3JwYy50ZXN0aW5nLlNpbXBsZVJlc3BvbnNlKAEwAWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Grpc.Testing.MessagesReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null)); + } + #endregion + + } +} + +#endregion Designer generated code diff --git a/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs new file mode 100644 index 00000000000..20b933fdfac --- /dev/null +++ b/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs @@ -0,0 +1,329 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/benchmark_service.proto +// +// Original file comments: +// Copyright 2015 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. +// +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. +#pragma warning disable 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Grpc.Testing { + public static partial class BenchmarkService + { + static readonly string __ServiceName = "grpc.testing.BenchmarkService"; + + static readonly grpc::Marshaller __Marshaller_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom); + + static readonly grpc::Method __Method_UnaryCall = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "UnaryCall", + __Marshaller_SimpleRequest, + __Marshaller_SimpleResponse); + + static readonly grpc::Method __Method_StreamingCall = new grpc::Method( + grpc::MethodType.DuplexStreaming, + __ServiceName, + "StreamingCall", + __Marshaller_SimpleRequest, + __Marshaller_SimpleResponse); + + static readonly grpc::Method __Method_StreamingFromClient = new grpc::Method( + grpc::MethodType.ClientStreaming, + __ServiceName, + "StreamingFromClient", + __Marshaller_SimpleRequest, + __Marshaller_SimpleResponse); + + static readonly grpc::Method __Method_StreamingFromServer = new grpc::Method( + grpc::MethodType.ServerStreaming, + __ServiceName, + "StreamingFromServer", + __Marshaller_SimpleRequest, + __Marshaller_SimpleResponse); + + static readonly grpc::Method __Method_StreamingBothWays = new grpc::Method( + grpc::MethodType.DuplexStreaming, + __ServiceName, + "StreamingBothWays", + __Marshaller_SimpleRequest, + __Marshaller_SimpleResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Grpc.Testing.BenchmarkServiceReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of BenchmarkService + public abstract partial class BenchmarkServiceBase + { + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Repeated sequence of one request followed by one response. + /// Should be called streaming ping-pong + /// The server returns the client payload as-is on each response + /// + /// Used for reading requests from the client. + /// Used for sending responses back to the client. + /// The context of the server-side call handler being invoked. + /// A task indicating completion of the handler. + public virtual global::System.Threading.Tasks.Task StreamingCall(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Single-sided unbounded streaming from client to server + /// The server returns the client payload as-is once the client does WritesDone + /// + /// Used for reading requests from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task StreamingFromClient(grpc::IAsyncStreamReader requestStream, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Single-sided unbounded streaming from server to client + /// The server repeatedly returns the client payload as-is + /// + /// The request received from the client. + /// Used for sending responses back to the client. + /// The context of the server-side call handler being invoked. + /// A task indicating completion of the handler. + public virtual global::System.Threading.Tasks.Task StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Two-sided unbounded streaming between server to client + /// Both sides send the content of their own choice to the other + /// + /// Used for reading requests from the client. + /// Used for sending responses back to the client. + /// The context of the server-side call handler being invoked. + /// A task indicating completion of the handler. + public virtual global::System.Threading.Tasks.Task StreamingBothWays(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for BenchmarkService + public partial class BenchmarkServiceClient : grpc::ClientBase + { + /// Creates a new client for BenchmarkService + /// The channel to use to make remote calls. + public BenchmarkServiceClient(grpc::Channel channel) : base(channel) + { + } + /// Creates a new client for BenchmarkService that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public BenchmarkServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected BenchmarkServiceClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return UnaryCall(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); + } + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return UnaryCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); + } + /// + /// Repeated sequence of one request followed by one response. + /// Should be called streaming ping-pong + /// The server returns the client payload as-is on each response + /// + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall StreamingCall(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return StreamingCall(new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Repeated sequence of one request followed by one response. + /// Should be called streaming ping-pong + /// The server returns the client payload as-is on each response + /// + /// The options for the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall StreamingCall(grpc::CallOptions options) + { + return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options); + } + /// + /// Single-sided unbounded streaming from client to server + /// The server returns the client payload as-is once the client does WritesDone + /// + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncClientStreamingCall StreamingFromClient(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return StreamingFromClient(new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Single-sided unbounded streaming from client to server + /// The server returns the client payload as-is once the client does WritesDone + /// + /// The options for the call. + /// The call object. + public virtual grpc::AsyncClientStreamingCall StreamingFromClient(grpc::CallOptions options) + { + return CallInvoker.AsyncClientStreamingCall(__Method_StreamingFromClient, null, options); + } + /// + /// Single-sided unbounded streaming from server to client + /// The server repeatedly returns the client payload as-is + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncServerStreamingCall StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return StreamingFromServer(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Single-sided unbounded streaming from server to client + /// The server repeatedly returns the client payload as-is + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncServerStreamingCall StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncServerStreamingCall(__Method_StreamingFromServer, null, options, request); + } + /// + /// Two-sided unbounded streaming between server to client + /// Both sides send the content of their own choice to the other + /// + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall StreamingBothWays(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return StreamingBothWays(new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Two-sided unbounded streaming between server to client + /// Both sides send the content of their own choice to the other + /// + /// The options for the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall StreamingBothWays(grpc::CallOptions options) + { + return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingBothWays, null, options); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration) + { + return new BenchmarkServiceClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) + .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall) + .AddMethod(__Method_StreamingFromClient, serviceImpl.StreamingFromClient) + .AddMethod(__Method_StreamingFromServer, serviceImpl.StreamingFromServer) + .AddMethod(__Method_StreamingBothWays, serviceImpl.StreamingBothWays).Build(); + } + + } +} +#endregion diff --git a/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioService.cs b/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioService.cs new file mode 100644 index 00000000000..b82cb52e300 --- /dev/null +++ b/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioService.cs @@ -0,0 +1,39 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/report_qps_scenario_service.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Grpc.Testing { + + /// Holder for reflection information generated from src/proto/grpc/testing/report_qps_scenario_service.proto + public static partial class ReportQpsScenarioServiceReflection { + + #region Descriptor + /// File descriptor for src/proto/grpc/testing/report_qps_scenario_service.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ReportQpsScenarioServiceReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjhzcmMvcHJvdG8vZ3JwYy90ZXN0aW5nL3JlcG9ydF9xcHNfc2NlbmFyaW9f", + "c2VydmljZS5wcm90bxIMZ3JwYy50ZXN0aW5nGiRzcmMvcHJvdG8vZ3JwYy90", + "ZXN0aW5nL2NvbnRyb2wucHJvdG8yXgoYUmVwb3J0UXBzU2NlbmFyaW9TZXJ2", + "aWNlEkIKDlJlcG9ydFNjZW5hcmlvEhwuZ3JwYy50ZXN0aW5nLlNjZW5hcmlv", + "UmVzdWx0GhIuZ3JwYy50ZXN0aW5nLlZvaWRiBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Grpc.Testing.ControlReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null)); + } + #endregion + + } +} + +#endregion Designer generated code diff --git a/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs new file mode 100644 index 00000000000..c9c6f75c8c1 --- /dev/null +++ b/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs @@ -0,0 +1,148 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/report_qps_scenario_service.proto +// +// Original file comments: +// Copyright 2015 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. +// +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. +#pragma warning disable 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Grpc.Testing { + public static partial class ReportQpsScenarioService + { + static readonly string __ServiceName = "grpc.testing.ReportQpsScenarioService"; + + static readonly grpc::Marshaller __Marshaller_ScenarioResult = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ScenarioResult.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom); + + static readonly grpc::Method __Method_ReportScenario = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "ReportScenario", + __Marshaller_ScenarioResult, + __Marshaller_Void); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Grpc.Testing.ReportQpsScenarioServiceReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of ReportQpsScenarioService + public abstract partial class ReportQpsScenarioServiceBase + { + /// + /// Report results of a QPS test benchmark scenario. + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for ReportQpsScenarioService + public partial class ReportQpsScenarioServiceClient : grpc::ClientBase + { + /// Creates a new client for ReportQpsScenarioService + /// The channel to use to make remote calls. + public ReportQpsScenarioServiceClient(grpc::Channel channel) : base(channel) + { + } + /// Creates a new client for ReportQpsScenarioService that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public ReportQpsScenarioServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected ReportQpsScenarioServiceClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected ReportQpsScenarioServiceClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + /// + /// Report results of a QPS test benchmark scenario. + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Grpc.Testing.Void ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ReportScenario(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Report results of a QPS test benchmark scenario. + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Grpc.Testing.Void ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_ReportScenario, null, options, request); + } + /// + /// Report results of a QPS test benchmark scenario. + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall ReportScenarioAsync(global::Grpc.Testing.ScenarioResult request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ReportScenarioAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Report results of a QPS test benchmark scenario. + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall ReportScenarioAsync(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_ReportScenario, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override ReportQpsScenarioServiceClient NewInstance(ClientBaseConfiguration configuration) + { + return new ReportQpsScenarioServiceClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(ReportQpsScenarioServiceBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_ReportScenario, serviceImpl.ReportScenario).Build(); + } + + } +} +#endregion diff --git a/src/csharp/Grpc.IntegrationTesting/Services.cs b/src/csharp/Grpc.IntegrationTesting/Services.cs deleted file mode 100644 index 4b761706ed7..00000000000 --- a/src/csharp/Grpc.IntegrationTesting/Services.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/proto/grpc/testing/services.proto -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Grpc.Testing { - - /// Holder for reflection information generated from src/proto/grpc/testing/services.proto - public static partial class ServicesReflection { - - #region Descriptor - /// File descriptor for src/proto/grpc/testing/services.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static ServicesReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiVzcmMvcHJvdG8vZ3JwYy90ZXN0aW5nL3NlcnZpY2VzLnByb3RvEgxncnBj", - "LnRlc3RpbmcaJXNyYy9wcm90by9ncnBjL3Rlc3RpbmcvbWVzc2FnZXMucHJv", - "dG8aJHNyYy9wcm90by9ncnBjL3Rlc3RpbmcvY29udHJvbC5wcm90bzKmAwoQ", - "QmVuY2htYXJrU2VydmljZRJGCglVbmFyeUNhbGwSGy5ncnBjLnRlc3Rpbmcu", - "U2ltcGxlUmVxdWVzdBocLmdycGMudGVzdGluZy5TaW1wbGVSZXNwb25zZRJO", - "Cg1TdHJlYW1pbmdDYWxsEhsuZ3JwYy50ZXN0aW5nLlNpbXBsZVJlcXVlc3Qa", - "HC5ncnBjLnRlc3RpbmcuU2ltcGxlUmVzcG9uc2UoATABElIKE1N0cmVhbWlu", - "Z0Zyb21DbGllbnQSGy5ncnBjLnRlc3RpbmcuU2ltcGxlUmVxdWVzdBocLmdy", - "cGMudGVzdGluZy5TaW1wbGVSZXNwb25zZSgBElIKE1N0cmVhbWluZ0Zyb21T", - "ZXJ2ZXISGy5ncnBjLnRlc3RpbmcuU2ltcGxlUmVxdWVzdBocLmdycGMudGVz", - "dGluZy5TaW1wbGVSZXNwb25zZTABElIKEVN0cmVhbWluZ0JvdGhXYXlzEhsu", - "Z3JwYy50ZXN0aW5nLlNpbXBsZVJlcXVlc3QaHC5ncnBjLnRlc3RpbmcuU2lt", - "cGxlUmVzcG9uc2UoATABMpcCCg1Xb3JrZXJTZXJ2aWNlEkUKCVJ1blNlcnZl", - "chIYLmdycGMudGVzdGluZy5TZXJ2ZXJBcmdzGhouZ3JwYy50ZXN0aW5nLlNl", - "cnZlclN0YXR1cygBMAESRQoJUnVuQ2xpZW50EhguZ3JwYy50ZXN0aW5nLkNs", - "aWVudEFyZ3MaGi5ncnBjLnRlc3RpbmcuQ2xpZW50U3RhdHVzKAEwARJCCglD", - "b3JlQ291bnQSGS5ncnBjLnRlc3RpbmcuQ29yZVJlcXVlc3QaGi5ncnBjLnRl", - "c3RpbmcuQ29yZVJlc3BvbnNlEjQKClF1aXRXb3JrZXISEi5ncnBjLnRlc3Rp", - "bmcuVm9pZBoSLmdycGMudGVzdGluZy5Wb2lkMl4KGFJlcG9ydFFwc1NjZW5h", - "cmlvU2VydmljZRJCCg5SZXBvcnRTY2VuYXJpbxIcLmdycGMudGVzdGluZy5T", - "Y2VuYXJpb1Jlc3VsdBoSLmdycGMudGVzdGluZy5Wb2lkYgZwcm90bzM=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Grpc.Testing.MessagesReflection.Descriptor, global::Grpc.Testing.ControlReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, null)); - } - #endregion - - } -} - -#endregion Designer generated code diff --git a/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs b/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs deleted file mode 100644 index 46b328a773f..00000000000 --- a/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs +++ /dev/null @@ -1,745 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/proto/grpc/testing/services.proto -// -// Original file comments: -// Copyright 2015 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. -// -// An integration test service that covers all the method signature permutations -// of unary/streaming requests/responses. -#pragma warning disable 1591 -#region Designer generated code - -using grpc = global::Grpc.Core; - -namespace Grpc.Testing { - public static partial class BenchmarkService - { - static readonly string __ServiceName = "grpc.testing.BenchmarkService"; - - static readonly grpc::Marshaller __Marshaller_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom); - - static readonly grpc::Method __Method_UnaryCall = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "UnaryCall", - __Marshaller_SimpleRequest, - __Marshaller_SimpleResponse); - - static readonly grpc::Method __Method_StreamingCall = new grpc::Method( - grpc::MethodType.DuplexStreaming, - __ServiceName, - "StreamingCall", - __Marshaller_SimpleRequest, - __Marshaller_SimpleResponse); - - static readonly grpc::Method __Method_StreamingFromClient = new grpc::Method( - grpc::MethodType.ClientStreaming, - __ServiceName, - "StreamingFromClient", - __Marshaller_SimpleRequest, - __Marshaller_SimpleResponse); - - static readonly grpc::Method __Method_StreamingFromServer = new grpc::Method( - grpc::MethodType.ServerStreaming, - __ServiceName, - "StreamingFromServer", - __Marshaller_SimpleRequest, - __Marshaller_SimpleResponse); - - static readonly grpc::Method __Method_StreamingBothWays = new grpc::Method( - grpc::MethodType.DuplexStreaming, - __ServiceName, - "StreamingBothWays", - __Marshaller_SimpleRequest, - __Marshaller_SimpleResponse); - - /// Service descriptor - public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor - { - get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[0]; } - } - - /// Base class for server-side implementations of BenchmarkService - public abstract partial class BenchmarkServiceBase - { - /// - /// One request followed by one response. - /// The server returns the client payload as-is. - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Repeated sequence of one request followed by one response. - /// Should be called streaming ping-pong - /// The server returns the client payload as-is on each response - /// - /// Used for reading requests from the client. - /// Used for sending responses back to the client. - /// The context of the server-side call handler being invoked. - /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task StreamingCall(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Single-sided unbounded streaming from client to server - /// The server returns the client payload as-is once the client does WritesDone - /// - /// Used for reading requests from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task StreamingFromClient(grpc::IAsyncStreamReader requestStream, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Single-sided unbounded streaming from server to client - /// The server repeatedly returns the client payload as-is - /// - /// The request received from the client. - /// Used for sending responses back to the client. - /// The context of the server-side call handler being invoked. - /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Two-sided unbounded streaming between server to client - /// Both sides send the content of their own choice to the other - /// - /// Used for reading requests from the client. - /// Used for sending responses back to the client. - /// The context of the server-side call handler being invoked. - /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task StreamingBothWays(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - } - - /// Client for BenchmarkService - public partial class BenchmarkServiceClient : grpc::ClientBase - { - /// Creates a new client for BenchmarkService - /// The channel to use to make remote calls. - public BenchmarkServiceClient(grpc::Channel channel) : base(channel) - { - } - /// Creates a new client for BenchmarkService that uses a custom CallInvoker. - /// The callInvoker to use to make remote calls. - public BenchmarkServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) - { - } - /// Protected parameterless constructor to allow creation of test doubles. - protected BenchmarkServiceClient() : base() - { - } - /// Protected constructor to allow creation of configured clients. - /// The client configuration. - protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration) - { - } - - /// - /// One request followed by one response. - /// The server returns the client payload as-is. - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return UnaryCall(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// One request followed by one response. - /// The server returns the client payload as-is. - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); - } - /// - /// One request followed by one response. - /// The server returns the client payload as-is. - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return UnaryCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// One request followed by one response. - /// The server returns the client payload as-is. - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); - } - /// - /// Repeated sequence of one request followed by one response. - /// Should be called streaming ping-pong - /// The server returns the client payload as-is on each response - /// - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncDuplexStreamingCall StreamingCall(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return StreamingCall(new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Repeated sequence of one request followed by one response. - /// Should be called streaming ping-pong - /// The server returns the client payload as-is on each response - /// - /// The options for the call. - /// The call object. - public virtual grpc::AsyncDuplexStreamingCall StreamingCall(grpc::CallOptions options) - { - return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options); - } - /// - /// Single-sided unbounded streaming from client to server - /// The server returns the client payload as-is once the client does WritesDone - /// - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncClientStreamingCall StreamingFromClient(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return StreamingFromClient(new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Single-sided unbounded streaming from client to server - /// The server returns the client payload as-is once the client does WritesDone - /// - /// The options for the call. - /// The call object. - public virtual grpc::AsyncClientStreamingCall StreamingFromClient(grpc::CallOptions options) - { - return CallInvoker.AsyncClientStreamingCall(__Method_StreamingFromClient, null, options); - } - /// - /// Single-sided unbounded streaming from server to client - /// The server repeatedly returns the client payload as-is - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncServerStreamingCall StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return StreamingFromServer(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Single-sided unbounded streaming from server to client - /// The server repeatedly returns the client payload as-is - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncServerStreamingCall StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncServerStreamingCall(__Method_StreamingFromServer, null, options, request); - } - /// - /// Two-sided unbounded streaming between server to client - /// Both sides send the content of their own choice to the other - /// - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncDuplexStreamingCall StreamingBothWays(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return StreamingBothWays(new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Two-sided unbounded streaming between server to client - /// Both sides send the content of their own choice to the other - /// - /// The options for the call. - /// The call object. - public virtual grpc::AsyncDuplexStreamingCall StreamingBothWays(grpc::CallOptions options) - { - return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingBothWays, null, options); - } - /// Creates a new instance of client from given ClientBaseConfiguration. - protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration) - { - return new BenchmarkServiceClient(configuration); - } - } - - /// Creates service definition that can be registered with a server - /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl) - { - return grpc::ServerServiceDefinition.CreateBuilder() - .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) - .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall) - .AddMethod(__Method_StreamingFromClient, serviceImpl.StreamingFromClient) - .AddMethod(__Method_StreamingFromServer, serviceImpl.StreamingFromServer) - .AddMethod(__Method_StreamingBothWays, serviceImpl.StreamingBothWays).Build(); - } - - } - public static partial class WorkerService - { - static readonly string __ServiceName = "grpc.testing.WorkerService"; - - static readonly grpc::Marshaller __Marshaller_ServerArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_ServerStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_ClientArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_ClientStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_CoreRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_CoreResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom); - - static readonly grpc::Method __Method_RunServer = new grpc::Method( - grpc::MethodType.DuplexStreaming, - __ServiceName, - "RunServer", - __Marshaller_ServerArgs, - __Marshaller_ServerStatus); - - static readonly grpc::Method __Method_RunClient = new grpc::Method( - grpc::MethodType.DuplexStreaming, - __ServiceName, - "RunClient", - __Marshaller_ClientArgs, - __Marshaller_ClientStatus); - - static readonly grpc::Method __Method_CoreCount = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "CoreCount", - __Marshaller_CoreRequest, - __Marshaller_CoreResponse); - - static readonly grpc::Method __Method_QuitWorker = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "QuitWorker", - __Marshaller_Void, - __Marshaller_Void); - - /// Service descriptor - public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor - { - get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[1]; } - } - - /// Base class for server-side implementations of WorkerService - public abstract partial class WorkerServiceBase - { - /// - /// Start server with specified workload. - /// First request sent specifies the ServerConfig followed by ServerStatus - /// response. After that, a "Mark" can be sent anytime to request the latest - /// stats. Closing the stream will initiate shutdown of the test server - /// and once the shutdown has finished, the OK status is sent to terminate - /// this RPC. - /// - /// Used for reading requests from the client. - /// Used for sending responses back to the client. - /// The context of the server-side call handler being invoked. - /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task RunServer(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Start client with specified workload. - /// First request sent specifies the ClientConfig followed by ClientStatus - /// response. After that, a "Mark" can be sent anytime to request the latest - /// stats. Closing the stream will initiate shutdown of the test client - /// and once the shutdown has finished, the OK status is sent to terminate - /// this RPC. - /// - /// Used for reading requests from the client. - /// Used for sending responses back to the client. - /// The context of the server-side call handler being invoked. - /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task RunClient(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Just return the core count - unary call - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task CoreCount(global::Grpc.Testing.CoreRequest request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - /// - /// Quit this worker - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task QuitWorker(global::Grpc.Testing.Void request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - } - - /// Client for WorkerService - public partial class WorkerServiceClient : grpc::ClientBase - { - /// Creates a new client for WorkerService - /// The channel to use to make remote calls. - public WorkerServiceClient(grpc::Channel channel) : base(channel) - { - } - /// Creates a new client for WorkerService that uses a custom CallInvoker. - /// The callInvoker to use to make remote calls. - public WorkerServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) - { - } - /// Protected parameterless constructor to allow creation of test doubles. - protected WorkerServiceClient() : base() - { - } - /// Protected constructor to allow creation of configured clients. - /// The client configuration. - protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration) - { - } - - /// - /// Start server with specified workload. - /// First request sent specifies the ServerConfig followed by ServerStatus - /// response. After that, a "Mark" can be sent anytime to request the latest - /// stats. Closing the stream will initiate shutdown of the test server - /// and once the shutdown has finished, the OK status is sent to terminate - /// this RPC. - /// - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncDuplexStreamingCall RunServer(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return RunServer(new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Start server with specified workload. - /// First request sent specifies the ServerConfig followed by ServerStatus - /// response. After that, a "Mark" can be sent anytime to request the latest - /// stats. Closing the stream will initiate shutdown of the test server - /// and once the shutdown has finished, the OK status is sent to terminate - /// this RPC. - /// - /// The options for the call. - /// The call object. - public virtual grpc::AsyncDuplexStreamingCall RunServer(grpc::CallOptions options) - { - return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options); - } - /// - /// Start client with specified workload. - /// First request sent specifies the ClientConfig followed by ClientStatus - /// response. After that, a "Mark" can be sent anytime to request the latest - /// stats. Closing the stream will initiate shutdown of the test client - /// and once the shutdown has finished, the OK status is sent to terminate - /// this RPC. - /// - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncDuplexStreamingCall RunClient(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return RunClient(new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Start client with specified workload. - /// First request sent specifies the ClientConfig followed by ClientStatus - /// response. After that, a "Mark" can be sent anytime to request the latest - /// stats. Closing the stream will initiate shutdown of the test client - /// and once the shutdown has finished, the OK status is sent to terminate - /// this RPC. - /// - /// The options for the call. - /// The call object. - public virtual grpc::AsyncDuplexStreamingCall RunClient(grpc::CallOptions options) - { - return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options); - } - /// - /// Just return the core count - unary call - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return CoreCount(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Just return the core count - unary call - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request); - } - /// - /// Just return the core count - unary call - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return CoreCountAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Just return the core count - unary call - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request); - } - /// - /// Quit this worker - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return QuitWorker(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Quit this worker - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request); - } - /// - /// Quit this worker - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return QuitWorkerAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Quit this worker - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request); - } - /// Creates a new instance of client from given ClientBaseConfiguration. - protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration) - { - return new WorkerServiceClient(configuration); - } - } - - /// Creates service definition that can be registered with a server - /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(WorkerServiceBase serviceImpl) - { - return grpc::ServerServiceDefinition.CreateBuilder() - .AddMethod(__Method_RunServer, serviceImpl.RunServer) - .AddMethod(__Method_RunClient, serviceImpl.RunClient) - .AddMethod(__Method_CoreCount, serviceImpl.CoreCount) - .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build(); - } - - } - public static partial class ReportQpsScenarioService - { - static readonly string __ServiceName = "grpc.testing.ReportQpsScenarioService"; - - static readonly grpc::Marshaller __Marshaller_ScenarioResult = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ScenarioResult.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom); - - static readonly grpc::Method __Method_ReportScenario = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "ReportScenario", - __Marshaller_ScenarioResult, - __Marshaller_Void); - - /// Service descriptor - public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor - { - get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[2]; } - } - - /// Base class for server-side implementations of ReportQpsScenarioService - public abstract partial class ReportQpsScenarioServiceBase - { - /// - /// Report results of a QPS test benchmark scenario. - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - } - - /// Client for ReportQpsScenarioService - public partial class ReportQpsScenarioServiceClient : grpc::ClientBase - { - /// Creates a new client for ReportQpsScenarioService - /// The channel to use to make remote calls. - public ReportQpsScenarioServiceClient(grpc::Channel channel) : base(channel) - { - } - /// Creates a new client for ReportQpsScenarioService that uses a custom CallInvoker. - /// The callInvoker to use to make remote calls. - public ReportQpsScenarioServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) - { - } - /// Protected parameterless constructor to allow creation of test doubles. - protected ReportQpsScenarioServiceClient() : base() - { - } - /// Protected constructor to allow creation of configured clients. - /// The client configuration. - protected ReportQpsScenarioServiceClient(ClientBaseConfiguration configuration) : base(configuration) - { - } - - /// - /// Report results of a QPS test benchmark scenario. - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Grpc.Testing.Void ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return ReportScenario(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Report results of a QPS test benchmark scenario. - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Grpc.Testing.Void ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_ReportScenario, null, options, request); - } - /// - /// Report results of a QPS test benchmark scenario. - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall ReportScenarioAsync(global::Grpc.Testing.ScenarioResult request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return ReportScenarioAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Report results of a QPS test benchmark scenario. - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall ReportScenarioAsync(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_ReportScenario, null, options, request); - } - /// Creates a new instance of client from given ClientBaseConfiguration. - protected override ReportQpsScenarioServiceClient NewInstance(ClientBaseConfiguration configuration) - { - return new ReportQpsScenarioServiceClient(configuration); - } - } - - /// Creates service definition that can be registered with a server - /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(ReportQpsScenarioServiceBase serviceImpl) - { - return grpc::ServerServiceDefinition.CreateBuilder() - .AddMethod(__Method_ReportScenario, serviceImpl.ReportScenario).Build(); - } - - } -} -#endregion diff --git a/src/csharp/Grpc.IntegrationTesting/WorkerService.cs b/src/csharp/Grpc.IntegrationTesting/WorkerService.cs new file mode 100644 index 00000000000..7c829545aa7 --- /dev/null +++ b/src/csharp/Grpc.IntegrationTesting/WorkerService.cs @@ -0,0 +1,43 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/worker_service.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Grpc.Testing { + + /// Holder for reflection information generated from src/proto/grpc/testing/worker_service.proto + public static partial class WorkerServiceReflection { + + #region Descriptor + /// File descriptor for src/proto/grpc/testing/worker_service.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static WorkerServiceReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CitzcmMvcHJvdG8vZ3JwYy90ZXN0aW5nL3dvcmtlcl9zZXJ2aWNlLnByb3Rv", + "EgxncnBjLnRlc3RpbmcaJHNyYy9wcm90by9ncnBjL3Rlc3RpbmcvY29udHJv", + "bC5wcm90bzKXAgoNV29ya2VyU2VydmljZRJFCglSdW5TZXJ2ZXISGC5ncnBj", + "LnRlc3RpbmcuU2VydmVyQXJncxoaLmdycGMudGVzdGluZy5TZXJ2ZXJTdGF0", + "dXMoATABEkUKCVJ1bkNsaWVudBIYLmdycGMudGVzdGluZy5DbGllbnRBcmdz", + "GhouZ3JwYy50ZXN0aW5nLkNsaWVudFN0YXR1cygBMAESQgoJQ29yZUNvdW50", + "EhkuZ3JwYy50ZXN0aW5nLkNvcmVSZXF1ZXN0GhouZ3JwYy50ZXN0aW5nLkNv", + "cmVSZXNwb25zZRI0CgpRdWl0V29ya2VyEhIuZ3JwYy50ZXN0aW5nLlZvaWQa", + "Ei5ncnBjLnRlc3RpbmcuVm9pZGIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Grpc.Testing.ControlReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null)); + } + #endregion + + } +} + +#endregion Designer generated code diff --git a/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs new file mode 100644 index 00000000000..ede3ace4612 --- /dev/null +++ b/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs @@ -0,0 +1,326 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/worker_service.proto +// +// Original file comments: +// Copyright 2015 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. +// +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. +#pragma warning disable 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Grpc.Testing { + public static partial class WorkerService + { + static readonly string __ServiceName = "grpc.testing.WorkerService"; + + static readonly grpc::Marshaller __Marshaller_ServerArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ServerStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ClientArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ClientStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_CoreRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_CoreResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom); + + static readonly grpc::Method __Method_RunServer = new grpc::Method( + grpc::MethodType.DuplexStreaming, + __ServiceName, + "RunServer", + __Marshaller_ServerArgs, + __Marshaller_ServerStatus); + + static readonly grpc::Method __Method_RunClient = new grpc::Method( + grpc::MethodType.DuplexStreaming, + __ServiceName, + "RunClient", + __Marshaller_ClientArgs, + __Marshaller_ClientStatus); + + static readonly grpc::Method __Method_CoreCount = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "CoreCount", + __Marshaller_CoreRequest, + __Marshaller_CoreResponse); + + static readonly grpc::Method __Method_QuitWorker = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "QuitWorker", + __Marshaller_Void, + __Marshaller_Void); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Grpc.Testing.WorkerServiceReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of WorkerService + public abstract partial class WorkerServiceBase + { + /// + /// Start server with specified workload. + /// First request sent specifies the ServerConfig followed by ServerStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test server + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// + /// Used for reading requests from the client. + /// Used for sending responses back to the client. + /// The context of the server-side call handler being invoked. + /// A task indicating completion of the handler. + public virtual global::System.Threading.Tasks.Task RunServer(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Start client with specified workload. + /// First request sent specifies the ClientConfig followed by ClientStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test client + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// + /// Used for reading requests from the client. + /// Used for sending responses back to the client. + /// The context of the server-side call handler being invoked. + /// A task indicating completion of the handler. + public virtual global::System.Threading.Tasks.Task RunClient(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Just return the core count - unary call + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task CoreCount(global::Grpc.Testing.CoreRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + /// + /// Quit this worker + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + public virtual global::System.Threading.Tasks.Task QuitWorker(global::Grpc.Testing.Void request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for WorkerService + public partial class WorkerServiceClient : grpc::ClientBase + { + /// Creates a new client for WorkerService + /// The channel to use to make remote calls. + public WorkerServiceClient(grpc::Channel channel) : base(channel) + { + } + /// Creates a new client for WorkerService that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public WorkerServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected WorkerServiceClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + /// + /// Start server with specified workload. + /// First request sent specifies the ServerConfig followed by ServerStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test server + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall RunServer(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return RunServer(new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Start server with specified workload. + /// First request sent specifies the ServerConfig followed by ServerStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test server + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// + /// The options for the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall RunServer(grpc::CallOptions options) + { + return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options); + } + /// + /// Start client with specified workload. + /// First request sent specifies the ClientConfig followed by ClientStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test client + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall RunClient(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return RunClient(new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Start client with specified workload. + /// First request sent specifies the ClientConfig followed by ClientStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test client + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// + /// The options for the call. + /// The call object. + public virtual grpc::AsyncDuplexStreamingCall RunClient(grpc::CallOptions options) + { + return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options); + } + /// + /// Just return the core count - unary call + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return CoreCount(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Just return the core count - unary call + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request); + } + /// + /// Just return the core count - unary call + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return CoreCountAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Just return the core count - unary call + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request); + } + /// + /// Quit this worker + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return QuitWorker(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Quit this worker + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request); + } + /// + /// Quit this worker + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + public virtual grpc::AsyncUnaryCall QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return QuitWorkerAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Quit this worker + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + public virtual grpc::AsyncUnaryCall QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration) + { + return new WorkerServiceClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(WorkerServiceBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_RunServer, serviceImpl.RunServer) + .AddMethod(__Method_RunClient, serviceImpl.RunClient) + .AddMethod(__Method_CoreCount, serviceImpl.CoreCount) + .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build(); + } + + } +} +#endregion diff --git a/src/csharp/generate_proto_csharp.sh b/src/csharp/generate_proto_csharp.sh index 299dc3f8167..1a38f860e8a 100755 --- a/src/csharp/generate_proto_csharp.sh +++ b/src/csharp/generate_proto_csharp.sh @@ -42,4 +42,4 @@ $PROTOC --plugin=$PLUGIN --csharp_out=$TESTING_DIR/CoreStats --grpc_out=$TESTING # don't match the package names. Setting -I to the correct value src/proto # breaks the code generation. $PROTOC --plugin=$PLUGIN --csharp_out=$TESTING_DIR --grpc_out=$TESTING_DIR \ - -I . src/proto/grpc/testing/{control,echo_messages,empty,messages,metrics,payloads,services,stats,test}.proto + -I . src/proto/grpc/testing/{control,echo_messages,empty,messages,metrics,payloads,benchmark_service,report_qps_scenario_service,worker_service,stats,test}.proto diff --git a/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/BenchmarkService.php b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/BenchmarkService.php new file mode 100644 index 00000000000..906f6a2d846 --- /dev/null +++ b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/BenchmarkService.php @@ -0,0 +1,41 @@ +internalAddGeneratedFile(hex2bin( + "0aef030a2e7372632f70726f746f2f677270632f74657374696e672f6265" . + "6e63686d61726b5f736572766963652e70726f746f120c677270632e7465" . + "7374696e6732a6030a1042656e63686d61726b5365727669636512460a09" . + "556e61727943616c6c121b2e677270632e74657374696e672e53696d706c" . + "65526571756573741a1c2e677270632e74657374696e672e53696d706c65" . + "526573706f6e7365124e0a0d53747265616d696e6743616c6c121b2e6772" . + "70632e74657374696e672e53696d706c65526571756573741a1c2e677270" . + "632e74657374696e672e53696d706c65526573706f6e7365280130011252" . + "0a1353747265616d696e6746726f6d436c69656e74121b2e677270632e74" . + "657374696e672e53696d706c65526571756573741a1c2e677270632e7465" . + "7374696e672e53696d706c65526573706f6e7365280112520a1353747265" . + "616d696e6746726f6d536572766572121b2e677270632e74657374696e67" . + "2e53696d706c65526571756573741a1c2e677270632e74657374696e672e" . + "53696d706c65526573706f6e7365300112520a1153747265616d696e6742" . + "6f746857617973121b2e677270632e74657374696e672e53696d706c6552" . + "6571756573741a1c2e677270632e74657374696e672e53696d706c655265" . + "73706f6e736528013001620670726f746f33" + )); + + static::$is_initialized = true; + } +} + diff --git a/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/CompilerTest.php b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/CompilerTest.php new file mode 100644 index 00000000000..2c4fe92f052 --- /dev/null +++ b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/CompilerTest.php @@ -0,0 +1,37 @@ +internalAddGeneratedFile(hex2bin( + "0aa1030a2a7372632f70726f746f2f677270632f74657374696e672f636f" . + "6d70696c65725f746573742e70726f746f120c677270632e74657374696e" . + "6722090a0752657175657374220a0a08526573706f6e736532fe010a0853" . + "6572766963654112390a084d6574686f64413112152e677270632e746573" . + "74696e672e526571756573741a162e677270632e74657374696e672e5265" . + "73706f6e7365123b0a084d6574686f64413212152e677270632e74657374" . + "696e672e526571756573741a162e677270632e74657374696e672e526573" . + "706f6e73652801123b0a084d6574686f64413312152e677270632e746573" . + "74696e672e526571756573741a162e677270632e74657374696e672e5265" . + "73706f6e73653001123d0a084d6574686f64413412152e677270632e7465" . + "7374696e672e526571756573741a162e677270632e74657374696e672e52" . + "6573706f6e73652801300132450a08536572766963654212390a084d6574" . + "686f64423112152e677270632e74657374696e672e526571756573741a16" . + "2e677270632e74657374696e672e526573706f6e7365620670726f746f33" + )); + + static::$is_initialized = true; + } +} + diff --git a/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Control.php b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Control.php index 9b3a7529ec7..2319bcd0213 100644 --- a/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Control.php +++ b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Control.php @@ -17,7 +17,7 @@ class Control \GPBMetadata\Src\Proto\Grpc\Testing\Payloads::initOnce(); \GPBMetadata\Src\Proto\Grpc\Testing\Stats::initOnce(); $pool->internalAddGeneratedFile(hex2bin( - "0aa21a0a247372632f70726f746f2f677270632f74657374696e672f636f" . + "0abc1a0a247372632f70726f746f2f677270632f74657374696e672f636f" . "6e74726f6c2e70726f746f120c677270632e74657374696e671a22737263" . "2f70726f746f2f677270632f74657374696e672f73746174732e70726f74" . "6f22250a0d506f6973736f6e506172616d7312140a0c6f6666657265645f" . @@ -31,7 +31,7 @@ class Control "6f7665727269646518022001280912110a09637265645f74797065180320" . "012809224d0a0a4368616e6e656c417267120c0a046e616d651801200128" . "0912130a097374725f76616c7565180220012809480012130a09696e745f" . - "76616c7565180320012805480042070a0576616c756522d5040a0c436c69" . + "76616c7565180320012805480042070a0576616c756522ef040a0c436c69" . "656e74436f6e66696712160a0e7365727665725f74617267657473180120" . "032809122d0a0b636c69656e745f7479706518022001280e32182e677270" . "632e74657374696e672e436c69656e745479706512350a0f736563757269" . @@ -51,85 +51,86 @@ class Control "745f617069180f20012809122e0a0c6368616e6e656c5f61726773181020" . "03280b32182e677270632e74657374696e672e4368616e6e656c41726712" . "160a0e746872656164735f7065725f6371181120012805121b0a136d6573" . - "73616765735f7065725f73747265616d18122001280522380a0c436c6965" . - "6e7453746174757312280a05737461747318012001280b32192e67727063" . - "2e74657374696e672e436c69656e74537461747322150a044d61726b120d" . - "0a05726573657418012001280822680a0a436c69656e7441726773122b0a" . - "05736574757018012001280b321a2e677270632e74657374696e672e436c" . - "69656e74436f6e666967480012220a046d61726b18022001280b32122e67" . - "7270632e74657374696e672e4d61726b480042090a076172677479706522" . - "fd020a0c536572766572436f6e666967122d0a0b7365727665725f747970" . - "6518012001280e32182e677270632e74657374696e672e53657276657254" . - "79706512350a0f73656375726974795f706172616d7318022001280b321c" . - "2e677270632e74657374696e672e5365637572697479506172616d73120c" . - "0a04706f7274180420012805121c0a146173796e635f7365727665725f74" . - "68726561647318072001280512120a0a636f72655f6c696d697418082001" . - "280512330a0e7061796c6f61645f636f6e66696718092001280b321b2e67" . - "7270632e74657374696e672e5061796c6f6164436f6e66696712110a0963" . - "6f72655f6c697374180a2003280512180a106f746865725f736572766572" . - "5f617069180b2001280912160a0e746872656164735f7065725f6371180c" . - "20012805121c0a137265736f757263655f71756f74615f73697a6518e907" . - "20012805122f0a0c6368616e6e656c5f6172677318ea072003280b32182e" . - "677270632e74657374696e672e4368616e6e656c41726722680a0a536572" . - "76657241726773122b0a05736574757018012001280b321a2e677270632e" . - "74657374696e672e536572766572436f6e666967480012220a046d61726b" . - "18022001280b32122e677270632e74657374696e672e4d61726b48004209" . - "0a076172677479706522550a0c53657276657253746174757312280a0573" . - "7461747318012001280b32192e677270632e74657374696e672e53657276" . - "65725374617473120c0a04706f7274180220012805120d0a05636f726573" . - "180320012805220d0a0b436f726552657175657374221d0a0c436f726552" . - "6573706f6e7365120d0a05636f72657318012001280522060a04566f6964" . - "22fd010a085363656e6172696f120c0a046e616d6518012001280912310a" . - "0d636c69656e745f636f6e66696718022001280b321a2e677270632e7465" . - "7374696e672e436c69656e74436f6e66696712130a0b6e756d5f636c6965" . - "6e747318032001280512310a0d7365727665725f636f6e66696718042001" . - "280b321a2e677270632e74657374696e672e536572766572436f6e666967" . - "12130a0b6e756d5f7365727665727318052001280512160a0e7761726d75" . - "705f7365636f6e647318062001280512190a1162656e63686d61726b5f73" . - "65636f6e647318072001280512200a18737061776e5f6c6f63616c5f776f" . - "726b65725f636f756e7418082001280522360a095363656e6172696f7312" . - "290a097363656e6172696f7318012003280b32162e677270632e74657374" . - "696e672e5363656e6172696f2284040a155363656e6172696f526573756c" . - "7453756d6d617279120b0a03717073180120012801121b0a137170735f70" . - "65725f7365727665725f636f7265180220012801121a0a12736572766572" . - "5f73797374656d5f74696d6518032001280112180a107365727665725f75" . - "7365725f74696d65180420012801121a0a12636c69656e745f7379737465" . - "6d5f74696d6518052001280112180a10636c69656e745f757365725f7469" . - "6d6518062001280112120a0a6c6174656e63795f35301807200128011212" . - "0a0a6c6174656e63795f393018082001280112120a0a6c6174656e63795f" . - "393518092001280112120a0a6c6174656e63795f3939180a200128011213" . - "0a0b6c6174656e63795f393939180b2001280112180a107365727665725f" . - "6370755f7573616765180c2001280112260a1e7375636365737366756c5f" . - "72657175657374735f7065725f7365636f6e64180d2001280112220a1a66" . - "61696c65645f72657175657374735f7065725f7365636f6e64180e200128" . - "0112200a18636c69656e745f706f6c6c735f7065725f7265717565737418" . - "0f2001280112200a187365727665725f706f6c6c735f7065725f72657175" . - "65737418102001280112220a1a7365727665725f717565726965735f7065" . - "725f6370755f73656318112001280112220a1a636c69656e745f71756572" . - "6965735f7065725f6370755f7365631812200128012283030a0e5363656e" . - "6172696f526573756c7412280a087363656e6172696f18012001280b3216" . - "2e677270632e74657374696e672e5363656e6172696f122e0a096c617465" . - "6e6369657318022001280b321b2e677270632e74657374696e672e486973" . - "746f6772616d44617461122f0a0c636c69656e745f737461747318032003" . - "280b32192e677270632e74657374696e672e436c69656e74537461747312" . - "2f0a0c7365727665725f737461747318042003280b32192e677270632e74" . - "657374696e672e536572766572537461747312140a0c7365727665725f63" . - "6f72657318052003280512340a0773756d6d61727918062001280b32232e" . - "677270632e74657374696e672e5363656e6172696f526573756c7453756d" . - "6d61727912160a0e636c69656e745f737563636573731807200328081216" . - "0a0e7365727665725f7375636365737318082003280812390a0f72657175" . - "6573745f726573756c747318092003280b32202e677270632e7465737469" . - "6e672e52657175657374526573756c74436f756e742a410a0a436c69656e" . - "7454797065120f0a0b53594e435f434c49454e54100012100a0c4153594e" . - "435f434c49454e54100112100a0c4f544845525f434c49454e5410022a5b" . - "0a0a53657276657254797065120f0a0b53594e435f534552564552100012" . - "100a0c4153594e435f534552564552100112180a144153594e435f47454e" . - "455249435f534552564552100212100a0c4f544845525f53455256455210" . - "032a720a075270635479706512090a05554e4152591000120d0a09535452" . - "45414d494e47100112190a1553545245414d494e475f46524f4d5f434c49" . - "454e54100212190a1553545245414d494e475f46524f4d5f534552564552" . - "100312170a1353545245414d494e475f424f54485f574159531004620670" . - "726f746f33" + "73616765735f7065725f73747265616d18122001280512180a107573655f" . + "636f616c657363655f61706918132001280822380a0c436c69656e745374" . + "6174757312280a05737461747318012001280b32192e677270632e746573" . + "74696e672e436c69656e74537461747322150a044d61726b120d0a057265" . + "73657418012001280822680a0a436c69656e7441726773122b0a05736574" . + "757018012001280b321a2e677270632e74657374696e672e436c69656e74" . + "436f6e666967480012220a046d61726b18022001280b32122e677270632e" . + "74657374696e672e4d61726b480042090a076172677479706522fd020a0c" . + "536572766572436f6e666967122d0a0b7365727665725f74797065180120" . + "01280e32182e677270632e74657374696e672e5365727665725479706512" . + "350a0f73656375726974795f706172616d7318022001280b321c2e677270" . + "632e74657374696e672e5365637572697479506172616d73120c0a04706f" . + "7274180420012805121c0a146173796e635f7365727665725f7468726561" . + "647318072001280512120a0a636f72655f6c696d69741808200128051233" . + "0a0e7061796c6f61645f636f6e66696718092001280b321b2e677270632e" . + "74657374696e672e5061796c6f6164436f6e66696712110a09636f72655f" . + "6c697374180a2003280512180a106f746865725f7365727665725f617069" . + "180b2001280912160a0e746872656164735f7065725f6371180c20012805" . + "121c0a137265736f757263655f71756f74615f73697a6518e90720012805" . + "122f0a0c6368616e6e656c5f6172677318ea072003280b32182e67727063" . + "2e74657374696e672e4368616e6e656c41726722680a0a53657276657241" . + "726773122b0a05736574757018012001280b321a2e677270632e74657374" . + "696e672e536572766572436f6e666967480012220a046d61726b18022001" . + "280b32122e677270632e74657374696e672e4d61726b480042090a076172" . + "677479706522550a0c53657276657253746174757312280a057374617473" . + "18012001280b32192e677270632e74657374696e672e5365727665725374" . + "617473120c0a04706f7274180220012805120d0a05636f72657318032001" . + "2805220d0a0b436f726552657175657374221d0a0c436f7265526573706f" . + "6e7365120d0a05636f72657318012001280522060a04566f696422fd010a" . + "085363656e6172696f120c0a046e616d6518012001280912310a0d636c69" . + "656e745f636f6e66696718022001280b321a2e677270632e74657374696e" . + "672e436c69656e74436f6e66696712130a0b6e756d5f636c69656e747318" . + "032001280512310a0d7365727665725f636f6e66696718042001280b321a" . + "2e677270632e74657374696e672e536572766572436f6e66696712130a0b" . + "6e756d5f7365727665727318052001280512160a0e7761726d75705f7365" . + "636f6e647318062001280512190a1162656e63686d61726b5f7365636f6e" . + "647318072001280512200a18737061776e5f6c6f63616c5f776f726b6572" . + "5f636f756e7418082001280522360a095363656e6172696f7312290a0973" . + "63656e6172696f7318012003280b32162e677270632e74657374696e672e" . + "5363656e6172696f2284040a155363656e6172696f526573756c7453756d" . + "6d617279120b0a03717073180120012801121b0a137170735f7065725f73" . + "65727665725f636f7265180220012801121a0a127365727665725f737973" . + "74656d5f74696d6518032001280112180a107365727665725f757365725f" . + "74696d65180420012801121a0a12636c69656e745f73797374656d5f7469" . + "6d6518052001280112180a10636c69656e745f757365725f74696d651806" . + "2001280112120a0a6c6174656e63795f353018072001280112120a0a6c61" . + "74656e63795f393018082001280112120a0a6c6174656e63795f39351809" . + "2001280112120a0a6c6174656e63795f3939180a2001280112130a0b6c61" . + "74656e63795f393939180b2001280112180a107365727665725f6370755f" . + "7573616765180c2001280112260a1e7375636365737366756c5f72657175" . + "657374735f7065725f7365636f6e64180d2001280112220a1a6661696c65" . + "645f72657175657374735f7065725f7365636f6e64180e2001280112200a" . + "18636c69656e745f706f6c6c735f7065725f72657175657374180f200128" . + "0112200a187365727665725f706f6c6c735f7065725f7265717565737418" . + "102001280112220a1a7365727665725f717565726965735f7065725f6370" . + "755f73656318112001280112220a1a636c69656e745f717565726965735f" . + "7065725f6370755f7365631812200128012283030a0e5363656e6172696f" . + "526573756c7412280a087363656e6172696f18012001280b32162e677270" . + "632e74657374696e672e5363656e6172696f122e0a096c6174656e636965" . + "7318022001280b321b2e677270632e74657374696e672e486973746f6772" . + "616d44617461122f0a0c636c69656e745f737461747318032003280b3219" . + "2e677270632e74657374696e672e436c69656e745374617473122f0a0c73" . + "65727665725f737461747318042003280b32192e677270632e7465737469" . + "6e672e536572766572537461747312140a0c7365727665725f636f726573" . + "18052003280512340a0773756d6d61727918062001280b32232e67727063" . + "2e74657374696e672e5363656e6172696f526573756c7453756d6d617279" . + "12160a0e636c69656e745f7375636365737318072003280812160a0e7365" . + "727665725f7375636365737318082003280812390a0f726571756573745f" . + "726573756c747318092003280b32202e677270632e74657374696e672e52" . + "657175657374526573756c74436f756e742a410a0a436c69656e74547970" . + "65120f0a0b53594e435f434c49454e54100012100a0c4153594e435f434c" . + "49454e54100112100a0c4f544845525f434c49454e5410022a5b0a0a5365" . + "7276657254797065120f0a0b53594e435f534552564552100012100a0c41" . + "53594e435f534552564552100112180a144153594e435f47454e45524943" . + "5f534552564552100212100a0c4f544845525f53455256455210032a720a" . + "075270635479706512090a05554e4152591000120d0a0953545245414d49" . + "4e47100112190a1553545245414d494e475f46524f4d5f434c49454e5410" . + "0212190a1553545245414d494e475f46524f4d5f53455256455210031217" . + "0a1353545245414d494e475f424f54485f574159531004620670726f746f" . + "33" )); static::$is_initialized = true; diff --git a/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Echo.php b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Echo.php new file mode 100644 index 00000000000..77c5230f450 --- /dev/null +++ b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Echo.php @@ -0,0 +1,43 @@ +internalAddGeneratedFile(hex2bin( + "0aa6040a217372632f70726f746f2f677270632f74657374696e672f6563" . + "686f2e70726f746f120c677270632e74657374696e6732f6020a0f456368" . + "6f5465737453657276696365123d0a044563686f12192e677270632e7465" . + "7374696e672e4563686f526571756573741a1a2e677270632e7465737469" . + "6e672e4563686f526573706f6e736512480a0d5265717565737453747265" . + "616d12192e677270632e74657374696e672e4563686f526571756573741a" . + "1a2e677270632e74657374696e672e4563686f526573706f6e7365280112" . + "490a0e526573706f6e736553747265616d12192e677270632e7465737469" . + "6e672e4563686f526571756573741a1a2e677270632e74657374696e672e" . + "4563686f526573706f6e7365300112470a0a4269646953747265616d1219" . + "2e677270632e74657374696e672e4563686f526571756573741a1a2e6772" . + "70632e74657374696e672e4563686f526573706f6e73652801300112460a" . + "0d556e696d706c656d656e74656412192e677270632e74657374696e672e" . + "4563686f526571756573741a1a2e677270632e74657374696e672e456368" . + "6f526573706f6e736532620a18556e696d706c656d656e7465644563686f" . + "5365727669636512460a0d556e696d706c656d656e74656412192e677270" . + "632e74657374696e672e4563686f526571756573741a1a2e677270632e74" . + "657374696e672e4563686f526573706f6e7365320e0a0c4e6f5270635365" . + "7276696365620670726f746f33" + )); + + static::$is_initialized = true; + } +} + diff --git a/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/EchoMessages.php b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/EchoMessages.php new file mode 100644 index 00000000000..4bac8a29060 --- /dev/null +++ b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/EchoMessages.php @@ -0,0 +1,54 @@ +internalAddGeneratedFile(hex2bin( + "0a8f070a2a7372632f70726f746f2f677270632f74657374696e672f6563" . + "686f5f6d657373616765732e70726f746f120c677270632e74657374696e" . + "6722320a094465627567496e666f12150a0d737461636b5f656e74726965" . + "73180120032809120e0a0664657461696c18022001280922500a0b457272" . + "6f72537461747573120c0a04636f646518012001280512150a0d6572726f" . + "725f6d657373616765180220012809121c0a1462696e6172795f6572726f" . + "725f64657461696c7318032001280922e2030a0d52657175657374506172" . + "616d7312150a0d6563686f5f646561646c696e65180120012808121e0a16" . + "636c69656e745f63616e63656c5f61667465725f7573180220012805121e" . + "0a167365727665725f63616e63656c5f61667465725f7573180320012805" . + "12150a0d6563686f5f6d65746164617461180420012808121a0a12636865" . + "636b5f617574685f636f6e74657874180520012808121f0a17726573706f" . + "6e73655f6d6573736167655f6c656e67746818062001280512110a096563" . + "686f5f7065657218072001280812200a1865787065637465645f636c6965" . + "6e745f6964656e74697479180820012809121c0a14736b69705f63616e63" . + "656c6c65645f636865636b18092001280812280a2065787065637465645f" . + "7472616e73706f72745f73656375726974795f74797065180a2001280912" . + "2b0a0a64656275675f696e666f180b2001280b32172e677270632e746573" . + "74696e672e4465627567496e666f12120a0a7365727665725f646965180c" . + "20012808121c0a1462696e6172795f6572726f725f64657461696c73180d" . + "2001280912310a0e65787065637465645f6572726f72180e2001280b3219" . + "2e677270632e74657374696e672e4572726f7253746174757312170a0f73" . + "65727665725f736c6565705f7573180f20012805224a0a0b4563686f5265" . + "7175657374120f0a076d657373616765180120012809122a0a0570617261" . + "6d18022001280b321b2e677270632e74657374696e672e52657175657374" . + "506172616d7322460a0e526573706f6e7365506172616d7312180a107265" . + "71756573745f646561646c696e65180120012803120c0a04686f73741802" . + "20012809120c0a0470656572180320012809224c0a0c4563686f52657370" . + "6f6e7365120f0a076d657373616765180120012809122b0a05706172616d" . + "18022001280b321c2e677270632e74657374696e672e526573706f6e7365" . + "506172616d73620670726f746f33" + )); + + static::$is_initialized = true; + } +} + diff --git a/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/GPBEmpty.php b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/GPBEmpty.php new file mode 100644 index 00000000000..7198f7da0c1 --- /dev/null +++ b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/GPBEmpty.php @@ -0,0 +1,26 @@ +internalAddGeneratedFile(hex2bin( + "0a430a227372632f70726f746f2f677270632f74657374696e672f656d70" . + "74792e70726f746f120c677270632e74657374696e6722070a05456d7074" . + "79620670726f746f33" + )); + + static::$is_initialized = true; + } +} + diff --git a/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Metrics.php b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Metrics.php new file mode 100644 index 00000000000..7ac739fb54f --- /dev/null +++ b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Metrics.php @@ -0,0 +1,36 @@ +internalAddGeneratedFile(hex2bin( + "0afb020a247372632f70726f746f2f677270632f74657374696e672f6d65" . + "74726963732e70726f746f120c677270632e74657374696e67226c0a0d47" . + "61756765526573706f6e7365120c0a046e616d6518012001280912140a0a" . + "6c6f6e675f76616c7565180220012803480012160a0c646f75626c655f76" . + "616c7565180320012801480012160a0c737472696e675f76616c75651804" . + "20012809480042070a0576616c7565221c0a0c4761756765526571756573" . + "74120c0a046e616d65180120012809220e0a0c456d7074794d6573736167" . + "6532a0010a0e4d6574726963735365727669636512490a0c476574416c6c" . + "476175676573121a2e677270632e74657374696e672e456d7074794d6573" . + "736167651a1b2e677270632e74657374696e672e4761756765526573706f" . + "6e7365300112430a084765744761756765121a2e677270632e7465737469" . + "6e672e4761756765526571756573741a1b2e677270632e74657374696e67" . + "2e4761756765526573706f6e7365620670726f746f33" + )); + + static::$is_initialized = true; + } +} + diff --git a/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/ReportQpsScenarioService.php b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/ReportQpsScenarioService.php new file mode 100644 index 00000000000..35a1fb4acb0 --- /dev/null +++ b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/ReportQpsScenarioService.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile(hex2bin( + "0ab0010a387372632f70726f746f2f677270632f74657374696e672f7265" . + "706f72745f7170735f7363656e6172696f5f736572766963652e70726f74" . + "6f120c677270632e74657374696e67325e0a185265706f72745170735363" . + "656e6172696f5365727669636512420a0e5265706f72745363656e617269" . + "6f121c2e677270632e74657374696e672e5363656e6172696f526573756c" . + "741a122e677270632e74657374696e672e566f6964620670726f746f33" + )); + + static::$is_initialized = true; + } +} + diff --git a/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Test.php b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Test.php new file mode 100644 index 00000000000..54628cfa373 --- /dev/null +++ b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/Test.php @@ -0,0 +1,60 @@ +internalAddGeneratedFile(hex2bin( + "0a91080a217372632f70726f746f2f677270632f74657374696e672f7465" . + "73742e70726f746f120c677270632e74657374696e671a257372632f7072" . + "6f746f2f677270632f74657374696e672f6d657373616765732e70726f74" . + "6f32cb050a0b546573745365727669636512350a09456d70747943616c6c" . + "12132e677270632e74657374696e672e456d7074791a132e677270632e74" . + "657374696e672e456d70747912460a09556e61727943616c6c121b2e6772" . + "70632e74657374696e672e53696d706c65526571756573741a1c2e677270" . + "632e74657374696e672e53696d706c65526573706f6e7365124f0a124361" . + "63686561626c65556e61727943616c6c121b2e677270632e74657374696e" . + "672e53696d706c65526571756573741a1c2e677270632e74657374696e67" . + "2e53696d706c65526573706f6e7365126c0a1353747265616d696e674f75" . + "7470757443616c6c12282e677270632e74657374696e672e53747265616d" . + "696e674f757470757443616c6c526571756573741a292e677270632e7465" . + "7374696e672e53747265616d696e674f757470757443616c6c526573706f" . + "6e7365300112690a1253747265616d696e67496e70757443616c6c12272e" . + "677270632e74657374696e672e53747265616d696e67496e70757443616c" . + "6c526571756573741a282e677270632e74657374696e672e53747265616d" . + "696e67496e70757443616c6c526573706f6e7365280112690a0e46756c6c" . + "4475706c657843616c6c12282e677270632e74657374696e672e53747265" . + "616d696e674f757470757443616c6c526571756573741a292e677270632e" . + "74657374696e672e53747265616d696e674f757470757443616c6c526573" . + "706f6e73652801300112690a0e48616c664475706c657843616c6c12282e" . + "677270632e74657374696e672e53747265616d696e674f75747075744361" . + "6c6c526571756573741a292e677270632e74657374696e672e5374726561" . + "6d696e674f757470757443616c6c526573706f6e736528013001123d0a11" . + "556e696d706c656d656e74656443616c6c12132e677270632e7465737469" . + "6e672e456d7074791a132e677270632e74657374696e672e456d70747932" . + "550a14556e696d706c656d656e74656453657276696365123d0a11556e69" . + "6d706c656d656e74656443616c6c12132e677270632e74657374696e672e" . + "456d7074791a132e677270632e74657374696e672e456d7074793289010a" . + "105265636f6e6e65637453657276696365123b0a055374617274121d2e67" . + "7270632e74657374696e672e5265636f6e6e656374506172616d731a132e" . + "677270632e74657374696e672e456d70747912380a0453746f7012132e67" . + "7270632e74657374696e672e456d7074791a1b2e677270632e7465737469" . + "6e672e5265636f6e6e656374496e666f620670726f746f33" + )); + + static::$is_initialized = true; + } +} + diff --git a/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/WorkerService.php b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/WorkerService.php new file mode 100644 index 00000000000..a8a863df19d --- /dev/null +++ b/src/php/tests/qps/generated_code/GPBMetadata/Src/Proto/Grpc/Testing/WorkerService.php @@ -0,0 +1,36 @@ +internalAddGeneratedFile(hex2bin( + "0add020a2b7372632f70726f746f2f677270632f74657374696e672f776f" . + "726b65725f736572766963652e70726f746f120c677270632e7465737469" . + "6e673297020a0d576f726b65725365727669636512450a0952756e536572" . + "76657212182e677270632e74657374696e672e536572766572417267731a" . + "1a2e677270632e74657374696e672e536572766572537461747573280130" . + "0112450a0952756e436c69656e7412182e677270632e74657374696e672e" . + "436c69656e74417267731a1a2e677270632e74657374696e672e436c6965" . + "6e745374617475732801300112420a09436f7265436f756e7412192e6772" . + "70632e74657374696e672e436f7265526571756573741a1a2e677270632e" . + "74657374696e672e436f7265526573706f6e736512340a0a51756974576f" . + "726b657212122e677270632e74657374696e672e566f69641a122e677270" . + "632e74657374696e672e566f6964620670726f746f33" + )); + + static::$is_initialized = true; + } +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/ClientConfig.php b/src/php/tests/qps/generated_code/Grpc/Testing/ClientConfig.php index f7bc21587c9..0dd3072f184 100644 --- a/src/php/tests/qps/generated_code/Grpc/Testing/ClientConfig.php +++ b/src/php/tests/qps/generated_code/Grpc/Testing/ClientConfig.php @@ -97,6 +97,12 @@ class ClientConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field int32 messages_per_stream = 18; */ private $messages_per_stream = 0; + /** + * Use coalescing API when possible. + * + * Generated from protobuf field bool use_coalesce_api = 19; + */ + private $use_coalesce_api = false; public function __construct() { \GPBMetadata\Src\Proto\Grpc\Testing\Control::initOnce(); @@ -495,5 +501,31 @@ class ClientConfig extends \Google\Protobuf\Internal\Message return $this; } + /** + * Use coalescing API when possible. + * + * Generated from protobuf field bool use_coalesce_api = 19; + * @return bool + */ + public function getUseCoalesceApi() + { + return $this->use_coalesce_api; + } + + /** + * Use coalescing API when possible. + * + * Generated from protobuf field bool use_coalesce_api = 19; + * @param bool $var + * @return $this + */ + public function setUseCoalesceApi($var) + { + GPBUtil::checkBool($var); + $this->use_coalesce_api = $var; + + return $this; + } + } diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/DebugInfo.php b/src/php/tests/qps/generated_code/Grpc/Testing/DebugInfo.php new file mode 100644 index 00000000000..805b629b0db --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/DebugInfo.php @@ -0,0 +1,77 @@ +grpc.testing.DebugInfo + */ +class DebugInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated string stack_entries = 1; + */ + private $stack_entries; + /** + * Generated from protobuf field string detail = 2; + */ + private $detail = ''; + + public function __construct() { + \GPBMetadata\Src\Proto\Grpc\Testing\EchoMessages::initOnce(); + parent::__construct(); + } + + /** + * Generated from protobuf field repeated string stack_entries = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStackEntries() + { + return $this->stack_entries; + } + + /** + * Generated from protobuf field repeated string stack_entries = 1; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStackEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->stack_entries = $arr; + + return $this; + } + + /** + * Generated from protobuf field string detail = 2; + * @return string + */ + public function getDetail() + { + return $this->detail; + } + + /** + * Generated from protobuf field string detail = 2; + * @param string $var + * @return $this + */ + public function setDetail($var) + { + GPBUtil::checkString($var, True); + $this->detail = $var; + + return $this; + } + +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/EchoRequest.php b/src/php/tests/qps/generated_code/Grpc/Testing/EchoRequest.php new file mode 100644 index 00000000000..9aadfc5dee3 --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/EchoRequest.php @@ -0,0 +1,75 @@ +grpc.testing.EchoRequest + */ +class EchoRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string message = 1; + */ + private $message = ''; + /** + * Generated from protobuf field .grpc.testing.RequestParams param = 2; + */ + private $param = null; + + public function __construct() { + \GPBMetadata\Src\Proto\Grpc\Testing\EchoMessages::initOnce(); + parent::__construct(); + } + + /** + * Generated from protobuf field string message = 1; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Generated from protobuf field string message = 1; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * Generated from protobuf field .grpc.testing.RequestParams param = 2; + * @return \Grpc\Testing\RequestParams + */ + public function getParam() + { + return $this->param; + } + + /** + * Generated from protobuf field .grpc.testing.RequestParams param = 2; + * @param \Grpc\Testing\RequestParams $var + * @return $this + */ + public function setParam($var) + { + GPBUtil::checkMessage($var, \Grpc\Testing\RequestParams::class); + $this->param = $var; + + return $this; + } + +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/EchoResponse.php b/src/php/tests/qps/generated_code/Grpc/Testing/EchoResponse.php new file mode 100644 index 00000000000..c4a9db35aba --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/EchoResponse.php @@ -0,0 +1,75 @@ +grpc.testing.EchoResponse + */ +class EchoResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string message = 1; + */ + private $message = ''; + /** + * Generated from protobuf field .grpc.testing.ResponseParams param = 2; + */ + private $param = null; + + public function __construct() { + \GPBMetadata\Src\Proto\Grpc\Testing\EchoMessages::initOnce(); + parent::__construct(); + } + + /** + * Generated from protobuf field string message = 1; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Generated from protobuf field string message = 1; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * Generated from protobuf field .grpc.testing.ResponseParams param = 2; + * @return \Grpc\Testing\ResponseParams + */ + public function getParam() + { + return $this->param; + } + + /** + * Generated from protobuf field .grpc.testing.ResponseParams param = 2; + * @param \Grpc\Testing\ResponseParams $var + * @return $this + */ + public function setParam($var) + { + GPBUtil::checkMessage($var, \Grpc\Testing\ResponseParams::class); + $this->param = $var; + + return $this; + } + +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/EchoTestServiceClient.php b/src/php/tests/qps/generated_code/Grpc/Testing/EchoTestServiceClient.php new file mode 100644 index 00000000000..b3dcf5b7af8 --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/EchoTestServiceClient.php @@ -0,0 +1,93 @@ +_simpleRequest('/grpc.testing.EchoTestService/Echo', + $argument, + ['\Grpc\Testing\EchoResponse', 'decode'], + $metadata, $options); + } + + /** + * @param array $metadata metadata + * @param array $options call options + */ + public function RequestStream($metadata = [], $options = []) { + return $this->_clientStreamRequest('/grpc.testing.EchoTestService/RequestStream', + ['\Grpc\Testing\EchoResponse','decode'], + $metadata, $options); + } + + /** + * @param \Grpc\Testing\EchoRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + */ + public function ResponseStream(\Grpc\Testing\EchoRequest $argument, + $metadata = [], $options = []) { + return $this->_serverStreamRequest('/grpc.testing.EchoTestService/ResponseStream', + $argument, + ['\Grpc\Testing\EchoResponse', 'decode'], + $metadata, $options); + } + + /** + * @param array $metadata metadata + * @param array $options call options + */ + public function BidiStream($metadata = [], $options = []) { + return $this->_bidiRequest('/grpc.testing.EchoTestService/BidiStream', + ['\Grpc\Testing\EchoResponse','decode'], + $metadata, $options); + } + + /** + * @param \Grpc\Testing\EchoRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + */ + public function Unimplemented(\Grpc\Testing\EchoRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/grpc.testing.EchoTestService/Unimplemented', + $argument, + ['\Grpc\Testing\EchoResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/EmptyMessage.php b/src/php/tests/qps/generated_code/Grpc/Testing/EmptyMessage.php new file mode 100644 index 00000000000..3da163e7c09 --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/EmptyMessage.php @@ -0,0 +1,23 @@ +grpc.testing.EmptyMessage + */ +class EmptyMessage extends \Google\Protobuf\Internal\Message +{ + + public function __construct() { + \GPBMetadata\Src\Proto\Grpc\Testing\Metrics::initOnce(); + parent::__construct(); + } + +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/ErrorStatus.php b/src/php/tests/qps/generated_code/Grpc/Testing/ErrorStatus.php new file mode 100644 index 00000000000..cc378756c75 --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/ErrorStatus.php @@ -0,0 +1,103 @@ +grpc.testing.ErrorStatus + */ +class ErrorStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field int32 code = 1; + */ + private $code = 0; + /** + * Generated from protobuf field string error_message = 2; + */ + private $error_message = ''; + /** + * Generated from protobuf field string binary_error_details = 3; + */ + private $binary_error_details = ''; + + public function __construct() { + \GPBMetadata\Src\Proto\Grpc\Testing\EchoMessages::initOnce(); + parent::__construct(); + } + + /** + * Generated from protobuf field int32 code = 1; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * Generated from protobuf field int32 code = 1; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkInt32($var); + $this->code = $var; + + return $this; + } + + /** + * Generated from protobuf field string error_message = 2; + * @return string + */ + public function getErrorMessage() + { + return $this->error_message; + } + + /** + * Generated from protobuf field string error_message = 2; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + + /** + * Generated from protobuf field string binary_error_details = 3; + * @return string + */ + public function getBinaryErrorDetails() + { + return $this->binary_error_details; + } + + /** + * Generated from protobuf field string binary_error_details = 3; + * @param string $var + * @return $this + */ + public function setBinaryErrorDetails($var) + { + GPBUtil::checkString($var, True); + $this->binary_error_details = $var; + + return $this; + } + +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/GaugeRequest.php b/src/php/tests/qps/generated_code/Grpc/Testing/GaugeRequest.php new file mode 100644 index 00000000000..3c283693c9c --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/GaugeRequest.php @@ -0,0 +1,51 @@ +grpc.testing.GaugeRequest + */ +class GaugeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string name = 1; + */ + private $name = ''; + + public function __construct() { + \GPBMetadata\Src\Proto\Grpc\Testing\Metrics::initOnce(); + parent::__construct(); + } + + /** + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/GaugeResponse.php b/src/php/tests/qps/generated_code/Grpc/Testing/GaugeResponse.php new file mode 100644 index 00000000000..da658ba1985 --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/GaugeResponse.php @@ -0,0 +1,126 @@ +grpc.testing.GaugeResponse + */ +class GaugeResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string name = 1; + */ + private $name = ''; + protected $value; + + public function __construct() { + \GPBMetadata\Src\Proto\Grpc\Testing\Metrics::initOnce(); + parent::__construct(); + } + + /** + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field int64 long_value = 2; + * @return int|string + */ + public function getLongValue() + { + return $this->readOneof(2); + } + + /** + * Generated from protobuf field int64 long_value = 2; + * @param int|string $var + * @return $this + */ + public function setLongValue($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Generated from protobuf field double double_value = 3; + * @return float + */ + public function getDoubleValue() + { + return $this->readOneof(3); + } + + /** + * Generated from protobuf field double double_value = 3; + * @param float $var + * @return $this + */ + public function setDoubleValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Generated from protobuf field string string_value = 4; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(4); + } + + /** + * Generated from protobuf field string string_value = 4; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->whichOneof("value"); + } + +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/MetricsServiceClient.php b/src/php/tests/qps/generated_code/Grpc/Testing/MetricsServiceClient.php new file mode 100644 index 00000000000..491ccbce72e --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/MetricsServiceClient.php @@ -0,0 +1,69 @@ +_serverStreamRequest('/grpc.testing.MetricsService/GetAllGauges', + $argument, + ['\Grpc\Testing\GaugeResponse', 'decode'], + $metadata, $options); + } + + /** + * Returns the value of one gauge + * @param \Grpc\Testing\GaugeRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + */ + public function GetGauge(\Grpc\Testing\GaugeRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/grpc.testing.MetricsService/GetGauge', + $argument, + ['\Grpc\Testing\GaugeResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/NoRpcServiceClient.php b/src/php/tests/qps/generated_code/Grpc/Testing/NoRpcServiceClient.php new file mode 100644 index 00000000000..1d58eaf88ac --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/NoRpcServiceClient.php @@ -0,0 +1,35 @@ +grpc.testing.Empty + */ +class PBEmpty extends \Google\Protobuf\Internal\Message +{ + + public function __construct() { + \GPBMetadata\Src\Proto\Grpc\Testing\GPBEmpty::initOnce(); + parent::__construct(); + } + +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/PBVoid.php b/src/php/tests/qps/generated_code/Grpc/Testing/PBVoid.php new file mode 100644 index 00000000000..94cb6c1ecfe --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/PBVoid.php @@ -0,0 +1,23 @@ +grpc.testing.Void + */ +class PBVoid extends \Google\Protobuf\Internal\Message +{ + + public function __construct() { + \GPBMetadata\Src\Proto\Grpc\Testing\Control::initOnce(); + parent::__construct(); + } + +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/ProxyClientServiceClient.php b/src/php/tests/qps/generated_code/Grpc/Testing/ProxyClientServiceClient.php index 5510b57064f..c0e304929d5 100644 --- a/src/php/tests/qps/generated_code/Grpc/Testing/ProxyClientServiceClient.php +++ b/src/php/tests/qps/generated_code/Grpc/Testing/ProxyClientServiceClient.php @@ -32,11 +32,11 @@ class ProxyClientServiceClient extends \Grpc\BaseStub { } /** - * @param \Grpc\Testing\Void $argument input argument + * @param \Grpc\Testing\PBVoid $argument input argument * @param array $metadata metadata * @param array $options call options */ - public function GetConfig(\Grpc\Testing\Void $argument, + public function GetConfig(\Grpc\Testing\PBVoid $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/grpc.testing.ProxyClientService/GetConfig', $argument, @@ -50,7 +50,7 @@ class ProxyClientServiceClient extends \Grpc\BaseStub { */ public function ReportTime($metadata = [], $options = []) { return $this->_clientStreamRequest('/grpc.testing.ProxyClientService/ReportTime', - ['\Grpc\Testing\Void','decode'], + ['\Grpc\Testing\PBVoid','decode'], $metadata, $options); } @@ -60,7 +60,7 @@ class ProxyClientServiceClient extends \Grpc\BaseStub { */ public function ReportHist($metadata = [], $options = []) { return $this->_clientStreamRequest('/grpc.testing.ProxyClientService/ReportHist', - ['\Grpc\Testing\Void','decode'], + ['\Grpc\Testing\PBVoid','decode'], $metadata, $options); } diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/ReconnectServiceClient.php b/src/php/tests/qps/generated_code/Grpc/Testing/ReconnectServiceClient.php new file mode 100644 index 00000000000..a1802e97cdb --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/ReconnectServiceClient.php @@ -0,0 +1,64 @@ +_simpleRequest('/grpc.testing.ReconnectService/Start', + $argument, + ['\Grpc\Testing\PBEmpty', 'decode'], + $metadata, $options); + } + + /** + * @param \Grpc\Testing\PBEmpty $argument input argument + * @param array $metadata metadata + * @param array $options call options + */ + public function Stop(\Grpc\Testing\PBEmpty $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/grpc.testing.ReconnectService/Stop', + $argument, + ['\Grpc\Testing\ReconnectInfo', 'decode'], + $metadata, $options); + } + +} diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/ReportQpsScenarioServiceClient.php b/src/php/tests/qps/generated_code/Grpc/Testing/ReportQpsScenarioServiceClient.php index 72d44ffc667..3abb5abe6d0 100644 --- a/src/php/tests/qps/generated_code/Grpc/Testing/ReportQpsScenarioServiceClient.php +++ b/src/php/tests/qps/generated_code/Grpc/Testing/ReportQpsScenarioServiceClient.php @@ -43,7 +43,7 @@ class ReportQpsScenarioServiceClient extends \Grpc\BaseStub { $metadata = [], $options = []) { return $this->_simpleRequest('/grpc.testing.ReportQpsScenarioService/ReportScenario', $argument, - ['\Grpc\Testing\Void', 'decode'], + ['\Grpc\Testing\PBVoid', 'decode'], $metadata, $options); } diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/Request.php b/src/php/tests/qps/generated_code/Grpc/Testing/Request.php new file mode 100644 index 00000000000..6a20f6a897e --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/Request.php @@ -0,0 +1,23 @@ +grpc.testing.Request + */ +class Request extends \Google\Protobuf\Internal\Message +{ + + public function __construct() { + \GPBMetadata\Src\Proto\Grpc\Testing\CompilerTest::initOnce(); + parent::__construct(); + } + +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/RequestParams.php b/src/php/tests/qps/generated_code/Grpc/Testing/RequestParams.php new file mode 100644 index 00000000000..f01f50d5afa --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/RequestParams.php @@ -0,0 +1,431 @@ +grpc.testing.RequestParams + */ +class RequestParams extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field bool echo_deadline = 1; + */ + private $echo_deadline = false; + /** + * Generated from protobuf field int32 client_cancel_after_us = 2; + */ + private $client_cancel_after_us = 0; + /** + * Generated from protobuf field int32 server_cancel_after_us = 3; + */ + private $server_cancel_after_us = 0; + /** + * Generated from protobuf field bool echo_metadata = 4; + */ + private $echo_metadata = false; + /** + * Generated from protobuf field bool check_auth_context = 5; + */ + private $check_auth_context = false; + /** + * Generated from protobuf field int32 response_message_length = 6; + */ + private $response_message_length = 0; + /** + * Generated from protobuf field bool echo_peer = 7; + */ + private $echo_peer = false; + /** + * will force check_auth_context. + * + * Generated from protobuf field string expected_client_identity = 8; + */ + private $expected_client_identity = ''; + /** + * Generated from protobuf field bool skip_cancelled_check = 9; + */ + private $skip_cancelled_check = false; + /** + * Generated from protobuf field string expected_transport_security_type = 10; + */ + private $expected_transport_security_type = ''; + /** + * Generated from protobuf field .grpc.testing.DebugInfo debug_info = 11; + */ + private $debug_info = null; + /** + * Server should not see a request with this set. + * + * Generated from protobuf field bool server_die = 12; + */ + private $server_die = false; + /** + * Generated from protobuf field string binary_error_details = 13; + */ + private $binary_error_details = ''; + /** + * Generated from protobuf field .grpc.testing.ErrorStatus expected_error = 14; + */ + private $expected_error = null; + /** + * Amount to sleep when invoking server + * + * Generated from protobuf field int32 server_sleep_us = 15; + */ + private $server_sleep_us = 0; + + public function __construct() { + \GPBMetadata\Src\Proto\Grpc\Testing\EchoMessages::initOnce(); + parent::__construct(); + } + + /** + * Generated from protobuf field bool echo_deadline = 1; + * @return bool + */ + public function getEchoDeadline() + { + return $this->echo_deadline; + } + + /** + * Generated from protobuf field bool echo_deadline = 1; + * @param bool $var + * @return $this + */ + public function setEchoDeadline($var) + { + GPBUtil::checkBool($var); + $this->echo_deadline = $var; + + return $this; + } + + /** + * Generated from protobuf field int32 client_cancel_after_us = 2; + * @return int + */ + public function getClientCancelAfterUs() + { + return $this->client_cancel_after_us; + } + + /** + * Generated from protobuf field int32 client_cancel_after_us = 2; + * @param int $var + * @return $this + */ + public function setClientCancelAfterUs($var) + { + GPBUtil::checkInt32($var); + $this->client_cancel_after_us = $var; + + return $this; + } + + /** + * Generated from protobuf field int32 server_cancel_after_us = 3; + * @return int + */ + public function getServerCancelAfterUs() + { + return $this->server_cancel_after_us; + } + + /** + * Generated from protobuf field int32 server_cancel_after_us = 3; + * @param int $var + * @return $this + */ + public function setServerCancelAfterUs($var) + { + GPBUtil::checkInt32($var); + $this->server_cancel_after_us = $var; + + return $this; + } + + /** + * Generated from protobuf field bool echo_metadata = 4; + * @return bool + */ + public function getEchoMetadata() + { + return $this->echo_metadata; + } + + /** + * Generated from protobuf field bool echo_metadata = 4; + * @param bool $var + * @return $this + */ + public function setEchoMetadata($var) + { + GPBUtil::checkBool($var); + $this->echo_metadata = $var; + + return $this; + } + + /** + * Generated from protobuf field bool check_auth_context = 5; + * @return bool + */ + public function getCheckAuthContext() + { + return $this->check_auth_context; + } + + /** + * Generated from protobuf field bool check_auth_context = 5; + * @param bool $var + * @return $this + */ + public function setCheckAuthContext($var) + { + GPBUtil::checkBool($var); + $this->check_auth_context = $var; + + return $this; + } + + /** + * Generated from protobuf field int32 response_message_length = 6; + * @return int + */ + public function getResponseMessageLength() + { + return $this->response_message_length; + } + + /** + * Generated from protobuf field int32 response_message_length = 6; + * @param int $var + * @return $this + */ + public function setResponseMessageLength($var) + { + GPBUtil::checkInt32($var); + $this->response_message_length = $var; + + return $this; + } + + /** + * Generated from protobuf field bool echo_peer = 7; + * @return bool + */ + public function getEchoPeer() + { + return $this->echo_peer; + } + + /** + * Generated from protobuf field bool echo_peer = 7; + * @param bool $var + * @return $this + */ + public function setEchoPeer($var) + { + GPBUtil::checkBool($var); + $this->echo_peer = $var; + + return $this; + } + + /** + * will force check_auth_context. + * + * Generated from protobuf field string expected_client_identity = 8; + * @return string + */ + public function getExpectedClientIdentity() + { + return $this->expected_client_identity; + } + + /** + * will force check_auth_context. + * + * Generated from protobuf field string expected_client_identity = 8; + * @param string $var + * @return $this + */ + public function setExpectedClientIdentity($var) + { + GPBUtil::checkString($var, True); + $this->expected_client_identity = $var; + + return $this; + } + + /** + * Generated from protobuf field bool skip_cancelled_check = 9; + * @return bool + */ + public function getSkipCancelledCheck() + { + return $this->skip_cancelled_check; + } + + /** + * Generated from protobuf field bool skip_cancelled_check = 9; + * @param bool $var + * @return $this + */ + public function setSkipCancelledCheck($var) + { + GPBUtil::checkBool($var); + $this->skip_cancelled_check = $var; + + return $this; + } + + /** + * Generated from protobuf field string expected_transport_security_type = 10; + * @return string + */ + public function getExpectedTransportSecurityType() + { + return $this->expected_transport_security_type; + } + + /** + * Generated from protobuf field string expected_transport_security_type = 10; + * @param string $var + * @return $this + */ + public function setExpectedTransportSecurityType($var) + { + GPBUtil::checkString($var, True); + $this->expected_transport_security_type = $var; + + return $this; + } + + /** + * Generated from protobuf field .grpc.testing.DebugInfo debug_info = 11; + * @return \Grpc\Testing\DebugInfo + */ + public function getDebugInfo() + { + return $this->debug_info; + } + + /** + * Generated from protobuf field .grpc.testing.DebugInfo debug_info = 11; + * @param \Grpc\Testing\DebugInfo $var + * @return $this + */ + public function setDebugInfo($var) + { + GPBUtil::checkMessage($var, \Grpc\Testing\DebugInfo::class); + $this->debug_info = $var; + + return $this; + } + + /** + * Server should not see a request with this set. + * + * Generated from protobuf field bool server_die = 12; + * @return bool + */ + public function getServerDie() + { + return $this->server_die; + } + + /** + * Server should not see a request with this set. + * + * Generated from protobuf field bool server_die = 12; + * @param bool $var + * @return $this + */ + public function setServerDie($var) + { + GPBUtil::checkBool($var); + $this->server_die = $var; + + return $this; + } + + /** + * Generated from protobuf field string binary_error_details = 13; + * @return string + */ + public function getBinaryErrorDetails() + { + return $this->binary_error_details; + } + + /** + * Generated from protobuf field string binary_error_details = 13; + * @param string $var + * @return $this + */ + public function setBinaryErrorDetails($var) + { + GPBUtil::checkString($var, True); + $this->binary_error_details = $var; + + return $this; + } + + /** + * Generated from protobuf field .grpc.testing.ErrorStatus expected_error = 14; + * @return \Grpc\Testing\ErrorStatus + */ + public function getExpectedError() + { + return $this->expected_error; + } + + /** + * Generated from protobuf field .grpc.testing.ErrorStatus expected_error = 14; + * @param \Grpc\Testing\ErrorStatus $var + * @return $this + */ + public function setExpectedError($var) + { + GPBUtil::checkMessage($var, \Grpc\Testing\ErrorStatus::class); + $this->expected_error = $var; + + return $this; + } + + /** + * Amount to sleep when invoking server + * + * Generated from protobuf field int32 server_sleep_us = 15; + * @return int + */ + public function getServerSleepUs() + { + return $this->server_sleep_us; + } + + /** + * Amount to sleep when invoking server + * + * Generated from protobuf field int32 server_sleep_us = 15; + * @param int $var + * @return $this + */ + public function setServerSleepUs($var) + { + GPBUtil::checkInt32($var); + $this->server_sleep_us = $var; + + return $this; + } + +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/Response.php b/src/php/tests/qps/generated_code/Grpc/Testing/Response.php new file mode 100644 index 00000000000..7925a7db3df --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/Response.php @@ -0,0 +1,23 @@ +grpc.testing.Response + */ +class Response extends \Google\Protobuf\Internal\Message +{ + + public function __construct() { + \GPBMetadata\Src\Proto\Grpc\Testing\CompilerTest::initOnce(); + parent::__construct(); + } + +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/ResponseParams.php b/src/php/tests/qps/generated_code/Grpc/Testing/ResponseParams.php new file mode 100644 index 00000000000..d20f92289a3 --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/ResponseParams.php @@ -0,0 +1,101 @@ +grpc.testing.ResponseParams + */ +class ResponseParams extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field int64 request_deadline = 1; + */ + private $request_deadline = 0; + /** + * Generated from protobuf field string host = 2; + */ + private $host = ''; + /** + * Generated from protobuf field string peer = 3; + */ + private $peer = ''; + + public function __construct() { + \GPBMetadata\Src\Proto\Grpc\Testing\EchoMessages::initOnce(); + parent::__construct(); + } + + /** + * Generated from protobuf field int64 request_deadline = 1; + * @return int|string + */ + public function getRequestDeadline() + { + return $this->request_deadline; + } + + /** + * Generated from protobuf field int64 request_deadline = 1; + * @param int|string $var + * @return $this + */ + public function setRequestDeadline($var) + { + GPBUtil::checkInt64($var); + $this->request_deadline = $var; + + return $this; + } + + /** + * Generated from protobuf field string host = 2; + * @return string + */ + public function getHost() + { + return $this->host; + } + + /** + * Generated from protobuf field string host = 2; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + + /** + * Generated from protobuf field string peer = 3; + * @return string + */ + public function getPeer() + { + return $this->peer; + } + + /** + * Generated from protobuf field string peer = 3; + * @param string $var + * @return $this + */ + public function setPeer($var) + { + GPBUtil::checkString($var, True); + $this->peer = $var; + + return $this; + } + +} + diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/ServiceAClient.php b/src/php/tests/qps/generated_code/Grpc/Testing/ServiceAClient.php new file mode 100644 index 00000000000..df469cbea34 --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/ServiceAClient.php @@ -0,0 +1,97 @@ +_simpleRequest('/grpc.testing.ServiceA/MethodA1', + $argument, + ['\Grpc\Testing\Response', 'decode'], + $metadata, $options); + } + + /** + * MethodA2 detached leading comment 1 + * + * Method A2 leading comment 1 + * Method A2 leading comment 2 + * @param array $metadata metadata + * @param array $options call options + */ + public function MethodA2($metadata = [], $options = []) { + return $this->_clientStreamRequest('/grpc.testing.ServiceA/MethodA2', + ['\Grpc\Testing\Response','decode'], + $metadata, $options); + } + + /** + * Method A3 leading comment 1 + * @param \Grpc\Testing\Request $argument input argument + * @param array $metadata metadata + * @param array $options call options + */ + public function MethodA3(\Grpc\Testing\Request $argument, + $metadata = [], $options = []) { + return $this->_serverStreamRequest('/grpc.testing.ServiceA/MethodA3', + $argument, + ['\Grpc\Testing\Response', 'decode'], + $metadata, $options); + } + + /** + * Method A4 leading comment 1 + * @param array $metadata metadata + * @param array $options call options + */ + public function MethodA4($metadata = [], $options = []) { + return $this->_bidiRequest('/grpc.testing.ServiceA/MethodA4', + ['\Grpc\Testing\Response','decode'], + $metadata, $options); + } + +} diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/ServiceBClient.php b/src/php/tests/qps/generated_code/Grpc/Testing/ServiceBClient.php new file mode 100644 index 00000000000..54acf6364f9 --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/ServiceBClient.php @@ -0,0 +1,54 @@ +_simpleRequest('/grpc.testing.ServiceB/MethodB1', + $argument, + ['\Grpc\Testing\Response', 'decode'], + $metadata, $options); + } + +} diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/TestServiceClient.php b/src/php/tests/qps/generated_code/Grpc/Testing/TestServiceClient.php new file mode 100644 index 00000000000..7da9713d65e --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/TestServiceClient.php @@ -0,0 +1,152 @@ +_simpleRequest('/grpc.testing.TestService/EmptyCall', + $argument, + ['\Grpc\Testing\PBEmpty', 'decode'], + $metadata, $options); + } + + /** + * One request followed by one response. + * @param \Grpc\Testing\SimpleRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + */ + public function UnaryCall(\Grpc\Testing\SimpleRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/grpc.testing.TestService/UnaryCall', + $argument, + ['\Grpc\Testing\SimpleResponse', 'decode'], + $metadata, $options); + } + + /** + * One request followed by one response. Response has cache control + * headers set such that a caching HTTP proxy (such as GFE) can + * satisfy subsequent requests. + * @param \Grpc\Testing\SimpleRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + */ + public function CacheableUnaryCall(\Grpc\Testing\SimpleRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/grpc.testing.TestService/CacheableUnaryCall', + $argument, + ['\Grpc\Testing\SimpleResponse', 'decode'], + $metadata, $options); + } + + /** + * One request followed by a sequence of responses (streamed download). + * The server returns the payload with client desired type and sizes. + * @param \Grpc\Testing\StreamingOutputCallRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + */ + public function StreamingOutputCall(\Grpc\Testing\StreamingOutputCallRequest $argument, + $metadata = [], $options = []) { + return $this->_serverStreamRequest('/grpc.testing.TestService/StreamingOutputCall', + $argument, + ['\Grpc\Testing\StreamingOutputCallResponse', 'decode'], + $metadata, $options); + } + + /** + * A sequence of requests followed by one response (streamed upload). + * The server returns the aggregated size of client payload as the result. + * @param array $metadata metadata + * @param array $options call options + */ + public function StreamingInputCall($metadata = [], $options = []) { + return $this->_clientStreamRequest('/grpc.testing.TestService/StreamingInputCall', + ['\Grpc\Testing\StreamingInputCallResponse','decode'], + $metadata, $options); + } + + /** + * A sequence of requests with each request served by the server immediately. + * As one request could lead to multiple responses, this interface + * demonstrates the idea of full duplexing. + * @param array $metadata metadata + * @param array $options call options + */ + public function FullDuplexCall($metadata = [], $options = []) { + return $this->_bidiRequest('/grpc.testing.TestService/FullDuplexCall', + ['\Grpc\Testing\StreamingOutputCallResponse','decode'], + $metadata, $options); + } + + /** + * A sequence of requests followed by a sequence of responses. + * The server buffers all the client requests and then serves them in order. A + * stream of responses are returned to the client when the server starts with + * first request. + * @param array $metadata metadata + * @param array $options call options + */ + public function HalfDuplexCall($metadata = [], $options = []) { + return $this->_bidiRequest('/grpc.testing.TestService/HalfDuplexCall', + ['\Grpc\Testing\StreamingOutputCallResponse','decode'], + $metadata, $options); + } + + /** + * The test server will not implement this method. It will be used + * to test the behavior when clients call unimplemented methods. + * @param \Grpc\Testing\PBEmpty $argument input argument + * @param array $metadata metadata + * @param array $options call options + */ + public function UnimplementedCall(\Grpc\Testing\PBEmpty $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/grpc.testing.TestService/UnimplementedCall', + $argument, + ['\Grpc\Testing\PBEmpty', 'decode'], + $metadata, $options); + } + +} diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/UnimplementedEchoServiceClient.php b/src/php/tests/qps/generated_code/Grpc/Testing/UnimplementedEchoServiceClient.php new file mode 100644 index 00000000000..fee0daa70c7 --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/UnimplementedEchoServiceClient.php @@ -0,0 +1,47 @@ +_simpleRequest('/grpc.testing.UnimplementedEchoService/Unimplemented', + $argument, + ['\Grpc\Testing\EchoResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/UnimplementedServiceClient.php b/src/php/tests/qps/generated_code/Grpc/Testing/UnimplementedServiceClient.php new file mode 100644 index 00000000000..53b2020f190 --- /dev/null +++ b/src/php/tests/qps/generated_code/Grpc/Testing/UnimplementedServiceClient.php @@ -0,0 +1,53 @@ +_simpleRequest('/grpc.testing.UnimplementedService/UnimplementedCall', + $argument, + ['\Grpc\Testing\PBEmpty', 'decode'], + $metadata, $options); + } + +} diff --git a/src/php/tests/qps/generated_code/Grpc/Testing/WorkerServiceClient.php b/src/php/tests/qps/generated_code/Grpc/Testing/WorkerServiceClient.php index 98c244ff9dc..366e36529e9 100644 --- a/src/php/tests/qps/generated_code/Grpc/Testing/WorkerServiceClient.php +++ b/src/php/tests/qps/generated_code/Grpc/Testing/WorkerServiceClient.php @@ -81,15 +81,15 @@ class WorkerServiceClient extends \Grpc\BaseStub { /** * Quit this worker - * @param \Grpc\Testing\Void $argument input argument + * @param \Grpc\Testing\PBVoid $argument input argument * @param array $metadata metadata * @param array $options call options */ - public function QuitWorker(\Grpc\Testing\Void $argument, + public function QuitWorker(\Grpc\Testing\PBVoid $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/grpc.testing.WorkerService/QuitWorker', $argument, - ['\Grpc\Testing\Void', 'decode'], + ['\Grpc\Testing\PBVoid', 'decode'], $metadata, $options); } diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD index 58412ed6308..16721ff2edc 100644 --- a/src/proto/grpc/testing/BUILD +++ b/src/proto/grpc/testing/BUILD @@ -76,11 +76,26 @@ grpc_proto_library( ) grpc_proto_library( - name = "services_proto", - srcs = ["services.proto"], + name = "benchmark_service_proto", + srcs = ["benchmark_service.proto"], deps = [ - "control_proto", - "messages_proto", + "messages_proto", + ], +) + +grpc_proto_library( + name = "report_qps_scenario_service_proto", + srcs = ["report_qps_scenario_service.proto"], + deps = [ + "control_proto", + ], +) + +grpc_proto_library( + name = "worker_service_proto", + srcs = ["worker_service.proto"], + deps = [ + "control_proto", ], ) diff --git a/src/proto/grpc/testing/services.proto b/src/proto/grpc/testing/benchmark_service.proto similarity index 59% rename from src/proto/grpc/testing/services.proto rename to src/proto/grpc/testing/benchmark_service.proto index 93c21f42d11..63167a8cee6 100644 --- a/src/proto/grpc/testing/services.proto +++ b/src/proto/grpc/testing/benchmark_service.proto @@ -17,7 +17,6 @@ syntax = "proto3"; import "src/proto/grpc/testing/messages.proto"; -import "src/proto/grpc/testing/control.proto"; package grpc.testing; @@ -43,32 +42,3 @@ service BenchmarkService { // Both sides send the content of their own choice to the other rpc StreamingBothWays(stream SimpleRequest) returns (stream SimpleResponse); } - -service WorkerService { - // Start server with specified workload. - // First request sent specifies the ServerConfig followed by ServerStatus - // response. After that, a "Mark" can be sent anytime to request the latest - // stats. Closing the stream will initiate shutdown of the test server - // and once the shutdown has finished, the OK status is sent to terminate - // this RPC. - rpc RunServer(stream ServerArgs) returns (stream ServerStatus); - - // Start client with specified workload. - // First request sent specifies the ClientConfig followed by ClientStatus - // response. After that, a "Mark" can be sent anytime to request the latest - // stats. Closing the stream will initiate shutdown of the test client - // and once the shutdown has finished, the OK status is sent to terminate - // this RPC. - rpc RunClient(stream ClientArgs) returns (stream ClientStatus); - - // Just return the core count - unary call - rpc CoreCount(CoreRequest) returns (CoreResponse); - - // Quit this worker - rpc QuitWorker(Void) returns (Void); -} - -service ReportQpsScenarioService { - // Report results of a QPS test benchmark scenario. - rpc ReportScenario(ScenarioResult) returns (Void); -} diff --git a/src/proto/grpc/testing/report_qps_scenario_service.proto b/src/proto/grpc/testing/report_qps_scenario_service.proto new file mode 100644 index 00000000000..f4e5c36254c --- /dev/null +++ b/src/proto/grpc/testing/report_qps_scenario_service.proto @@ -0,0 +1,26 @@ +// Copyright 2015 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. + +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. +syntax = "proto3"; + +import "src/proto/grpc/testing/control.proto"; + +package grpc.testing; + +service ReportQpsScenarioService { + // Report results of a QPS test benchmark scenario. + rpc ReportScenario(ScenarioResult) returns (Void); +} diff --git a/src/proto/grpc/testing/worker_service.proto b/src/proto/grpc/testing/worker_service.proto new file mode 100644 index 00000000000..a4cde944b07 --- /dev/null +++ b/src/proto/grpc/testing/worker_service.proto @@ -0,0 +1,45 @@ +// Copyright 2015 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. + +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. +syntax = "proto3"; + +import "src/proto/grpc/testing/control.proto"; + +package grpc.testing; + +service WorkerService { + // Start server with specified workload. + // First request sent specifies the ServerConfig followed by ServerStatus + // response. After that, a "Mark" can be sent anytime to request the latest + // stats. Closing the stream will initiate shutdown of the test server + // and once the shutdown has finished, the OK status is sent to terminate + // this RPC. + rpc RunServer(stream ServerArgs) returns (stream ServerStatus); + + // Start client with specified workload. + // First request sent specifies the ClientConfig followed by ClientStatus + // response. After that, a "Mark" can be sent anytime to request the latest + // stats. Closing the stream will initiate shutdown of the test client + // and once the shutdown has finished, the OK status is sent to terminate + // this RPC. + rpc RunClient(stream ClientArgs) returns (stream ClientStatus); + + // Just return the core count - unary call + rpc CoreCount(CoreRequest) returns (CoreResponse); + + // Quit this worker + rpc QuitWorker(Void) returns (Void); +} diff --git a/src/python/grpcio_tests/tests/qps/benchmark_client.py b/src/python/grpcio_tests/tests/qps/benchmark_client.py index e6392a8b8c8..0488450740a 100644 --- a/src/python/grpcio_tests/tests/qps/benchmark_client.py +++ b/src/python/grpcio_tests/tests/qps/benchmark_client.py @@ -22,7 +22,7 @@ from six.moves import queue import grpc from src.proto.grpc.testing import messages_pb2 -from src.proto.grpc.testing import services_pb2_grpc +from src.proto.grpc.testing import benchmark_service_pb2_grpc from tests.unit import resources from tests.unit import test_common @@ -58,7 +58,8 @@ class BenchmarkClient: if config.payload_config.WhichOneof('payload') == 'simple_params': self._generic = False - self._stub = services_pb2_grpc.BenchmarkServiceStub(channel) + self._stub = benchmark_service_pb2_grpc.BenchmarkServiceStub( + channel) payload = messages_pb2.Payload( body='\0' * config.payload_config.simple_params.req_size) self._request = messages_pb2.SimpleRequest( diff --git a/src/python/grpcio_tests/tests/qps/benchmark_server.py b/src/python/grpcio_tests/tests/qps/benchmark_server.py index bb078444912..2bd89cbbdf4 100644 --- a/src/python/grpcio_tests/tests/qps/benchmark_server.py +++ b/src/python/grpcio_tests/tests/qps/benchmark_server.py @@ -13,10 +13,10 @@ # limitations under the License. from src.proto.grpc.testing import messages_pb2 -from src.proto.grpc.testing import services_pb2_grpc +from src.proto.grpc.testing import benchmark_service_pb2_grpc -class BenchmarkServer(services_pb2_grpc.BenchmarkServiceServicer): +class BenchmarkServer(benchmark_service_pb2_grpc.BenchmarkServiceServicer): """Synchronous Server implementation for the Benchmark service.""" def UnaryCall(self, request, context): @@ -29,7 +29,8 @@ class BenchmarkServer(services_pb2_grpc.BenchmarkServiceServicer): yield messages_pb2.SimpleResponse(payload=payload) -class GenericBenchmarkServer(services_pb2_grpc.BenchmarkServiceServicer): +class GenericBenchmarkServer( + benchmark_service_pb2_grpc.BenchmarkServiceServicer): """Generic Server implementation for the Benchmark service.""" def __init__(self, resp_size): diff --git a/src/python/grpcio_tests/tests/qps/qps_worker.py b/src/python/grpcio_tests/tests/qps/qps_worker.py index 54f69db109d..c33d013882f 100644 --- a/src/python/grpcio_tests/tests/qps/qps_worker.py +++ b/src/python/grpcio_tests/tests/qps/qps_worker.py @@ -17,7 +17,7 @@ import argparse import time import grpc -from src.proto.grpc.testing import services_pb2_grpc +from src.proto.grpc.testing import worker_service_pb2_grpc from tests.qps import worker_server from tests.unit import test_common @@ -26,7 +26,8 @@ from tests.unit import test_common def run_worker_server(port): server = test_common.test_server() servicer = worker_server.WorkerServer() - services_pb2_grpc.add_WorkerServiceServicer_to_server(servicer, server) + worker_service_pb2_grpc.add_WorkerServiceServicer_to_server( + servicer, server) server.add_insecure_port('[::]:{}'.format(port)) server.start() servicer.wait_for_quit() diff --git a/src/python/grpcio_tests/tests/qps/worker_server.py b/src/python/grpcio_tests/tests/qps/worker_server.py index 41e2403c8fc..db145fbf64e 100644 --- a/src/python/grpcio_tests/tests/qps/worker_server.py +++ b/src/python/grpcio_tests/tests/qps/worker_server.py @@ -20,7 +20,7 @@ import time from concurrent import futures import grpc from src.proto.grpc.testing import control_pb2 -from src.proto.grpc.testing import services_pb2_grpc +from src.proto.grpc.testing import worker_service_pb2_grpc from src.proto.grpc.testing import stats_pb2 from tests.qps import benchmark_client @@ -31,7 +31,7 @@ from tests.unit import resources from tests.unit import test_common -class WorkerServer(services_pb2_grpc.WorkerServiceServicer): +class WorkerServer(worker_service_pb2_grpc.WorkerServiceServicer): """Python Worker Server implementation.""" def __init__(self): @@ -72,7 +72,7 @@ class WorkerServer(services_pb2_grpc.WorkerServiceServicer): server = test_common.test_server(max_workers=server_threads) if config.server_type == control_pb2.ASYNC_SERVER: servicer = benchmark_server.BenchmarkServer() - services_pb2_grpc.add_BenchmarkServiceServicer_to_server( + worker_service_pb2_grpc.add_BenchmarkServiceServicer_to_server( servicer, server) elif config.server_type == control_pb2.ASYNC_GENERIC_SERVER: resp_size = config.payload_config.bytebuf_params.resp_size diff --git a/src/python/grpcio_tests/tests/testing/_server_test.py b/src/python/grpcio_tests/tests/testing/_server_test.py index 4f4abd77086..88e3a79ae59 100644 --- a/src/python/grpcio_tests/tests/testing/_server_test.py +++ b/src/python/grpcio_tests/tests/testing/_server_test.py @@ -21,13 +21,8 @@ import grpc_testing from tests.testing import _application_common from tests.testing import _application_testing_common from tests.testing import _server_application -from tests.testing.proto import services_pb2 -# TODO(https://github.com/google/protobuf/issues/3452): Drop this skip. -@unittest.skipIf( - services_pb2.DESCRIPTOR.services_by_name.get('FirstService') is None, - 'Fix protobuf issue 3452!') class FirstServiceServicerTest(unittest.TestCase): def setUp(self): diff --git a/src/ruby/pb/generate_proto_ruby.sh b/src/ruby/pb/generate_proto_ruby.sh index d25eff58191..ec6e2eedd1e 100755 --- a/src/ruby/pb/generate_proto_ruby.sh +++ b/src/ruby/pb/generate_proto_ruby.sh @@ -32,7 +32,13 @@ $PROTOC -I . \ --plugin=$PLUGIN $PROTOC -I . \ - src/proto/grpc/testing/{messages,payloads,stats,services,control}.proto \ + src/proto/grpc/core/stats.proto \ + --grpc_out=src/ruby/qps \ + --ruby_out=src/ruby/qps \ + --plugin=$PLUGIN + +$PROTOC -I . \ + src/proto/grpc/testing/{messages,payloads,stats,benchmark_service,report_qps_scenario_service,worker_service,control}.proto \ --grpc_out=src/ruby/qps \ --ruby_out=src/ruby/qps \ --plugin=$PLUGIN diff --git a/src/ruby/qps/client.rb b/src/ruby/qps/client.rb index 0426aee7c81..d573d827b9c 100644 --- a/src/ruby/qps/client.rb +++ b/src/ruby/qps/client.rb @@ -23,7 +23,7 @@ $LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir) require 'grpc' require 'histogram' -require 'src/proto/grpc/testing/services_services_pb' +require 'src/proto/grpc/testing/benchmark_service_services_pb' class Poisson def interarrival diff --git a/src/ruby/qps/proxy-worker.rb b/src/ruby/qps/proxy-worker.rb index 4c7c510fdbd..5f23d896cc5 100755 --- a/src/ruby/qps/proxy-worker.rb +++ b/src/ruby/qps/proxy-worker.rb @@ -27,7 +27,7 @@ require 'histogram' require 'etc' require 'facter' require 'qps-common' -require 'src/proto/grpc/testing/services_services_pb' +require 'src/proto/grpc/testing/worker_service_services_pb' require 'src/proto/grpc/testing/proxy-service_services_pb' class ProxyBenchmarkClientServiceImpl < Grpc::Testing::ProxyClientService::Service diff --git a/src/ruby/qps/server.rb b/src/ruby/qps/server.rb index 90218ea5d29..dccc64e3009 100644 --- a/src/ruby/qps/server.rb +++ b/src/ruby/qps/server.rb @@ -24,7 +24,7 @@ $LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir) require 'grpc' require 'qps-common' require 'src/proto/grpc/testing/messages_pb' -require 'src/proto/grpc/testing/services_services_pb' +require 'src/proto/grpc/testing/benchmark_service_services_pb' require 'src/proto/grpc/testing/stats_pb' class BenchmarkServiceImpl < Grpc::Testing::BenchmarkService::Service diff --git a/src/ruby/qps/src/proto/grpc/core/stats_pb.rb b/src/ruby/qps/src/proto/grpc/core/stats_pb.rb new file mode 100644 index 00000000000..59c057820bf --- /dev/null +++ b/src/ruby/qps/src/proto/grpc/core/stats_pb.rb @@ -0,0 +1,33 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: src/proto/grpc/core/stats.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "grpc.core.Bucket" do + optional :start, :double, 1 + optional :count, :uint64, 2 + end + add_message "grpc.core.Histogram" do + repeated :buckets, :message, 1, "grpc.core.Bucket" + end + add_message "grpc.core.Metric" do + optional :name, :string, 1 + oneof :value do + optional :count, :uint64, 10 + optional :histogram, :message, 11, "grpc.core.Histogram" + end + end + add_message "grpc.core.Stats" do + repeated :metrics, :message, 1, "grpc.core.Metric" + end +end + +module Grpc + module Core + Bucket = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.core.Bucket").msgclass + Histogram = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.core.Histogram").msgclass + Metric = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.core.Metric").msgclass + Stats = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.core.Stats").msgclass + end +end diff --git a/src/ruby/qps/src/proto/grpc/testing/services_pb.rb b/src/ruby/qps/src/proto/grpc/testing/benchmark_service_pb.rb similarity index 71% rename from src/ruby/qps/src/proto/grpc/testing/services_pb.rb rename to src/ruby/qps/src/proto/grpc/testing/benchmark_service_pb.rb index 5ce13bf8b04..0bd3625f3d4 100644 --- a/src/ruby/qps/src/proto/grpc/testing/services_pb.rb +++ b/src/ruby/qps/src/proto/grpc/testing/benchmark_service_pb.rb @@ -1,10 +1,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# source: src/proto/grpc/testing/services.proto +# source: src/proto/grpc/testing/benchmark_service.proto require 'google/protobuf' require 'src/proto/grpc/testing/messages_pb' -require 'src/proto/grpc/testing/control_pb' Google::Protobuf::DescriptorPool.generated_pool.build do end diff --git a/src/ruby/qps/src/proto/grpc/testing/benchmark_service_services_pb.rb b/src/ruby/qps/src/proto/grpc/testing/benchmark_service_services_pb.rb new file mode 100644 index 00000000000..65e5a75c4d8 --- /dev/null +++ b/src/ruby/qps/src/proto/grpc/testing/benchmark_service_services_pb.rb @@ -0,0 +1,56 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: src/proto/grpc/testing/benchmark_service.proto for package 'grpc.testing' +# Original file comments: +# Copyright 2015 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. +# +# An integration test service that covers all the method signature permutations +# of unary/streaming requests/responses. + +require 'grpc' +require 'src/proto/grpc/testing/benchmark_service_pb' + +module Grpc + module Testing + module BenchmarkService + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'grpc.testing.BenchmarkService' + + # One request followed by one response. + # The server returns the client payload as-is. + rpc :UnaryCall, SimpleRequest, SimpleResponse + # Repeated sequence of one request followed by one response. + # Should be called streaming ping-pong + # The server returns the client payload as-is on each response + rpc :StreamingCall, stream(SimpleRequest), stream(SimpleResponse) + # Single-sided unbounded streaming from client to server + # The server returns the client payload as-is once the client does WritesDone + rpc :StreamingFromClient, stream(SimpleRequest), SimpleResponse + # Single-sided unbounded streaming from server to client + # The server repeatedly returns the client payload as-is + rpc :StreamingFromServer, SimpleRequest, stream(SimpleResponse) + # Two-sided unbounded streaming between server to client + # Both sides send the content of their own choice to the other + rpc :StreamingBothWays, stream(SimpleRequest), stream(SimpleResponse) + end + + Stub = Service.rpc_stub_class + end + end +end diff --git a/src/ruby/qps/src/proto/grpc/testing/control_pb.rb b/src/ruby/qps/src/proto/grpc/testing/control_pb.rb index 02207a2b5d8..5acc7fc0c6b 100644 --- a/src/ruby/qps/src/proto/grpc/testing/control_pb.rb +++ b/src/ruby/qps/src/proto/grpc/testing/control_pb.rb @@ -20,6 +20,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do add_message "grpc.testing.SecurityParams" do optional :use_test_ca, :bool, 1 optional :server_host_override, :string, 2 + optional :cred_type, :string, 3 + end + add_message "grpc.testing.ChannelArg" do + optional :name, :string, 1 + oneof :value do + optional :str_value, :string, 2 + optional :int_value, :int32, 3 + end end add_message "grpc.testing.ClientConfig" do repeated :server_targets, :string, 1 @@ -35,6 +43,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do repeated :core_list, :int32, 13 optional :core_limit, :int32, 14 optional :other_client_api, :string, 15 + repeated :channel_args, :message, 16, "grpc.testing.ChannelArg" + optional :threads_per_cq, :int32, 17 + optional :messages_per_stream, :int32, 18 + optional :use_coalesce_api, :bool, 19 end add_message "grpc.testing.ClientStatus" do optional :stats, :message, 1, "grpc.testing.ClientStats" @@ -57,6 +69,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do optional :payload_config, :message, 9, "grpc.testing.PayloadConfig" repeated :core_list, :int32, 10 optional :other_server_api, :string, 11 + optional :threads_per_cq, :int32, 12 + optional :resource_quota_size, :int32, 1001 + repeated :channel_args, :message, 1002, "grpc.testing.ChannelArg" end add_message "grpc.testing.ServerArgs" do oneof :argtype do @@ -101,6 +116,13 @@ Google::Protobuf::DescriptorPool.generated_pool.build do optional :latency_95, :double, 9 optional :latency_99, :double, 10 optional :latency_999, :double, 11 + optional :server_cpu_usage, :double, 12 + optional :successful_requests_per_second, :double, 13 + optional :failed_requests_per_second, :double, 14 + optional :client_polls_per_request, :double, 15 + optional :server_polls_per_request, :double, 16 + optional :server_queries_per_cpu_sec, :double, 17 + optional :client_queries_per_cpu_sec, :double, 18 end add_message "grpc.testing.ScenarioResult" do optional :scenario, :message, 1, "grpc.testing.Scenario" @@ -111,6 +133,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do optional :summary, :message, 6, "grpc.testing.ScenarioResultSummary" repeated :client_success, :bool, 7 repeated :server_success, :bool, 8 + repeated :request_results, :message, 9, "grpc.testing.RequestResultCount" end add_enum "grpc.testing.ClientType" do value :SYNC_CLIENT, 0 @@ -126,6 +149,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do add_enum "grpc.testing.RpcType" do value :UNARY, 0 value :STREAMING, 1 + value :STREAMING_FROM_CLIENT, 2 + value :STREAMING_FROM_SERVER, 3 + value :STREAMING_BOTH_WAYS, 4 end end @@ -135,6 +161,7 @@ module Grpc ClosedLoopParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClosedLoopParams").msgclass LoadParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadParams").msgclass SecurityParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SecurityParams").msgclass + ChannelArg = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ChannelArg").msgclass ClientConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientConfig").msgclass ClientStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientStatus").msgclass Mark = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Mark").msgclass diff --git a/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_pb.rb b/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_pb.rb new file mode 100644 index 00000000000..1b43e372997 --- /dev/null +++ b/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_pb.rb @@ -0,0 +1,13 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: src/proto/grpc/testing/report_qps_scenario_service.proto + +require 'google/protobuf' + +require 'src/proto/grpc/testing/control_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do +end + +module Grpc + module Testing + end +end diff --git a/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_services_pb.rb b/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_services_pb.rb new file mode 100644 index 00000000000..ddc81bed3da --- /dev/null +++ b/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_services_pb.rb @@ -0,0 +1,42 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: src/proto/grpc/testing/report_qps_scenario_service.proto for package 'grpc.testing' +# Original file comments: +# Copyright 2015 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. +# +# An integration test service that covers all the method signature permutations +# of unary/streaming requests/responses. + +require 'grpc' +require 'src/proto/grpc/testing/report_qps_scenario_service_pb' + +module Grpc + module Testing + module ReportQpsScenarioService + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'grpc.testing.ReportQpsScenarioService' + + # Report results of a QPS test benchmark scenario. + rpc :ReportScenario, ScenarioResult, Void + end + + Stub = Service.rpc_stub_class + end + end +end diff --git a/src/ruby/qps/src/proto/grpc/testing/stats_pb.rb b/src/ruby/qps/src/proto/grpc/testing/stats_pb.rb index 41f75bedf05..2069840168a 100644 --- a/src/ruby/qps/src/proto/grpc/testing/stats_pb.rb +++ b/src/ruby/qps/src/proto/grpc/testing/stats_pb.rb @@ -3,11 +3,16 @@ require 'google/protobuf' +require 'src/proto/grpc/core/stats_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_message "grpc.testing.ServerStats" do optional :time_elapsed, :double, 1 optional :time_user, :double, 2 optional :time_system, :double, 3 + optional :total_cpu_time, :uint64, 4 + optional :idle_cpu_time, :uint64, 5 + optional :cq_poll_count, :uint64, 6 + optional :core_stats, :message, 7, "grpc.core.Stats" end add_message "grpc.testing.HistogramParams" do optional :resolution, :double, 1 @@ -21,11 +26,18 @@ Google::Protobuf::DescriptorPool.generated_pool.build do optional :sum_of_squares, :double, 5 optional :count, :double, 6 end + add_message "grpc.testing.RequestResultCount" do + optional :status_code, :int32, 1 + optional :count, :int64, 2 + end add_message "grpc.testing.ClientStats" do optional :latencies, :message, 1, "grpc.testing.HistogramData" optional :time_elapsed, :double, 2 optional :time_user, :double, 3 optional :time_system, :double, 4 + repeated :request_results, :message, 5, "grpc.testing.RequestResultCount" + optional :cq_poll_count, :uint64, 6 + optional :core_stats, :message, 7, "grpc.core.Stats" end end @@ -34,6 +46,7 @@ module Grpc ServerStats = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerStats").msgclass HistogramParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.HistogramParams").msgclass HistogramData = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.HistogramData").msgclass + RequestResultCount = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.RequestResultCount").msgclass ClientStats = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientStats").msgclass end end diff --git a/src/ruby/qps/src/proto/grpc/testing/worker_service_pb.rb b/src/ruby/qps/src/proto/grpc/testing/worker_service_pb.rb new file mode 100644 index 00000000000..18b63452b6e --- /dev/null +++ b/src/ruby/qps/src/proto/grpc/testing/worker_service_pb.rb @@ -0,0 +1,13 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: src/proto/grpc/testing/worker_service.proto + +require 'google/protobuf' + +require 'src/proto/grpc/testing/control_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do +end + +module Grpc + module Testing + end +end diff --git a/src/ruby/qps/src/proto/grpc/testing/services_services_pb.rb b/src/ruby/qps/src/proto/grpc/testing/worker_service_services_pb.rb similarity index 74% rename from src/ruby/qps/src/proto/grpc/testing/services_services_pb.rb rename to src/ruby/qps/src/proto/grpc/testing/worker_service_services_pb.rb index 1d8b619d304..a7ecc957571 100644 --- a/src/ruby/qps/src/proto/grpc/testing/services_services_pb.rb +++ b/src/ruby/qps/src/proto/grpc/testing/worker_service_services_pb.rb @@ -1,5 +1,5 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: src/proto/grpc/testing/services.proto for package 'grpc.testing' +# Source: src/proto/grpc/testing/worker_service.proto for package 'grpc.testing' # Original file comments: # Copyright 2015 gRPC authors. # @@ -19,29 +19,10 @@ # of unary/streaming requests/responses. require 'grpc' -require 'src/proto/grpc/testing/services_pb' +require 'src/proto/grpc/testing/worker_service_pb' module Grpc module Testing - module BenchmarkService - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'grpc.testing.BenchmarkService' - - # One request followed by one response. - # The server returns the client payload as-is. - rpc :UnaryCall, SimpleRequest, SimpleResponse - # One request followed by one response. - # The server returns the client payload as-is. - rpc :StreamingCall, stream(SimpleRequest), stream(SimpleResponse) - end - - Stub = Service.rpc_stub_class - end module WorkerService class Service diff --git a/src/ruby/qps/worker.rb b/src/ruby/qps/worker.rb index 82584874183..633ff13c35a 100755 --- a/src/ruby/qps/worker.rb +++ b/src/ruby/qps/worker.rb @@ -29,7 +29,7 @@ require 'facter' require 'client' require 'qps-common' require 'server' -require 'src/proto/grpc/testing/services_services_pb' +require 'src/proto/grpc/testing/worker_service_services_pb' class WorkerServiceImpl < Grpc::Testing::WorkerService::Service def cpu_cores diff --git a/test/cpp/qps/BUILD b/test/cpp/qps/BUILD index f1abb19e64d..a348b880796 100644 --- a/test/cpp/qps/BUILD +++ b/test/cpp/qps/BUILD @@ -47,9 +47,10 @@ grpc_cc_library( "//:grpc", "//:grpc++", "//:grpc++_core_stats", + "//src/proto/grpc/testing:benchmark_service_proto", "//src/proto/grpc/testing:control_proto", "//src/proto/grpc/testing:payloads_proto", - "//src/proto/grpc/testing:services_proto", + "//src/proto/grpc/testing:worker_service_proto", "//test/core/end2end:ssl_test_data", "//test/core/util:gpr_test_util", "//test/core/util:grpc_test_util", @@ -74,7 +75,8 @@ grpc_cc_library( "//:grpc++", "//src/proto/grpc/testing:control_proto", "//src/proto/grpc/testing:messages_proto", - "//src/proto/grpc/testing:services_proto", + "//src/proto/grpc/testing:report_qps_scenario_service_proto", + "//src/proto/grpc/testing:worker_service_proto", "//test/core/util:gpr_test_util", "//test/core/util:grpc_test_util", "//test/cpp/util:test_util", diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h index 77743a1dee3..31ae6ca1fbe 100644 --- a/test/cpp/qps/client.h +++ b/test/cpp/qps/client.h @@ -31,8 +31,8 @@ #include #include +#include "src/proto/grpc/testing/benchmark_service.grpc.pb.h" #include "src/proto/grpc/testing/payloads.pb.h" -#include "src/proto/grpc/testing/services.grpc.pb.h" #include "src/cpp/util/core_stats.h" #include "test/cpp/qps/histogram.h" diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index f9bef91da08..c79a10d1b41 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -35,7 +35,7 @@ #include #include "src/core/lib/surface/completion_queue.h" -#include "src/proto/grpc/testing/services.grpc.pb.h" +#include "src/proto/grpc/testing/benchmark_service.grpc.pb.h" #include "test/cpp/qps/client.h" #include "test/cpp/qps/usage_timer.h" #include "test/cpp/util/create_test_channel.h" diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index 5185eef7104..e65e3b43f35 100644 --- a/test/cpp/qps/client_sync.cc +++ b/test/cpp/qps/client_sync.cc @@ -35,7 +35,7 @@ #include "src/core/lib/gpr/host_port.h" #include "src/core/lib/profiling/timers.h" -#include "src/proto/grpc/testing/services.grpc.pb.h" +#include "src/proto/grpc/testing/benchmark_service.grpc.pb.h" #include "test/cpp/qps/client.h" #include "test/cpp/qps/interarrival.h" #include "test/cpp/qps/usage_timer.h" diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index 361ee4346f2..34f12915761 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -33,6 +33,7 @@ #include "src/core/lib/gpr/env.h" #include "src/core/lib/gpr/host_port.h" #include "src/core/lib/profiling/timers.h" +#include "src/proto/grpc/testing/worker_service.grpc.pb.h" #include "test/core/util/port.h" #include "test/core/util/test_config.h" #include "test/cpp/qps/client.h" diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc index aaffb1d93ee..d3f03804743 100644 --- a/test/cpp/qps/qps_worker.cc +++ b/test/cpp/qps/qps_worker.cc @@ -35,7 +35,7 @@ #include #include "src/core/lib/gpr/host_port.h" -#include "src/proto/grpc/testing/services.pb.h" +#include "src/proto/grpc/testing/worker_service.grpc.pb.h" #include "test/core/util/grpc_profiler.h" #include "test/core/util/histogram.h" #include "test/cpp/qps/client.h" diff --git a/test/cpp/qps/report.cc b/test/cpp/qps/report.cc index 0a2565d4635..607f4e579b8 100644 --- a/test/cpp/qps/report.cc +++ b/test/cpp/qps/report.cc @@ -27,7 +27,7 @@ #include #include "src/cpp/util/core_stats.h" -#include "src/proto/grpc/testing/services.grpc.pb.h" +#include "src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.h" namespace grpc { namespace testing { diff --git a/test/cpp/qps/report.h b/test/cpp/qps/report.h index c5dd1383536..8e62f4f449d 100644 --- a/test/cpp/qps/report.h +++ b/test/cpp/qps/report.h @@ -28,7 +28,7 @@ #include "test/cpp/qps/driver.h" #include -#include "src/proto/grpc/testing/services.grpc.pb.h" +#include "src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.h" namespace grpc { namespace testing { diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index 9cb05cd1d19..1dfef6cfc17 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -36,7 +36,7 @@ #include "src/core/lib/gpr/host_port.h" #include "src/core/lib/surface/completion_queue.h" -#include "src/proto/grpc/testing/services.grpc.pb.h" +#include "src/proto/grpc/testing/benchmark_service.grpc.pb.h" #include "test/core/util/test_config.h" #include "test/cpp/qps/server.h" diff --git a/test/cpp/qps/server_sync.cc b/test/cpp/qps/server_sync.cc index 9dfd3620555..82a9186989e 100644 --- a/test/cpp/qps/server_sync.cc +++ b/test/cpp/qps/server_sync.cc @@ -26,7 +26,7 @@ #include #include "src/core/lib/gpr/host_port.h" -#include "src/proto/grpc/testing/services.grpc.pb.h" +#include "src/proto/grpc/testing/benchmark_service.grpc.pb.h" #include "test/cpp/qps/server.h" #include "test/cpp/qps/usage_timer.h" diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 8b13e767c74..1e4d401cae0 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -3194,6 +3194,9 @@ "grpc++_core_stats" ], "headers": [ + "src/proto/grpc/testing/benchmark_service.grpc.pb.h", + "src/proto/grpc/testing/benchmark_service.pb.h", + "src/proto/grpc/testing/benchmark_service_mock.grpc.pb.h", "src/proto/grpc/testing/control.grpc.pb.h", "src/proto/grpc/testing/control.pb.h", "src/proto/grpc/testing/control_mock.grpc.pb.h", @@ -3203,12 +3206,15 @@ "src/proto/grpc/testing/payloads.grpc.pb.h", "src/proto/grpc/testing/payloads.pb.h", "src/proto/grpc/testing/payloads_mock.grpc.pb.h", - "src/proto/grpc/testing/services.grpc.pb.h", - "src/proto/grpc/testing/services.pb.h", - "src/proto/grpc/testing/services_mock.grpc.pb.h", + "src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.h", + "src/proto/grpc/testing/report_qps_scenario_service.pb.h", + "src/proto/grpc/testing/report_qps_scenario_service_mock.grpc.pb.h", "src/proto/grpc/testing/stats.grpc.pb.h", "src/proto/grpc/testing/stats.pb.h", - "src/proto/grpc/testing/stats_mock.grpc.pb.h" + "src/proto/grpc/testing/stats_mock.grpc.pb.h", + "src/proto/grpc/testing/worker_service.grpc.pb.h", + "src/proto/grpc/testing/worker_service.pb.h", + "src/proto/grpc/testing/worker_service_mock.grpc.pb.h" ], "is_filegroup": false, "language": "c++", @@ -3228,6 +3234,9 @@ "grpc++_core_stats" ], "headers": [ + "src/proto/grpc/testing/benchmark_service.grpc.pb.h", + "src/proto/grpc/testing/benchmark_service.pb.h", + "src/proto/grpc/testing/benchmark_service_mock.grpc.pb.h", "src/proto/grpc/testing/control.grpc.pb.h", "src/proto/grpc/testing/control.pb.h", "src/proto/grpc/testing/control_mock.grpc.pb.h", @@ -3237,12 +3246,15 @@ "src/proto/grpc/testing/payloads.grpc.pb.h", "src/proto/grpc/testing/payloads.pb.h", "src/proto/grpc/testing/payloads_mock.grpc.pb.h", - "src/proto/grpc/testing/services.grpc.pb.h", - "src/proto/grpc/testing/services.pb.h", - "src/proto/grpc/testing/services_mock.grpc.pb.h", + "src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.h", + "src/proto/grpc/testing/report_qps_scenario_service.pb.h", + "src/proto/grpc/testing/report_qps_scenario_service_mock.grpc.pb.h", "src/proto/grpc/testing/stats.grpc.pb.h", "src/proto/grpc/testing/stats.pb.h", - "src/proto/grpc/testing/stats_mock.grpc.pb.h" + "src/proto/grpc/testing/stats_mock.grpc.pb.h", + "src/proto/grpc/testing/worker_service.grpc.pb.h", + "src/proto/grpc/testing/worker_service.pb.h", + "src/proto/grpc/testing/worker_service_mock.grpc.pb.h" ], "is_filegroup": false, "language": "c++", @@ -7451,6 +7463,9 @@ "grpc_test_util" ], "headers": [ + "src/proto/grpc/testing/benchmark_service.grpc.pb.h", + "src/proto/grpc/testing/benchmark_service.pb.h", + "src/proto/grpc/testing/benchmark_service_mock.grpc.pb.h", "src/proto/grpc/testing/control.grpc.pb.h", "src/proto/grpc/testing/control.pb.h", "src/proto/grpc/testing/control_mock.grpc.pb.h", @@ -7460,12 +7475,15 @@ "src/proto/grpc/testing/payloads.grpc.pb.h", "src/proto/grpc/testing/payloads.pb.h", "src/proto/grpc/testing/payloads_mock.grpc.pb.h", - "src/proto/grpc/testing/services.grpc.pb.h", - "src/proto/grpc/testing/services.pb.h", - "src/proto/grpc/testing/services_mock.grpc.pb.h", + "src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.h", + "src/proto/grpc/testing/report_qps_scenario_service.pb.h", + "src/proto/grpc/testing/report_qps_scenario_service_mock.grpc.pb.h", "src/proto/grpc/testing/stats.grpc.pb.h", "src/proto/grpc/testing/stats.pb.h", "src/proto/grpc/testing/stats_mock.grpc.pb.h", + "src/proto/grpc/testing/worker_service.grpc.pb.h", + "src/proto/grpc/testing/worker_service.pb.h", + "src/proto/grpc/testing/worker_service_mock.grpc.pb.h", "test/cpp/qps/benchmark_config.h", "test/cpp/qps/client.h", "test/cpp/qps/driver.h", From 8a2c6010eec19ad88a838deafe37aa1d8841403a Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Thu, 19 Apr 2018 01:41:26 -0400 Subject: [PATCH 039/165] Bump protobuf hash for Bazel --- bazel/grpc_deps.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index 00e313c71f1..3c69a6bc529 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -85,8 +85,8 @@ def grpc_deps(): if "com_google_protobuf" not in native.existing_rules(): native.http_archive( name = "com_google_protobuf", - strip_prefix = "protobuf-2761122b810fe8861004ae785cc3ab39f384d342", - url = "https://github.com/google/protobuf/archive/2761122b810fe8861004ae785cc3ab39f384d342.tar.gz", + strip_prefix = "protobuf-b5fbb742af122b565925987e65c08957739976a7", + url = "https://github.com/google/protobuf/archive/b5fbb742af122b565925987e65c08957739976a7.tar.gz", ) if "com_github_google_googletest" not in native.existing_rules(): From 8e9baf35bd63612c76376018dae40c59e8eb380a Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Thu, 19 Apr 2018 02:07:59 -0400 Subject: [PATCH 040/165] Bump protobuf runtime dependency versions --- src/csharp/Grpc.Core/Version.csproj.include | 2 +- src/python/grpcio_health_checking/setup.py | 2 +- src/python/grpcio_reflection/setup.py | 2 +- src/python/grpcio_testing/setup.py | 2 +- src/python/grpcio_tests/setup.py | 2 +- templates/src/csharp/Grpc.Core/Version.csproj.include.template | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/csharp/Grpc.Core/Version.csproj.include b/src/csharp/Grpc.Core/Version.csproj.include index f7a7a5cbe9d..6e28c11df27 100755 --- a/src/csharp/Grpc.Core/Version.csproj.include +++ b/src/csharp/Grpc.Core/Version.csproj.include @@ -2,6 +2,6 @@ 1.12.0-dev - 3.3.0 + 3.5.1 diff --git a/src/python/grpcio_health_checking/setup.py b/src/python/grpcio_health_checking/setup.py index 60d309ec650..35c09827ba7 100644 --- a/src/python/grpcio_health_checking/setup.py +++ b/src/python/grpcio_health_checking/setup.py @@ -57,7 +57,7 @@ PACKAGE_DIRECTORIES = { } INSTALL_REQUIRES = ( - 'protobuf>=3.5.0.post1', + 'protobuf>=3.5.2.post1', 'grpcio>={version}'.format(version=grpc_version.VERSION), ) diff --git a/src/python/grpcio_reflection/setup.py b/src/python/grpcio_reflection/setup.py index 10c4c38f199..589d0ff5565 100644 --- a/src/python/grpcio_reflection/setup.py +++ b/src/python/grpcio_reflection/setup.py @@ -58,7 +58,7 @@ PACKAGE_DIRECTORIES = { } INSTALL_REQUIRES = ( - 'protobuf>=3.5.0.post1', + 'protobuf>=3.5.2.post1', 'grpcio>={version}'.format(version=grpc_version.VERSION), ) diff --git a/src/python/grpcio_testing/setup.py b/src/python/grpcio_testing/setup.py index 5a9d593ec17..eb480a5464a 100644 --- a/src/python/grpcio_testing/setup.py +++ b/src/python/grpcio_testing/setup.py @@ -29,7 +29,7 @@ PACKAGE_DIRECTORIES = { } INSTALL_REQUIRES = ( - 'protobuf>=3.5.0.post1', + 'protobuf>=3.5.2.post1', 'grpcio>={version}'.format(version=grpc_version.VERSION), ) diff --git a/src/python/grpcio_tests/setup.py b/src/python/grpcio_tests/setup.py index 4e0f6726fa5..98ac19d1889 100644 --- a/src/python/grpcio_tests/setup.py +++ b/src/python/grpcio_tests/setup.py @@ -41,7 +41,7 @@ INSTALL_REQUIRES = ( 'grpcio>={version}'.format(version=grpc_version.VERSION), 'grpcio-tools>={version}'.format(version=grpc_version.VERSION), 'grpcio-health-checking>={version}'.format(version=grpc_version.VERSION), - 'oauth2client>=1.4.7', 'protobuf>=3.5.0.post1', 'six>=1.10', + 'oauth2client>=1.4.7', 'protobuf>=3.5.2.post1', 'six>=1.10', 'google-auth>=1.0.0', 'requests>=2.14.2') COMMAND_CLASS = { diff --git a/templates/src/csharp/Grpc.Core/Version.csproj.include.template b/templates/src/csharp/Grpc.Core/Version.csproj.include.template index 5bc66e911b2..398b198dbd1 100755 --- a/templates/src/csharp/Grpc.Core/Version.csproj.include.template +++ b/templates/src/csharp/Grpc.Core/Version.csproj.include.template @@ -4,6 +4,6 @@ ${settings.csharp_version} - 3.3.0 + 3.5.1 From 7898da90e745eba0341eb8cd922cf494a3c5e856 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 19 Apr 2018 08:22:10 -0700 Subject: [PATCH 041/165] Clean up test cases in dns_resolver_test. --- test/core/client_channel/resolvers/dns_resolver_test.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/core/client_channel/resolvers/dns_resolver_test.cc b/test/core/client_channel/resolvers/dns_resolver_test.cc index e3fba2838c5..103b2916c46 100644 --- a/test/core/client_channel/resolvers/dns_resolver_test.cc +++ b/test/core/client_channel/resolvers/dns_resolver_test.cc @@ -70,11 +70,12 @@ int main(int argc, char** argv) { test_succeeds(dns, "dns:10.2.1.1"); test_succeeds(dns, "dns:10.2.1.1:1234"); - test_succeeds(dns, "ipv4:www.google.com"); + test_succeeds(dns, "dns:www.google.com"); + test_succeeds(dns, "dns:///www.google.com"); if (grpc_resolve_address == grpc_resolve_address_ares) { - test_succeeds(dns, "ipv4://8.8.8.8/8.8.8.8:8888"); + test_succeeds(dns, "dns://8.8.8.8/8.8.8.8:8888"); } else { - test_fails(dns, "ipv4://8.8.8.8/8.8.8.8:8888"); + test_fails(dns, "dns://8.8.8.8/8.8.8.8:8888"); } { From 57414c7c5126f5dfad03c29f3fcfdd771087be26 Mon Sep 17 00:00:00 2001 From: Eric Gribkoff Date: Thu, 19 Apr 2018 10:19:45 -0700 Subject: [PATCH 042/165] Remove old environment variable from Python artifact build --- tools/run_tests/artifacts/build_artifact_python.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/run_tests/artifacts/build_artifact_python.sh b/tools/run_tests/artifacts/build_artifact_python.sh index 9ea0f05660a..cd794a1391b 100755 --- a/tools/run_tests/artifacts/build_artifact_python.sh +++ b/tools/run_tests/artifacts/build_artifact_python.sh @@ -17,7 +17,6 @@ set -ex cd "$(dirname "$0")/../../.." -export GRPC_PYTHON_USE_CUSTOM_BDIST=0 export GRPC_PYTHON_BUILD_WITH_CYTHON=1 export PYTHON=${PYTHON:-python} export PIP=${PIP:-pip} From 046ad6b13f5eaba4b833abb0ecb49e2c6b75dd46 Mon Sep 17 00:00:00 2001 From: Alexander Polcyn Date: Thu, 19 Apr 2018 10:19:18 -0700 Subject: [PATCH 043/165] Fix bug in addr sorting shutdonw --- test/cpp/naming/address_sorting_test.cc | 10 +++++++++- third_party/address_sorting/address_sorting.c | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test/cpp/naming/address_sorting_test.cc b/test/cpp/naming/address_sorting_test.cc index df93ff6f8dd..a423733cafa 100644 --- a/test/cpp/naming/address_sorting_test.cc +++ b/test/cpp/naming/address_sorting_test.cc @@ -722,16 +722,24 @@ TEST(AddressSortingTest, TestStableSortV4CompatAndSiteLocalAddresses) { } int main(int argc, char** argv) { - const char* resolver = gpr_getenv("GRPC_DNS_RESOLVER"); + char* resolver = gpr_getenv("GRPC_DNS_RESOLVER"); if (resolver == nullptr || strlen(resolver) == 0) { gpr_setenv("GRPC_DNS_RESOLVER", "ares"); } else if (strcmp("ares", resolver)) { gpr_log(GPR_INFO, "GRPC_DNS_RESOLVER != ares: %s.", resolver); } + gpr_free(resolver); grpc_test_init(argc, argv); ::testing::InitGoogleTest(&argc, argv); grpc_init(); auto result = RUN_ALL_TESTS(); grpc_shutdown(); + // Test sequential and nested inits and shutdowns. + grpc_init(); + grpc_init(); + grpc_shutdown(); + grpc_shutdown(); + grpc_init(); + grpc_shutdown(); return result; } diff --git a/third_party/address_sorting/address_sorting.c b/third_party/address_sorting/address_sorting.c index ec46099bec0..d62aca34246 100644 --- a/third_party/address_sorting/address_sorting.c +++ b/third_party/address_sorting/address_sorting.c @@ -366,4 +366,5 @@ void address_sorting_shutdown() { abort(); } g_current_source_addr_factory->vtable->destroy(g_current_source_addr_factory); + g_current_source_addr_factory = NULL; } From 35c7e8c83318edb4c5a910b54224a322970efce9 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 18:07:29 -0700 Subject: [PATCH 044/165] Eliminate bad-continuation suppression --- .pylintrc-tests | 1 - .../tests/protoc_plugin/beta_python_plugin_test.py | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.pylintrc-tests b/.pylintrc-tests index e68fd47b08f..74ac56a994e 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -60,7 +60,6 @@ disable= non-iterator-returned, undefined-loop-variable, raising-bad-type, - bad-continuation, # -- END OF TEST-SPECIFIC SUPPRESSIONS -- diff --git a/src/python/grpcio_tests/tests/protoc_plugin/beta_python_plugin_test.py b/src/python/grpcio_tests/tests/protoc_plugin/beta_python_plugin_test.py index ad0ecf00792..b46e53315e6 100644 --- a/src/python/grpcio_tests/tests/protoc_plugin/beta_python_plugin_test.py +++ b/src/python/grpcio_tests/tests/protoc_plugin/beta_python_plugin_test.py @@ -329,9 +329,7 @@ class PythonPluginTest(unittest.TestCase): _packagify(self._python_out) - with _system_path([ - self._python_out, - ]): + with _system_path([self._python_out]): self._payload_pb2 = importlib.import_module(_PAYLOAD_PB2) self._requests_pb2 = importlib.import_module(_REQUESTS_PB2) self._responses_pb2 = importlib.import_module(_RESPONSES_PB2) From ce8e2fcd16fbfa35365bb69b03118d8ed98a8372 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 18:10:35 -0700 Subject: [PATCH 045/165] Eliminate unreachable suppression --- .pylintrc-tests | 1 - src/python/grpcio_tests/tests/testing/_server_application.py | 2 +- src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.pylintrc-tests b/.pylintrc-tests index 74ac56a994e..a4bcb9a69be 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -54,7 +54,6 @@ disable= unnecessary-lambda, wildcard-import, line-too-long, - unreachable, wrong-import-position, wrong-import-order, non-iterator-returned, diff --git a/src/python/grpcio_tests/tests/testing/_server_application.py b/src/python/grpcio_tests/tests/testing/_server_application.py index 02769ca68dc..243c385dafd 100644 --- a/src/python/grpcio_tests/tests/testing/_server_application.py +++ b/src/python/grpcio_tests/tests/testing/_server_application.py @@ -38,7 +38,7 @@ class FirstServiceServicer(services_pb2_grpc.FirstServiceServicer): context.set_code(grpc.StatusCode.INVALID_ARGUMENT) context.set_details('Something is wrong with your request!') return - yield services_pb2.Strange() + yield services_pb2.Strange() # pylint: disable=unreachable def StreUn(self, request_iterator, context): context.send_initial_metadata((( diff --git a/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py b/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py index 61c03f64bac..b43c647fc9e 100644 --- a/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py +++ b/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py @@ -65,7 +65,7 @@ class _Servicer(object): self._serviced = True self._condition.notify_all() return - yield + yield # pylint: disable=unreachable def stream_unary(self, request_iterator, context): for request in request_iterator: From 327b3fb6f851478db98895a454b9fa852e9e38fc Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 18:13:59 -0700 Subject: [PATCH 046/165] Eliminate raising-bad-type suppression --- .pylintrc-tests | 1 - src/python/grpcio_tests/tests/unit/_cython/test_utilities.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.pylintrc-tests b/.pylintrc-tests index a4bcb9a69be..045431ab460 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -58,7 +58,6 @@ disable= wrong-import-order, non-iterator-returned, undefined-loop-variable, - raising-bad-type, # -- END OF TEST-SPECIFIC SUPPRESSIONS -- diff --git a/src/python/grpcio_tests/tests/unit/_cython/test_utilities.py b/src/python/grpcio_tests/tests/unit/_cython/test_utilities.py index 4a00b9ef2f1..ee5c7795a9b 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/test_utilities.py +++ b/src/python/grpcio_tests/tests/unit/_cython/test_utilities.py @@ -41,7 +41,7 @@ class SimpleFuture(object): self._thread.join() if self._error: # TODO(atash): re-raise exceptions in a way that preserves tracebacks - raise self._error + raise self._error # pylint: disable=raising-bad-type return self._result From a7926f9a4cb9ed635a64be0c37d4b9089819d445 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 18:35:27 -0700 Subject: [PATCH 047/165] Eliminate undefined-loop-variable suppression --- .pylintrc-tests | 1 - src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.pylintrc-tests b/.pylintrc-tests index 045431ab460..20aaddd6e91 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -57,7 +57,6 @@ disable= wrong-import-position, wrong-import-order, non-iterator-returned, - undefined-loop-variable, # -- END OF TEST-SPECIFIC SUPPRESSIONS -- diff --git a/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py b/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py index 9045ff58a0f..23f5ef605dd 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py +++ b/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py @@ -285,7 +285,7 @@ class ServerClientMixin(object): self.assertEqual(5, len(server_event.batch_operations)) found_server_op_types = set() for server_result in server_event.batch_operations: - self.assertNotIn(client_result.type(), found_server_op_types) + self.assertNotIn(server_result.type(), found_server_op_types) found_server_op_types.add(server_result.type()) if server_result.type() == cygrpc.OperationType.receive_message: self.assertEqual(REQUEST, server_result.message()) From a6bf3ccac8e9d4f554d7e1093b93c30ca2255405 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 20:58:56 -0700 Subject: [PATCH 048/165] Eliminate non-iterator-returned suppression --- .pylintrc-tests | 1 - .../grpcio_tests/tests/unit/_invocation_defects_test.py | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pylintrc-tests b/.pylintrc-tests index 20aaddd6e91..e09b3fa1cef 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -56,7 +56,6 @@ disable= line-too-long, wrong-import-position, wrong-import-order, - non-iterator-returned, # -- END OF TEST-SPECIFIC SUPPRESSIONS -- diff --git a/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py b/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py index e40cca8b24c..93a5fdf9ff2 100644 --- a/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py +++ b/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py @@ -165,11 +165,13 @@ class FailAfterFewIterationsCounter(object): def __next__(self): if self._current >= self._high: - raise Exception("This is a deliberate failure in a unit test.") + raise test_control.Defect() else: self._current += 1 return self._bytestring + next = __next__ + def _unary_unary_multi_callable(channel): return channel.unary_unary(_UNARY_UNARY) From 4c87620da222bb9d145ada811e64dc5978be9982 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 23:33:03 -0700 Subject: [PATCH 049/165] Eliminate undefined-variable suppression --- .pylintrc-tests | 1 - src/python/grpcio_tests/tests/interop/client.py | 4 ---- 2 files changed, 5 deletions(-) diff --git a/.pylintrc-tests b/.pylintrc-tests index e09b3fa1cef..2bcfb9e1ed9 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -49,7 +49,6 @@ disable= too-many-format-args, too-many-return-statements, too-many-statements, - undefined-variable, function-redefined, unnecessary-lambda, wildcard-import, diff --git a/src/python/grpcio_tests/tests/interop/client.py b/src/python/grpcio_tests/tests/interop/client.py index 3780ed90203..698c37017f5 100644 --- a/src/python/grpcio_tests/tests/interop/client.py +++ b/src/python/grpcio_tests/tests/interop/client.py @@ -66,10 +66,6 @@ def _args(): return parser.parse_args() -def _application_default_credentials(): - return oauth2client_client.GoogleCredentials.get_application_default() - - def _stub(args): target = '{}:{}'.format(args.server_host, args.server_port) if args.test_case == 'oauth2_auth_token': From bc947ada758e748468a9196cf871a4d5049ce419 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 23:34:54 -0700 Subject: [PATCH 050/165] Eliminate unnecessary-lambda suppression --- .pylintrc-tests | 1 - src/python/grpcio_tests/tests/unit/_compression_test.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.pylintrc-tests b/.pylintrc-tests index 2bcfb9e1ed9..e80d85eaf70 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -50,7 +50,6 @@ disable= too-many-return-statements, too-many-statements, function-redefined, - unnecessary-lambda, wildcard-import, line-too-long, wrong-import-position, diff --git a/src/python/grpcio_tests/tests/unit/_compression_test.py b/src/python/grpcio_tests/tests/unit/_compression_test.py index 7550cd39ba2..0b11f03adf5 100644 --- a/src/python/grpcio_tests/tests/unit/_compression_test.py +++ b/src/python/grpcio_tests/tests/unit/_compression_test.py @@ -52,9 +52,9 @@ class _MethodHandler(grpc.RpcMethodHandler): self.stream_unary = None self.stream_stream = None if self.request_streaming and self.response_streaming: - self.stream_stream = lambda x, y: handle_stream(x, y) + self.stream_stream = handle_stream elif not self.request_streaming and not self.response_streaming: - self.unary_unary = lambda x, y: handle_unary(x, y) + self.unary_unary = handle_unary class _GenericHandler(grpc.GenericRpcHandler): From 86d04c2e34789f1eaddbb352784b2c69936b3b2b Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 23:38:20 -0700 Subject: [PATCH 051/165] Eliminate function-redefined suppression --- .pylintrc-tests | 1 - .../tests/testing/_client_application.py | 24 ------------------- 2 files changed, 25 deletions(-) diff --git a/.pylintrc-tests b/.pylintrc-tests index e80d85eaf70..82c48a1b957 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -49,7 +49,6 @@ disable= too-many-format-args, too-many-return-statements, too-many-statements, - function-redefined, wildcard-import, line-too-long, wrong-import-position, diff --git a/src/python/grpcio_tests/tests/testing/_client_application.py b/src/python/grpcio_tests/tests/testing/_client_application.py index 7d0d74c8c4a..3ddeba23735 100644 --- a/src/python/grpcio_tests/tests/testing/_client_application.py +++ b/src/python/grpcio_tests/tests/testing/_client_application.py @@ -215,30 +215,6 @@ def _run_infinite_request_stream(stub): return _UNSATISFACTORY_OUTCOME -def run(scenario, channel): - stub = services_pb2_grpc.FirstServiceStub(channel) - try: - if scenario is Scenario.UNARY_UNARY: - return _run_unary_unary(stub) - elif scenario is Scenario.UNARY_STREAM: - return _run_unary_stream(stub) - elif scenario is Scenario.STREAM_UNARY: - return _run_stream_unary(stub) - elif scenario is Scenario.STREAM_STREAM: - return _run_stream_stream(stub) - elif scenario is Scenario.CONCURRENT_STREAM_UNARY: - return _run_concurrent_stream_unary(stub) - elif scenario is Scenario.CONCURRENT_STREAM_STREAM: - return _run_concurrent_stream_stream(stub) - elif scenario is Scenario.CANCEL_UNARY_UNARY: - return _run_cancel_unary_unary(stub) - elif scenario is Scenario.INFINITE_REQUEST_STREAM: - return _run_infinite_request_stream(stub) - except grpc.RpcError as rpc_error: - return Outcome(Outcome.Kind.RPC_ERROR, rpc_error.code(), - rpc_error.details()) - - _IMPLEMENTATIONS = { Scenario.UNARY_UNARY: _run_unary_unary, Scenario.UNARY_STREAM: _run_unary_stream, From fc3bb7c1f920a5d52fa6b610ef5068d42dbafdb2 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 23:40:52 -0700 Subject: [PATCH 052/165] Eliminate wildcard-import suppression --- .pylintrc-tests | 1 - src/python/grpcio_tests/tests/unit/_from_grpc_import_star.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.pylintrc-tests b/.pylintrc-tests index 82c48a1b957..5279ecf15eb 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -49,7 +49,6 @@ disable= too-many-format-args, too-many-return-statements, too-many-statements, - wildcard-import, line-too-long, wrong-import-position, wrong-import-order, diff --git a/src/python/grpcio_tests/tests/unit/_from_grpc_import_star.py b/src/python/grpcio_tests/tests/unit/_from_grpc_import_star.py index e6831317228..ad847ae03eb 100644 --- a/src/python/grpcio_tests/tests/unit/_from_grpc_import_star.py +++ b/src/python/grpcio_tests/tests/unit/_from_grpc_import_star.py @@ -14,7 +14,7 @@ _BEFORE_IMPORT = tuple(globals()) -from grpc import * +from grpc import * # pylint: disable=wildcard-import _AFTER_IMPORT = tuple(globals()) From 4cc8ea9be192951d977e4f8f76a9b7ae05d0bb7a Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 23:43:37 -0700 Subject: [PATCH 053/165] Eliminate old-style-class suppression --- .pylintrc-tests | 1 - src/python/grpcio_tests/tests/_result.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.pylintrc-tests b/.pylintrc-tests index 5279ecf15eb..30c2d7c3c16 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -39,7 +39,6 @@ disable= too-many-public-methods, too-many-locals, redefined-variable-type, - old-style-class, redefined-outer-name, bare-except, broad-except, diff --git a/src/python/grpcio_tests/tests/_result.py b/src/python/grpcio_tests/tests/_result.py index 9907c4e1f9f..b105f18e78c 100644 --- a/src/python/grpcio_tests/tests/_result.py +++ b/src/python/grpcio_tests/tests/_result.py @@ -46,7 +46,7 @@ class CaseResult( None. """ - class Kind: + class Kind(object): UNTESTED = 'untested' RUNNING = 'running' ERROR = 'error' @@ -257,7 +257,7 @@ class CoverageResult(AugmentedResult): #coverage.Coverage().combine() -class _Colors: +class _Colors(object): """Namespaced constants for terminal color magic numbers.""" HEADER = '\033[95m' INFO = '\033[94m' From 161194616190d82c85f2e9d5325a8fc39509909c Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 23:45:42 -0700 Subject: [PATCH 054/165] Eliminate bare-except suppression --- .pylintrc-tests | 1 - src/python/grpcio_tests/tests/_loader.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.pylintrc-tests b/.pylintrc-tests index 30c2d7c3c16..c5202067eca 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -40,7 +40,6 @@ disable= too-many-locals, redefined-variable-type, redefined-outer-name, - bare-except, broad-except, ungrouped-imports, too-many-branches, diff --git a/src/python/grpcio_tests/tests/_loader.py b/src/python/grpcio_tests/tests/_loader.py index 31680916b40..be0af64646b 100644 --- a/src/python/grpcio_tests/tests/_loader.py +++ b/src/python/grpcio_tests/tests/_loader.py @@ -54,7 +54,7 @@ class Loader(object): for module in modules: try: package_paths = module.__path__ - except: + except AttributeError: continue self.walk_packages(package_paths) coverage_context.stop() From dd9697fef8103b93cc9ecfbc71fa83cd838f1398 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 23:48:15 -0700 Subject: [PATCH 055/165] Eliminate broad-except suppression --- .pylintrc-tests | 1 - src/python/grpcio_tests/tests/stress/test_runner.py | 2 +- src/python/grpcio_tests/tests/unit/_cython/test_utilities.py | 2 +- src/python/grpcio_tests/tests/unit/_exit_test.py | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.pylintrc-tests b/.pylintrc-tests index c5202067eca..b358b2c4a0e 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -40,7 +40,6 @@ disable= too-many-locals, redefined-variable-type, redefined-outer-name, - broad-except, ungrouped-imports, too-many-branches, too-many-arguments, diff --git a/src/python/grpcio_tests/tests/stress/test_runner.py b/src/python/grpcio_tests/tests/stress/test_runner.py index d5038e3ba24..764cda17fbb 100644 --- a/src/python/grpcio_tests/tests/stress/test_runner.py +++ b/src/python/grpcio_tests/tests/stress/test_runner.py @@ -50,7 +50,7 @@ class TestRunner(threading.Thread): test_case.test_interoperability(self._stub, None) end_time = time.time() self._histogram.add((end_time - start_time) * 1e9) - except Exception as e: + except Exception as e: # pylint: disable=broad-except traceback.print_exc() self._exception_queue.put( Exception("An exception occured during test {}" diff --git a/src/python/grpcio_tests/tests/unit/_cython/test_utilities.py b/src/python/grpcio_tests/tests/unit/_cython/test_utilities.py index ee5c7795a9b..7d5eaaaa842 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/test_utilities.py +++ b/src/python/grpcio_tests/tests/unit/_cython/test_utilities.py @@ -25,7 +25,7 @@ class SimpleFuture(object): def wrapped_function(): try: self._result = function(*args, **kwargs) - except Exception as error: + except Exception as error: # pylint: disable=broad-except self._error = error self._result = None diff --git a/src/python/grpcio_tests/tests/unit/_exit_test.py b/src/python/grpcio_tests/tests/unit/_exit_test.py index 6e6d9de0fb7..f40f3ae07cd 100644 --- a/src/python/grpcio_tests/tests/unit/_exit_test.py +++ b/src/python/grpcio_tests/tests/unit/_exit_test.py @@ -49,7 +49,7 @@ def cleanup_processes(): for process in processes: try: process.kill() - except Exception: + except Exception: # pylint: disable=broad-except pass From d0d8ce8568d29563710dc063846d971f103fd73d Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 17:51:32 -0700 Subject: [PATCH 056/165] Bump pip version to 10.0.1 --- templates/tools/dockerfile/python_deps.include | 2 +- .../dockerfile/test/cxx_alpine_x64/Dockerfile.template | 2 +- tools/distrib/pylint_code.sh | 7 ++++--- tools/distrib/python/docgen.py | 2 +- tools/distrib/yapf_code.sh | 2 +- tools/dockerfile/grpc_clang_tidy/Dockerfile | 2 +- .../dockerfile/interoptest/grpc_interop_csharp/Dockerfile | 2 +- .../interoptest/grpc_interop_csharpcoreclr/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_go/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_java/Dockerfile | 2 +- .../interoptest/grpc_interop_java_oracle8/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_node/Dockerfile | 2 +- .../dockerfile/interoptest/grpc_interop_python/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile | 2 +- tools/dockerfile/test/csharp_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_alpine_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_jessie_x86/Dockerfile | 2 +- tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_ubuntu1710_x64/Dockerfile | 2 +- tools/dockerfile/test/fuzzer/Dockerfile | 2 +- tools/dockerfile/test/multilang_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/node_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/php7_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/php_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/python_alpine_x64/Dockerfile | 2 +- tools/dockerfile/test/python_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/python_pyenv_x64/Dockerfile | 2 +- tools/dockerfile/test/ruby_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/sanity/Dockerfile | 2 +- tools/gce/linux_kokoro_performance_worker_init.sh | 2 +- tools/gce/linux_performance_worker_init.sh | 2 +- tools/run_tests/helper_scripts/build_python.sh | 2 +- 38 files changed, 41 insertions(+), 40 deletions(-) diff --git a/templates/tools/dockerfile/python_deps.include b/templates/tools/dockerfile/python_deps.include index ce36de8ad9c..f203e773385 100644 --- a/templates/tools/dockerfile/python_deps.include +++ b/templates/tools/dockerfile/python_deps.include @@ -9,6 +9,6 @@ RUN apt-get update && apt-get install -y ${'\\'} python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/templates/tools/dockerfile/test/cxx_alpine_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_alpine_x64/Dockerfile.template index b2505668615..d70ad946135 100644 --- a/templates/tools/dockerfile/test/cxx_alpine_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_alpine_x64/Dockerfile.template @@ -40,7 +40,7 @@ zip # Install Python packages from PyPI - RUN pip install --upgrade pip==9.0.2 + RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/distrib/pylint_code.sh b/tools/distrib/pylint_code.sh index 307fe6c0c0c..013b6660eb2 100755 --- a/tools/distrib/pylint_code.sh +++ b/tools/distrib/pylint_code.sh @@ -30,10 +30,11 @@ TEST_DIRS=( ) VIRTUALENV=python_pylint_venv +python -m virtualenv $VIRTUALENV -virtualenv $VIRTUALENV -PYTHON=$(realpath $VIRTUALENV/bin/python) -$PYTHON -m pip install --upgrade pip==9.0.2 +PYTHON=$VIRTUALENV/bin/python + +$PYTHON -m pip install --upgrade pip==10.0.1 $PYTHON -m pip install pylint==1.6.5 for dir in "${DIRS[@]}"; do diff --git a/tools/distrib/python/docgen.py b/tools/distrib/python/docgen.py index 4d6fcb5d65d..732d948bbca 100755 --- a/tools/distrib/python/docgen.py +++ b/tools/distrib/python/docgen.py @@ -70,7 +70,7 @@ subprocess_arguments_list = [ 'env': environment }, { - 'args': [VIRTUALENV_PIP_PATH, 'install', '--upgrade', 'pip==9.0.1'], + 'args': [VIRTUALENV_PIP_PATH, 'install', '--upgrade', 'pip==10.0.1'], 'env': environment }, { diff --git a/tools/distrib/yapf_code.sh b/tools/distrib/yapf_code.sh index 919e9c13d54..dbc842fa37a 100755 --- a/tools/distrib/yapf_code.sh +++ b/tools/distrib/yapf_code.sh @@ -32,7 +32,7 @@ VIRTUALENV=yapf_virtual_environment virtualenv $VIRTUALENV PYTHON=$(realpath "${VIRTUALENV}/bin/python") -$PYTHON -m pip install --upgrade pip==9.0.2 +$PYTHON -m pip install --upgrade pip==10.0.1 $PYTHON -m pip install --upgrade futures $PYTHON -m pip install yapf==0.20.0 diff --git a/tools/dockerfile/grpc_clang_tidy/Dockerfile b/tools/dockerfile/grpc_clang_tidy/Dockerfile index d9599af45bb..52f3248da2d 100644 --- a/tools/dockerfile/grpc_clang_tidy/Dockerfile +++ b/tools/dockerfile/grpc_clang_tidy/Dockerfile @@ -33,7 +33,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile index 96154c8d8fb..c3fb00389e7 100644 --- a/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile @@ -60,7 +60,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile index 96154c8d8fb..c3fb00389e7 100644 --- a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile @@ -60,7 +60,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile index 3e0f477cc63..110f8f9a796 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile @@ -60,7 +60,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile index 83f05d87ea5..2708a652848 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile @@ -28,7 +28,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile index 79907f3d7c3..2d1119b7b38 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile @@ -28,7 +28,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile index 42069419f85..f02b4dcce35 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile @@ -28,7 +28,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile index c14bcdaa93e..3a832bbabae 100644 --- a/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile @@ -28,7 +28,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile index 510e157d561..d1de1b8809a 100644 --- a/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile @@ -43,7 +43,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile index 510e157d561..d1de1b8809a 100644 --- a/tools/dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile @@ -43,7 +43,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile index 7464e31f0f9..75298b26497 100644 --- a/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile @@ -60,7 +60,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile index 49c1191ba9b..baed2644a2a 100644 --- a/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile @@ -60,7 +60,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile index f3667b5ae05..fa010873222 100644 --- a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile @@ -60,7 +60,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/csharp_jessie_x64/Dockerfile b/tools/dockerfile/test/csharp_jessie_x64/Dockerfile index c9335f09419..49abf038e3d 100644 --- a/tools/dockerfile/test/csharp_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/csharp_jessie_x64/Dockerfile @@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/cxx_alpine_x64/Dockerfile b/tools/dockerfile/test/cxx_alpine_x64/Dockerfile index 5b2b527a81c..3449af1e203 100644 --- a/tools/dockerfile/test/cxx_alpine_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_alpine_x64/Dockerfile @@ -38,7 +38,7 @@ RUN apk update && apk add \ zip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/cxx_jessie_x64/Dockerfile b/tools/dockerfile/test/cxx_jessie_x64/Dockerfile index 825896b1a50..b4b7717e9b2 100644 --- a/tools/dockerfile/test/cxx_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_jessie_x64/Dockerfile @@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/cxx_jessie_x86/Dockerfile b/tools/dockerfile/test/cxx_jessie_x86/Dockerfile index 692960dff76..5d3e7f46954 100644 --- a/tools/dockerfile/test/cxx_jessie_x86/Dockerfile +++ b/tools/dockerfile/test/cxx_jessie_x86/Dockerfile @@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile b/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile index 38b040b2588..d29ca9e9e0f 100644 --- a/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile @@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile b/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile index 5487b6d28c4..f59cfc7156d 100644 --- a/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile @@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/cxx_ubuntu1710_x64/Dockerfile b/tools/dockerfile/test/cxx_ubuntu1710_x64/Dockerfile index ffb08588cb6..74013c9d19d 100644 --- a/tools/dockerfile/test/cxx_ubuntu1710_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_ubuntu1710_x64/Dockerfile @@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/fuzzer/Dockerfile b/tools/dockerfile/test/fuzzer/Dockerfile index 36712191ec6..d669656eccc 100644 --- a/tools/dockerfile/test/fuzzer/Dockerfile +++ b/tools/dockerfile/test/fuzzer/Dockerfile @@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/multilang_jessie_x64/Dockerfile b/tools/dockerfile/test/multilang_jessie_x64/Dockerfile index 8202a4a0605..df0346b3265 100644 --- a/tools/dockerfile/test/multilang_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/multilang_jessie_x64/Dockerfile @@ -140,7 +140,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/node_jessie_x64/Dockerfile b/tools/dockerfile/test/node_jessie_x64/Dockerfile index e87eb6f63b4..13963272bce 100644 --- a/tools/dockerfile/test/node_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/node_jessie_x64/Dockerfile @@ -75,7 +75,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/php7_jessie_x64/Dockerfile b/tools/dockerfile/test/php7_jessie_x64/Dockerfile index 3a638678672..abaa2c9dacb 100644 --- a/tools/dockerfile/test/php7_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/php7_jessie_x64/Dockerfile @@ -75,7 +75,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/php_jessie_x64/Dockerfile b/tools/dockerfile/test/php_jessie_x64/Dockerfile index 32a4b61a400..1df68f6505b 100644 --- a/tools/dockerfile/test/php_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/php_jessie_x64/Dockerfile @@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/python_alpine_x64/Dockerfile b/tools/dockerfile/test/python_alpine_x64/Dockerfile index 66ec34ab59a..6e06e2d52c3 100644 --- a/tools/dockerfile/test/python_alpine_x64/Dockerfile +++ b/tools/dockerfile/test/python_alpine_x64/Dockerfile @@ -37,7 +37,7 @@ RUN apk update && apk add \ zip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 diff --git a/tools/dockerfile/test/python_jessie_x64/Dockerfile b/tools/dockerfile/test/python_jessie_x64/Dockerfile index 4e6916d3c2c..aa35d14ddcf 100644 --- a/tools/dockerfile/test/python_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/python_jessie_x64/Dockerfile @@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/python_pyenv_x64/Dockerfile b/tools/dockerfile/test/python_pyenv_x64/Dockerfile index bd1432eaf77..903c5b7cf7c 100644 --- a/tools/dockerfile/test/python_pyenv_x64/Dockerfile +++ b/tools/dockerfile/test/python_pyenv_x64/Dockerfile @@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/ruby_jessie_x64/Dockerfile b/tools/dockerfile/test/ruby_jessie_x64/Dockerfile index 45923ca240d..72c7a791a8a 100644 --- a/tools/dockerfile/test/ruby_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/ruby_jessie_x64/Dockerfile @@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/test/sanity/Dockerfile b/tools/dockerfile/test/sanity/Dockerfile index c93693c6585..f825ab5d97d 100644 --- a/tools/dockerfile/test/sanity/Dockerfile +++ b/tools/dockerfile/test/sanity/Dockerfile @@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y \ python-pip # Install Python packages from PyPI -RUN pip install --upgrade pip==9.0.2 +RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/gce/linux_kokoro_performance_worker_init.sh b/tools/gce/linux_kokoro_performance_worker_init.sh index 084e9fbff40..4a1e3e608b7 100755 --- a/tools/gce/linux_kokoro_performance_worker_init.sh +++ b/tools/gce/linux_kokoro_performance_worker_init.sh @@ -72,7 +72,7 @@ sudo apt-get install -y netperf sudo apt-get install -y libgflags-dev libgtest-dev libc++-dev clang # Python dependencies -sudo pip install --upgrade pip==9.0.2 +sudo pip install --upgrade pip==10.0.1 sudo pip install tabulate sudo pip install google-api-python-client sudo pip install virtualenv diff --git a/tools/gce/linux_performance_worker_init.sh b/tools/gce/linux_performance_worker_init.sh index 09d8fd012d1..7222cef9a2a 100755 --- a/tools/gce/linux_performance_worker_init.sh +++ b/tools/gce/linux_performance_worker_init.sh @@ -72,7 +72,7 @@ sudo apt-get install -y netperf sudo apt-get install -y libgflags-dev libgtest-dev libc++-dev clang # Python dependencies -sudo pip install --upgrade pip==9.0.2 +sudo pip install --upgrade pip==10.0.1 sudo pip install tabulate sudo pip install google-api-python-client sudo pip install virtualenv diff --git a/tools/run_tests/helper_scripts/build_python.sh b/tools/run_tests/helper_scripts/build_python.sh index bd952721adc..b0a6f0f4d4d 100755 --- a/tools/run_tests/helper_scripts/build_python.sh +++ b/tools/run_tests/helper_scripts/build_python.sh @@ -163,7 +163,7 @@ case "$VENV" in ;; esac -$VENV_PYTHON -m pip install --upgrade pip==9.0.2 +$VENV_PYTHON -m pip install --upgrade pip==10.0.1 $VENV_PYTHON -m pip install setuptools $VENV_PYTHON -m pip install cython $VENV_PYTHON -m pip install six enum34 protobuf futures From c176917789d8655412c063ab526230f6deb05d6d Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Thu, 19 Apr 2018 00:43:03 -0400 Subject: [PATCH 057/165] Bump Python protobuf to 3.5.2.post1 --- templates/tools/dockerfile/python_deps.include | 2 +- tools/dockerfile/grpc_clang_tidy/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile | 2 +- .../interoptest/grpc_interop_csharpcoreclr/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_go/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_java/Dockerfile | 2 +- .../dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_node/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_python/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile | 2 +- tools/dockerfile/test/csharp_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_jessie_x86/Dockerfile | 2 +- tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_ubuntu1710_x64/Dockerfile | 2 +- tools/dockerfile/test/fuzzer/Dockerfile | 2 +- tools/dockerfile/test/multilang_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/node_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/php7_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/php_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/python_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/python_pyenv_x64/Dockerfile | 2 +- tools/dockerfile/test/ruby_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/sanity/Dockerfile | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/templates/tools/dockerfile/python_deps.include b/templates/tools/dockerfile/python_deps.include index f203e773385..c7bf238b5a9 100644 --- a/templates/tools/dockerfile/python_deps.include +++ b/templates/tools/dockerfile/python_deps.include @@ -11,4 +11,4 @@ RUN apt-get update && apt-get install -y ${'\\'} # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/dockerfile/grpc_clang_tidy/Dockerfile b/tools/dockerfile/grpc_clang_tidy/Dockerfile index 52f3248da2d..dec7680fcf7 100644 --- a/tools/dockerfile/grpc_clang_tidy/Dockerfile +++ b/tools/dockerfile/grpc_clang_tidy/Dockerfile @@ -35,7 +35,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 ADD clang_tidy_all_the_things.sh / diff --git a/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile index c3fb00389e7..e806ba59237 100644 --- a/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================ # C# dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile index c3fb00389e7..e806ba59237 100644 --- a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================ # C# dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile index 110f8f9a796..d3eb456e940 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile index 2708a652848..b136259ce90 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile @@ -30,7 +30,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile index 2d1119b7b38..d43d0e40f58 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile @@ -30,7 +30,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile index f02b4dcce35..17ca6784dae 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile @@ -30,7 +30,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile index 3a832bbabae..e7555c95cf5 100644 --- a/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile @@ -30,7 +30,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 RUN pip install twisted h2==2.6.1 hyper diff --git a/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile index d1de1b8809a..fc29ada0d2d 100644 --- a/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile @@ -45,7 +45,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 # Trigger download of as many Gradle artifacts as possible. diff --git a/tools/dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile index d1de1b8809a..fc29ada0d2d 100644 --- a/tools/dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile @@ -45,7 +45,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 # Trigger download of as many Gradle artifacts as possible. diff --git a/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile index 75298b26497..539a869a7b5 100644 --- a/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================== # Node dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile index baed2644a2a..97cdf48db86 100644 --- a/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile index fa010873222..75e3314e2be 100644 --- a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================== # Ruby dependencies diff --git a/tools/dockerfile/test/csharp_jessie_x64/Dockerfile b/tools/dockerfile/test/csharp_jessie_x64/Dockerfile index 49abf038e3d..7a8e26d2a72 100644 --- a/tools/dockerfile/test/csharp_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/csharp_jessie_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================ # C# dependencies diff --git a/tools/dockerfile/test/cxx_jessie_x64/Dockerfile b/tools/dockerfile/test/cxx_jessie_x64/Dockerfile index b4b7717e9b2..f2517539b67 100644 --- a/tools/dockerfile/test/cxx_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_jessie_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/cxx_jessie_x86/Dockerfile b/tools/dockerfile/test/cxx_jessie_x86/Dockerfile index 5d3e7f46954..bb9c7511e34 100644 --- a/tools/dockerfile/test/cxx_jessie_x86/Dockerfile +++ b/tools/dockerfile/test/cxx_jessie_x86/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile b/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile index d29ca9e9e0f..b0d9261af27 100644 --- a/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile b/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile index f59cfc7156d..65ff58e7289 100644 --- a/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/cxx_ubuntu1710_x64/Dockerfile b/tools/dockerfile/test/cxx_ubuntu1710_x64/Dockerfile index 74013c9d19d..e9264431346 100644 --- a/tools/dockerfile/test/cxx_ubuntu1710_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_ubuntu1710_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/fuzzer/Dockerfile b/tools/dockerfile/test/fuzzer/Dockerfile index d669656eccc..a2424923184 100644 --- a/tools/dockerfile/test/fuzzer/Dockerfile +++ b/tools/dockerfile/test/fuzzer/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/multilang_jessie_x64/Dockerfile b/tools/dockerfile/test/multilang_jessie_x64/Dockerfile index df0346b3265..962fe97de05 100644 --- a/tools/dockerfile/test/multilang_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/multilang_jessie_x64/Dockerfile @@ -142,7 +142,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 # Install coverage for Python test coverage reporting RUN pip install coverage diff --git a/tools/dockerfile/test/node_jessie_x64/Dockerfile b/tools/dockerfile/test/node_jessie_x64/Dockerfile index 13963272bce..f32b437b75e 100644 --- a/tools/dockerfile/test/node_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/node_jessie_x64/Dockerfile @@ -77,7 +77,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================== # Node dependencies diff --git a/tools/dockerfile/test/php7_jessie_x64/Dockerfile b/tools/dockerfile/test/php7_jessie_x64/Dockerfile index abaa2c9dacb..e96be2769a4 100644 --- a/tools/dockerfile/test/php7_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/php7_jessie_x64/Dockerfile @@ -77,7 +77,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/test/php_jessie_x64/Dockerfile b/tools/dockerfile/test/php_jessie_x64/Dockerfile index 1df68f6505b..88ee2677630 100644 --- a/tools/dockerfile/test/php_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/php_jessie_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================= # PHP dependencies diff --git a/tools/dockerfile/test/python_jessie_x64/Dockerfile b/tools/dockerfile/test/python_jessie_x64/Dockerfile index aa35d14ddcf..41b670c06c6 100644 --- a/tools/dockerfile/test/python_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/python_jessie_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/test/python_pyenv_x64/Dockerfile b/tools/dockerfile/test/python_pyenv_x64/Dockerfile index 903c5b7cf7c..24fe7b2931d 100644 --- a/tools/dockerfile/test/python_pyenv_x64/Dockerfile +++ b/tools/dockerfile/test/python_pyenv_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 # Install dependencies for pyenv RUN apt-get update && apt-get install -y \ diff --git a/tools/dockerfile/test/ruby_jessie_x64/Dockerfile b/tools/dockerfile/test/ruby_jessie_x64/Dockerfile index 72c7a791a8a..37d909a038b 100644 --- a/tools/dockerfile/test/ruby_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/ruby_jessie_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================== # Ruby dependencies diff --git a/tools/dockerfile/test/sanity/Dockerfile b/tools/dockerfile/test/sanity/Dockerfile index f825ab5d97d..4885843aa4e 100644 --- a/tools/dockerfile/test/sanity/Dockerfile +++ b/tools/dockerfile/test/sanity/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies From 7ec3be7576672382a045d1e716365fe636cf8e76 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Thu, 19 Apr 2018 15:32:19 -0700 Subject: [PATCH 058/165] Increase Foundry job count to 200 --- tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh | 2 +- tools/internal_ci/linux/grpc_msan_on_foundry.sh | 2 +- tools/internal_ci/linux/grpc_ubsan_on_foundry.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh index 93d2858aa08..3102992beff 100755 --- a/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh @@ -37,7 +37,7 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc # TODO(adelez): implement size for test targets and change test_timeout back "${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ - test --jobs="100" \ + test --jobs="200" \ --test_output=errors \ --verbose_failures=true \ --keep_going \ diff --git a/tools/internal_ci/linux/grpc_msan_on_foundry.sh b/tools/internal_ci/linux/grpc_msan_on_foundry.sh index 60b30ff4f65..6858d971cb7 100644 --- a/tools/internal_ci/linux/grpc_msan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_msan_on_foundry.sh @@ -37,7 +37,7 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc "${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ - test --jobs="100" \ + test --jobs="200" \ --test_timeout="3600,3600,3600,3600" \ --test_output=errors \ --verbose_failures=true \ diff --git a/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh b/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh index a87547d1b34..0f0c12db12b 100644 --- a/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh @@ -37,7 +37,7 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc "${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ - test --jobs="100" \ + test --jobs="200" \ --test_timeout="3600,3600,3600,3600" \ --test_output=errors \ --verbose_failures=true \ From 2d96e48741235e6b8c5b3753302f598d7021426e Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Thu, 19 Apr 2018 16:18:09 -0700 Subject: [PATCH 059/165] Reduce runs_per_tests for master Foundry builds to 1 --- tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh | 2 +- tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh index ed5caa40230..882e4df21b5 100644 --- a/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh @@ -13,6 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -EXTRA_FLAGS="-c dbg --test_timeout=300,450,1200,3600 --runs_per_test_detects_flakes --runs_per_test=2" +EXTRA_FLAGS="-c dbg --test_timeout=300,450,1200,3600 --runs_per_test_detects_flakes --runs_per_test=1" github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}" diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh index 66f02a82ff9..85f69537bd4 100644 --- a/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh @@ -13,5 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -EXTRA_FLAGS="-c opt --test_timeout=300,450,1200,3600 --runs_per_test_detects_flakes --runs_per_test=2" +EXTRA_FLAGS="-c opt --test_timeout=300,450,1200,3600 --runs_per_test_detects_flakes --runs_per_test=1" github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}" From b1990ac37fac633b55510e776ea14057ea027690 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 20 Apr 2018 10:23:44 +0200 Subject: [PATCH 060/165] fix resolver crash when DNS server unreachable --- .../client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc index fb2435749de..e86ab5a37e1 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc @@ -153,7 +153,10 @@ static void grpc_ares_request_unref(grpc_ares_request* r) { /* If there are no pending queries, invoke on_done callback and destroy the request */ if (gpr_unref(&r->pending_queries)) { - grpc_cares_wrapper_address_sorting_sort(*(r->lb_addrs_out)); + grpc_lb_addresses* lb_addrs = *(r->lb_addrs_out); + if (lb_addrs != nullptr) { + grpc_cares_wrapper_address_sorting_sort(lb_addrs); + } GRPC_CLOSURE_SCHED(r->on_done, r->error); gpr_mu_destroy(&r->mu); grpc_ares_ev_driver_destroy(r->ev_driver); From 2b036e6c1db74c0a3cad2763815305a2d66a27f4 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 20 Apr 2018 10:23:44 +0200 Subject: [PATCH 061/165] fix resolver crash when DNS server unreachable --- .../client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc index fb2435749de..e86ab5a37e1 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc @@ -153,7 +153,10 @@ static void grpc_ares_request_unref(grpc_ares_request* r) { /* If there are no pending queries, invoke on_done callback and destroy the request */ if (gpr_unref(&r->pending_queries)) { - grpc_cares_wrapper_address_sorting_sort(*(r->lb_addrs_out)); + grpc_lb_addresses* lb_addrs = *(r->lb_addrs_out); + if (lb_addrs != nullptr) { + grpc_cares_wrapper_address_sorting_sort(lb_addrs); + } GRPC_CLOSURE_SCHED(r->on_done, r->error); gpr_mu_destroy(&r->mu); grpc_ares_ev_driver_destroy(r->ev_driver); From 85570890f86f7bb011fbc6934f113bd47e99a0d9 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 20 Apr 2018 12:52:55 +0200 Subject: [PATCH 062/165] remove C# global.json files --- examples/csharp/helloworld-from-cli/global.json | 5 ----- src/csharp/global.json | 5 ----- 2 files changed, 10 deletions(-) delete mode 100644 examples/csharp/helloworld-from-cli/global.json delete mode 100644 src/csharp/global.json diff --git a/examples/csharp/helloworld-from-cli/global.json b/examples/csharp/helloworld-from-cli/global.json deleted file mode 100644 index e4b797ee8ef..00000000000 --- a/examples/csharp/helloworld-from-cli/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "1.0.0" - } -} diff --git a/src/csharp/global.json b/src/csharp/global.json deleted file mode 100644 index 815be4bfb90..00000000000 --- a/src/csharp/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "2.1.4" - } -} From f723164e3ebfd95673d03dc495ca366a2283b32d Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 20 Apr 2018 14:52:53 +0200 Subject: [PATCH 063/165] new mono versions on MacOS default to 64bit runtime --- src/csharp/Grpc.Core/NativeDeps.Mac.csproj.include | 8 -------- tools/run_tests/run_tests.py | 6 +++--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/csharp/Grpc.Core/NativeDeps.Mac.csproj.include b/src/csharp/Grpc.Core/NativeDeps.Mac.csproj.include index f1b85c3730e..309e33d47ed 100644 --- a/src/csharp/Grpc.Core/NativeDeps.Mac.csproj.include +++ b/src/csharp/Grpc.Core/NativeDeps.Mac.csproj.include @@ -1,13 +1,5 @@ - - - libgrpc_csharp_ext.x86.dylib - PreserveNewest - false - libgrpc_csharp_ext.x64.dylib PreserveNewest diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 4146eec42df..6fb0f89381f 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -921,9 +921,6 @@ class CSharpLanguage(object): if self.platform == 'mac': # TODO(jtattermusch): EMBED_ZLIB=true currently breaks the mac build self._make_options = ['EMBED_OPENSSL=true'] - if self.args.compiler != 'coreclr': - # On Mac, official distribution of mono is 32bit. - self._make_options += ['ARCH_FLAGS=-m32', 'LDFLAGS=-m32'] else: self._make_options = ['EMBED_OPENSSL=true', 'EMBED_ZLIB=true'] @@ -944,6 +941,9 @@ class CSharpLanguage(object): assembly_subdir += '/net45' if self.platform == 'windows': runtime_cmd = [] + elif self.platform == 'mac': + # mono before version 5.2 on MacOS defaults to 32bit runtime + runtime_cmd = ['mono', '--arch=64'] else: runtime_cmd = ['mono'] From cd9e9e7cc525faa0e4dbe0c4d30faae04d5f4859 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Fri, 20 Apr 2018 15:55:12 +0100 Subject: [PATCH 064/165] Add RpcException.StatusCode property This is purely for convenience - using `e.Status.StatusCode` looks clunky compared with `e.StatusCode`, and this is the property most likely to be used for exception filtering etc. --- src/csharp/Grpc.Core/RpcException.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/csharp/Grpc.Core/RpcException.cs b/src/csharp/Grpc.Core/RpcException.cs index d2c912e73af..94429d74ce6 100644 --- a/src/csharp/Grpc.Core/RpcException.cs +++ b/src/csharp/Grpc.Core/RpcException.cs @@ -72,6 +72,17 @@ namespace Grpc.Core } } + /// + /// Returns the status code of the call, as a convenient alternative to Status.StatusCode. + /// + public StatusCode StatusCode + { + get + { + return status.StatusCode; + } + } + /// /// Gets the call trailing metadata. /// Trailers only have meaningful content for client-side calls (in which case they represent the trailing metadata sent by the server when closing the call). From 0dcbb83420e25b657249878606bbef9c53f09ea3 Mon Sep 17 00:00:00 2001 From: Yihua Zhang Date: Fri, 20 Apr 2018 08:50:45 -0700 Subject: [PATCH 065/165] add alts to interop tests --- test/cpp/interop/client.cc | 2 ++ test/cpp/interop/client_helper.cc | 5 +++- test/cpp/interop/http2_client.cc | 2 +- test/cpp/interop/interop_server.cc | 2 ++ test/cpp/interop/reconnect_interop_client.cc | 6 +++-- test/cpp/interop/server_helper.cc | 3 +++ test/cpp/interop/stress_test.cc | 10 +++++++- test/cpp/util/create_test_channel.cc | 26 ++++++++++---------- test/cpp/util/create_test_channel.h | 16 ++++++++---- test/cpp/util/test_credentials_provider.cc | 6 +++++ test/cpp/util/test_credentials_provider.h | 2 +- 11 files changed, 56 insertions(+), 24 deletions(-) diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index ca8ee3de06f..3eb155ef95c 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -31,6 +31,8 @@ #include "test/cpp/interop/interop_client.h" #include "test/cpp/util/test_config.h" +DEFINE_bool(use_alts, false, + "Whether to use alts. Enable alts will disable tls."); DEFINE_bool(use_tls, false, "Whether to use tls."); DEFINE_string(custom_credentials_type, "", "User provided credentials type."); DEFINE_bool(use_test_ca, false, "False to use SSL roots for google"); diff --git a/test/cpp/interop/client_helper.cc b/test/cpp/interop/client_helper.cc index 4041f95abc5..29b5a1ed6c2 100644 --- a/test/cpp/interop/client_helper.cc +++ b/test/cpp/interop/client_helper.cc @@ -35,6 +35,7 @@ #include "test/cpp/util/create_test_channel.h" #include "test/cpp/util/test_credentials_provider.h" +DECLARE_bool(use_alts); DECLARE_bool(use_tls); DECLARE_string(custom_credentials_type); DECLARE_bool(use_test_ca); @@ -103,8 +104,10 @@ std::shared_ptr CreateChannelForTestCase( GPR_ASSERT(creds); } if (FLAGS_custom_credentials_type.empty()) { + transport_security security_type = + FLAGS_use_alts ? ALTS : (FLAGS_use_tls ? TLS : INSECURE); return CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_use_tls, !FLAGS_use_test_ca, creds); + security_type, !FLAGS_use_test_ca, creds); } else { return CreateTestChannel(host_port, FLAGS_custom_credentials_type, creds); } diff --git a/test/cpp/interop/http2_client.cc b/test/cpp/interop/http2_client.cc index 821815c6e80..543f1592650 100644 --- a/test/cpp/interop/http2_client.cc +++ b/test/cpp/interop/http2_client.cc @@ -194,7 +194,7 @@ int main(int argc, char** argv) { snprintf(host_port, host_port_buf_size, "%s:%d", FLAGS_server_host.c_str(), FLAGS_server_port); std::shared_ptr channel = - grpc::CreateTestChannel(host_port, false); + grpc::CreateTestChannel(host_port, grpc::testing::INSECURE); GPR_ASSERT(channel->WaitForConnected(gpr_time_add( gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(300, GPR_TIMESPAN)))); grpc::testing::Http2Client client(channel); diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index 5fa1a336da3..6526e0535bd 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -38,6 +38,8 @@ #include "test/cpp/interop/server_helper.h" #include "test/cpp/util/test_config.h" +DEFINE_bool(use_alts, false, + "Whether to use alts. Enable alts will disable tls."); DEFINE_bool(use_tls, false, "Whether to use tls."); DEFINE_string(custom_credentials_type, "", "User provided credentials type."); DEFINE_int32(port, 0, "Server port."); diff --git a/test/cpp/interop/reconnect_interop_client.cc b/test/cpp/interop/reconnect_interop_client.cc index 9a451fa3f28..8a071d417e6 100644 --- a/test/cpp/interop/reconnect_interop_client.cc +++ b/test/cpp/interop/reconnect_interop_client.cc @@ -44,9 +44,11 @@ using grpc::ClientContext; using grpc::CreateTestChannel; using grpc::Status; using grpc::testing::Empty; +using grpc::testing::INSECURE; using grpc::testing::ReconnectInfo; using grpc::testing::ReconnectParams; using grpc::testing::ReconnectService; +using grpc::testing::TLS; int main(int argc, char** argv) { grpc::testing::InitTest(&argc, &argv, true); @@ -57,7 +59,7 @@ int main(int argc, char** argv) { server_address << FLAGS_server_host << ':' << FLAGS_server_control_port; std::unique_ptr control_stub( ReconnectService::NewStub( - CreateTestChannel(server_address.str(), false))); + CreateTestChannel(server_address.str(), INSECURE))); ClientContext start_context; ReconnectParams reconnect_params; reconnect_params.set_max_reconnect_backoff_ms(FLAGS_max_reconnect_backoff_ms); @@ -75,7 +77,7 @@ int main(int argc, char** argv) { FLAGS_max_reconnect_backoff_ms); } std::shared_ptr retry_channel = - CreateTestChannel(server_address.str(), "foo.test.google.fr", true, false, + CreateTestChannel(server_address.str(), "foo.test.google.fr", TLS, false, std::shared_ptr(), channel_args); // About 13 retries. diff --git a/test/cpp/interop/server_helper.cc b/test/cpp/interop/server_helper.cc index 93ffd52560c..21945219982 100644 --- a/test/cpp/interop/server_helper.cc +++ b/test/cpp/interop/server_helper.cc @@ -26,6 +26,7 @@ #include "src/core/lib/surface/call_test_only.h" #include "test/cpp/util/test_credentials_provider.h" +DECLARE_bool(use_alts); DECLARE_bool(use_tls); DECLARE_string(custom_credentials_type); @@ -36,6 +37,8 @@ std::shared_ptr CreateInteropServerCredentials() { if (!FLAGS_custom_credentials_type.empty()) { return GetCredentialsProvider()->GetServerCredentials( FLAGS_custom_credentials_type); + } else if (FLAGS_use_alts) { + return GetCredentialsProvider()->GetServerCredentials(kAltsCredentialsType); } else if (FLAGS_use_tls) { return GetCredentialsProvider()->GetServerCredentials(kTlsCredentialsType); } else { diff --git a/test/cpp/interop/stress_test.cc b/test/cpp/interop/stress_test.cc index 6e8134a83bc..023e0c8f0b2 100644 --- a/test/cpp/interop/stress_test.cc +++ b/test/cpp/interop/stress_test.cc @@ -99,18 +99,24 @@ DEFINE_bool(do_not_abort_on_transient_failures, true, // Options from client.cc (for compatibility with interop test). // TODO(sreek): Consolidate overlapping options +DEFINE_bool(use_alts, false, + "Whether to use alts. Enable alts will disable tls."); DEFINE_bool(use_tls, false, "Whether to use tls."); DEFINE_bool(use_test_ca, false, "False to use SSL roots for google"); DEFINE_string(server_host_override, "foo.test.google.fr", "Override the server host which is sent in HTTP header"); +using grpc::testing::ALTS; +using grpc::testing::INSECURE; using grpc::testing::MetricsService; using grpc::testing::MetricsServiceImpl; using grpc::testing::StressTestInteropClient; +using grpc::testing::TLS; using grpc::testing::TestCaseType; using grpc::testing::UNKNOWN_TEST; using grpc::testing::WeightedRandomTestSelector; using grpc::testing::kTestCaseList; +using grpc::testing::transport_security; static int log_level = GPR_LOG_SEVERITY_DEBUG; @@ -268,6 +274,8 @@ int main(int argc, char** argv) { int thread_idx = 0; int server_idx = -1; char buffer[256]; + transport_security security_type = + FLAGS_use_alts ? ALTS : (FLAGS_use_tls ? TLS : INSECURE); for (auto it = server_addresses.begin(); it != server_addresses.end(); it++) { ++server_idx; // Create channel(s) for each server @@ -276,7 +284,7 @@ int main(int argc, char** argv) { gpr_log(GPR_INFO, "Starting test with %s channel_idx=%d..", it->c_str(), channel_idx); std::shared_ptr channel = grpc::CreateTestChannel( - *it, FLAGS_server_host_override, FLAGS_use_tls, !FLAGS_use_test_ca); + *it, FLAGS_server_host_override, security_type, !FLAGS_use_test_ca); // Create stub(s) for each channel for (int stub_idx = 0; stub_idx < FLAGS_num_stubs_per_channel; diff --git a/test/cpp/util/create_test_channel.cc b/test/cpp/util/create_test_channel.cc index 1047d446274..0bcd4dbc844 100644 --- a/test/cpp/util/create_test_channel.cc +++ b/test/cpp/util/create_test_channel.cc @@ -107,37 +107,37 @@ std::shared_ptr CreateTestChannel( std::shared_ptr CreateTestChannel( const grpc::string& server, const grpc::string& override_hostname, - bool enable_ssl, bool use_prod_roots, + testing::transport_security security_type, bool use_prod_roots, const std::shared_ptr& creds, const ChannelArguments& args) { - grpc::string type; - if (enable_ssl) { - type = testing::kTlsCredentialsType; - } - + grpc::string type = + security_type == testing::ALTS + ? testing::kAltsCredentialsType + : (security_type == testing::TLS ? testing::kTlsCredentialsType + : testing::kInsecureCredentialsType); return CreateTestChannel(server, type, override_hostname, use_prod_roots, creds, args); } std::shared_ptr CreateTestChannel( const grpc::string& server, const grpc::string& override_hostname, - bool enable_ssl, bool use_prod_roots, + testing::transport_security security_type, bool use_prod_roots, const std::shared_ptr& creds) { - return CreateTestChannel(server, override_hostname, enable_ssl, + return CreateTestChannel(server, override_hostname, security_type, use_prod_roots, creds, ChannelArguments()); } std::shared_ptr CreateTestChannel( const grpc::string& server, const grpc::string& override_hostname, - bool enable_ssl, bool use_prod_roots) { - return CreateTestChannel(server, override_hostname, enable_ssl, + testing::transport_security security_type, bool use_prod_roots) { + return CreateTestChannel(server, override_hostname, security_type, use_prod_roots, std::shared_ptr()); } // Shortcut for end2end and interop tests. -std::shared_ptr CreateTestChannel(const grpc::string& server, - bool enable_ssl) { - return CreateTestChannel(server, "foo.test.google.fr", enable_ssl, false); +std::shared_ptr CreateTestChannel( + const grpc::string& server, testing::transport_security security_type) { + return CreateTestChannel(server, "foo.test.google.fr", security_type, false); } std::shared_ptr CreateTestChannel( diff --git a/test/cpp/util/create_test_channel.h b/test/cpp/util/create_test_channel.h index ddaa99f43eb..c615fb76536 100644 --- a/test/cpp/util/create_test_channel.h +++ b/test/cpp/util/create_test_channel.h @@ -26,21 +26,27 @@ namespace grpc { class Channel; -std::shared_ptr CreateTestChannel(const grpc::string& server, - bool enable_ssl); +namespace testing { + +typedef enum { INSECURE = 0, TLS, ALTS } transport_security; + +} // namespace testing + +std::shared_ptr CreateTestChannel( + const grpc::string& server, testing::transport_security security_type); std::shared_ptr CreateTestChannel( const grpc::string& server, const grpc::string& override_hostname, - bool enable_ssl, bool use_prod_roots); + testing::transport_security security_type, bool use_prod_roots); std::shared_ptr CreateTestChannel( const grpc::string& server, const grpc::string& override_hostname, - bool enable_ssl, bool use_prod_roots, + testing::transport_security security_type, bool use_prod_roots, const std::shared_ptr& creds); std::shared_ptr CreateTestChannel( const grpc::string& server, const grpc::string& override_hostname, - bool enable_ssl, bool use_prod_roots, + testing::transport_security security_type, bool use_prod_roots, const std::shared_ptr& creds, const ChannelArguments& args); diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc index 76561007c48..c8b0ac73f43 100644 --- a/test/cpp/util/test_credentials_provider.cc +++ b/test/cpp/util/test_credentials_provider.cc @@ -56,6 +56,9 @@ class DefaultCredentialsProvider : public CredentialsProvider { const grpc::string& type, ChannelArguments* args) override { if (type == grpc::testing::kInsecureCredentialsType) { return InsecureChannelCredentials(); + } else if (type == grpc::testing::kAltsCredentialsType) { + grpc::experimental::AltsCredentialsOptions alts_opts; + return grpc::experimental::AltsCredentials(alts_opts); } else if (type == grpc::testing::kTlsCredentialsType) { SslCredentialsOptions ssl_opts = {test_root_cert, "", ""}; args->SetSslTargetNameOverride("foo.test.google.fr"); @@ -77,6 +80,9 @@ class DefaultCredentialsProvider : public CredentialsProvider { const grpc::string& type) override { if (type == grpc::testing::kInsecureCredentialsType) { return InsecureServerCredentials(); + } else if (type == grpc::testing::kAltsCredentialsType) { + grpc::experimental::AltsServerCredentialsOptions alts_opts; + return grpc::experimental::AltsServerCredentials(alts_opts); } else if (type == grpc::testing::kTlsCredentialsType) { SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key, test_server1_cert}; diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h index f489a2c563f..b1d69e893d5 100644 --- a/test/cpp/util/test_credentials_provider.h +++ b/test/cpp/util/test_credentials_provider.h @@ -29,10 +29,10 @@ namespace grpc { namespace testing { const char kInsecureCredentialsType[] = "INSECURE_CREDENTIALS"; - // For real credentials, like tls/ssl, this name should match the AuthContext // property "transport_security_type". const char kTlsCredentialsType[] = "ssl"; +const char kAltsCredentialsType[] = "alts"; // Provide test credentials of a particular type. class CredentialTypeProvider { From 9635a04fed00cc1e9b72954cb3f72417b7f10e15 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 20 Apr 2018 10:44:17 -0700 Subject: [PATCH 066/165] Work-around for ref-counted subclass deletion address problem. --- src/core/ext/filters/client_channel/lb_policy.h | 4 ++++ .../ext/filters/client_channel/lb_policy/grpclb/grpclb.cc | 4 ++++ src/core/ext/filters/client_channel/method_params.h | 4 ++++ src/core/ext/filters/client_channel/resolver.h | 4 ++++ src/core/ext/filters/client_channel/retry_throttle.h | 4 ++++ src/core/lib/gprpp/orphanable.h | 4 ++-- src/core/lib/gprpp/ref_counted.h | 4 ++-- src/core/lib/slice/slice_hash_table.h | 4 ++++ src/core/lib/slice/slice_weak_hash_table.h | 4 ++++ src/core/tsi/ssl/session_cache/ssl_session_cache.h | 4 ++++ 10 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h index c3e43e5ef65..454e00a6907 100644 --- a/src/core/ext/filters/client_channel/lb_policy.h +++ b/src/core/ext/filters/client_channel/lb_policy.h @@ -162,6 +162,10 @@ class LoadBalancingPolicy GRPC_ABSTRACT_BASE_CLASS protected: + // So Delete() can access our protected dtor. + template + friend void Delete(T*); + explicit LoadBalancingPolicy(const Args& args); virtual ~LoadBalancingPolicy(); diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 0b2a30818e2..097ff112f9a 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -189,6 +189,10 @@ class GrpcLb : public LoadBalancingPolicy { bool seen_initial_response() const { return seen_initial_response_; } private: + // So Delete() can access our private dtor. + template + friend void grpc_core::Delete(T*); + ~BalancerCallState(); GrpcLb* grpclb_policy() const { diff --git a/src/core/ext/filters/client_channel/method_params.h b/src/core/ext/filters/client_channel/method_params.h index 099924edf36..a31d360f172 100644 --- a/src/core/ext/filters/client_channel/method_params.h +++ b/src/core/ext/filters/client_channel/method_params.h @@ -60,6 +60,10 @@ class ClientChannelMethodParams : public RefCounted { template friend T* grpc_core::New(Args&&... args); + // So Delete() can call our private dtor. + template + friend void grpc_core::Delete(T*); + ClientChannelMethodParams() {} virtual ~ClientChannelMethodParams() {} diff --git a/src/core/ext/filters/client_channel/resolver.h b/src/core/ext/filters/client_channel/resolver.h index cdb5a20ea31..02380314dd9 100644 --- a/src/core/ext/filters/client_channel/resolver.h +++ b/src/core/ext/filters/client_channel/resolver.h @@ -105,6 +105,10 @@ class Resolver : public InternallyRefCountedWithTracing { GRPC_ABSTRACT_BASE_CLASS protected: + // So Delete() can access our protected dtor. + template + friend void Delete(T*); + /// Does NOT take ownership of the reference to \a combiner. // TODO(roth): Once we have a C++-like interface for combiners, this // API should change to take a RefCountedPtr<>, so that we always take diff --git a/src/core/ext/filters/client_channel/retry_throttle.h b/src/core/ext/filters/client_channel/retry_throttle.h index 2b6fa0a70b1..fddafcd903e 100644 --- a/src/core/ext/filters/client_channel/retry_throttle.h +++ b/src/core/ext/filters/client_channel/retry_throttle.h @@ -42,6 +42,10 @@ class ServerRetryThrottleData : public RefCounted { intptr_t milli_token_ratio() const { return milli_token_ratio_; } private: + // So Delete() can call our private dtor. + template + friend void grpc_core::Delete(T*); + ~ServerRetryThrottleData(); void GetReplacementThrottleDataIfNeeded( diff --git a/src/core/lib/gprpp/orphanable.h b/src/core/lib/gprpp/orphanable.h index a5bc8d8efc9..b50f8c247ca 100644 --- a/src/core/lib/gprpp/orphanable.h +++ b/src/core/lib/gprpp/orphanable.h @@ -100,7 +100,7 @@ class InternallyRefCounted : public Orphanable { void Unref() { if (gpr_unref(&refs_)) { - Delete(this); + Delete(static_cast(this)); } } @@ -173,7 +173,7 @@ class InternallyRefCountedWithTracing : public Orphanable { void Unref() { if (gpr_unref(&refs_)) { - Delete(this); + Delete(static_cast(this)); } } diff --git a/src/core/lib/gprpp/ref_counted.h b/src/core/lib/gprpp/ref_counted.h index 46bfaf7fb8c..bd6874f3db5 100644 --- a/src/core/lib/gprpp/ref_counted.h +++ b/src/core/lib/gprpp/ref_counted.h @@ -54,7 +54,7 @@ class RefCounted { // friend of this class. void Unref() { if (gpr_unref(&refs_)) { - Delete(this); + Delete(static_cast(this)); } } @@ -114,7 +114,7 @@ class RefCountedWithTracing { void Unref() { if (gpr_unref(&refs_)) { - Delete(this); + Delete(static_cast(this)); } } diff --git a/src/core/lib/slice/slice_hash_table.h b/src/core/lib/slice/slice_hash_table.h index fbe9cc58e87..4bbcf88e895 100644 --- a/src/core/lib/slice/slice_hash_table.h +++ b/src/core/lib/slice/slice_hash_table.h @@ -81,6 +81,10 @@ class SliceHashTable : public RefCounted> { template friend T2* New(Args&&... args); + // So Delete() can call our private dtor. + template + friend void Delete(T2*); + SliceHashTable(size_t num_entries, Entry* entries, ValueCmp value_cmp); virtual ~SliceHashTable(); diff --git a/src/core/lib/slice/slice_weak_hash_table.h b/src/core/lib/slice/slice_weak_hash_table.h index 9d0ddfc2d2a..dc3ccc5dadd 100644 --- a/src/core/lib/slice/slice_weak_hash_table.h +++ b/src/core/lib/slice/slice_weak_hash_table.h @@ -65,6 +65,10 @@ class SliceWeakHashTable : public RefCounted> { template friend T2* New(Args&&... args); + // So Delete() can call our private dtor. + template + friend void Delete(T2*); + SliceWeakHashTable() = default; ~SliceWeakHashTable() = default; diff --git a/src/core/tsi/ssl/session_cache/ssl_session_cache.h b/src/core/tsi/ssl/session_cache/ssl_session_cache.h index 488638c9bb2..a90cca1a2ea 100644 --- a/src/core/tsi/ssl/session_cache/ssl_session_cache.h +++ b/src/core/tsi/ssl/session_cache/ssl_session_cache.h @@ -69,6 +69,10 @@ class SslSessionLRUCache : public grpc_core::RefCounted { template friend T* grpc_core::New(Args&&... args); + // So Delete() can call our private dtor. + template + friend void grpc_core::Delete(T*); + class Node; explicit SslSessionLRUCache(size_t capacity); From 68d1fb9a2c75aa3b257a28452a3f0ef24dde52d1 Mon Sep 17 00:00:00 2001 From: jiangtaoli2016 Date: Thu, 19 Apr 2018 16:02:33 -0700 Subject: [PATCH 067/165] Add fake ALTS handshaker server (bazel only) --- test/core/tsi/alts/fake_handshaker/BUILD | 47 +++ .../fake_handshaker/fake_handshaker_server.cc | 268 ++++++++++++++++++ .../tsi/alts/fake_handshaker/handshaker.proto | 224 +++++++++++++++ .../transport_security_common.proto | 40 +++ 4 files changed, 579 insertions(+) create mode 100644 test/core/tsi/alts/fake_handshaker/BUILD create mode 100644 test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc create mode 100644 test/core/tsi/alts/fake_handshaker/handshaker.proto create mode 100644 test/core/tsi/alts/fake_handshaker/transport_security_common.proto diff --git a/test/core/tsi/alts/fake_handshaker/BUILD b/test/core/tsi/alts/fake_handshaker/BUILD new file mode 100644 index 00000000000..90e0d00209c --- /dev/null +++ b/test/core/tsi/alts/fake_handshaker/BUILD @@ -0,0 +1,47 @@ +# Copyright 2018 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. + +licenses(["notice"]) # Apache v2 + +load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_cc_binary", "grpc_package") + +grpc_package(name = "test/core/tsi/alts/fake_handshaker", visibility = "public") + +grpc_proto_library( + name = "transport_security_common_proto", + srcs = ["transport_security_common.proto"], + has_services = False, +) + +grpc_proto_library( + name = "handshaker_proto", + srcs = ["handshaker.proto"], + has_services = True, + deps = [ + ":transport_security_common_proto", + ], +) + +grpc_cc_binary( + name = "fake_handshaker_server", + testonly = True, + srcs = ["fake_handshaker_server.cc"], + language = "C++", + deps = [ + ":handshaker_proto", + ":transport_security_common_proto", + "//:grpc++", + "//test/cpp/util:test_config", + ], +) diff --git a/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc b/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc new file mode 100644 index 00000000000..ca24ea4fb3c --- /dev/null +++ b/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc @@ -0,0 +1,268 @@ +/* + * + * Copyright 2018 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 +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "test/core/tsi/alts/fake_handshaker/handshaker.grpc.pb.h" +#include "test/core/tsi/alts/fake_handshaker/handshaker.pb.h" +#include "test/core/tsi/alts/fake_handshaker/transport_security_common.pb.h" +#include "test/cpp/util/test_config.h" + +DEFINE_int32(handshaker_port, 55056, + "TCP port on which the fake handshaker server listens to."); + +// Fake handshake messages. +constexpr char kClientInitFrame[] = "ClientInit"; +constexpr char kServerFrame[] = "ServerInitAndFinished"; +constexpr char kClientFinishFrame[] = "ClientFinished"; +// Error messages. +constexpr char kInvalidFrameError[] = "Invalid input frame."; +constexpr char kWrongStateError[] = "Wrong handshake state."; + +namespace grpc { +namespace gcp { + +// FakeHandshakeService implements a fake handshaker service using a fake key +// exchange protocol. The fake key exchange protocol is a 3-message protocol: +// - Client first sends ClientInit message to Server. +// - Server then sends ServerInitAndFinished message back to Client. +// - Client finally sends ClientFinished message to Server. +// This fake handshaker service is intended for ALTS integration testing without +// relying on real ALTS handshaker service inside GCE. +// It is thread-safe. +class FakeHandshakerService : public HandshakerService::Service { + public: + Status DoHandshake( + ServerContext* server_context, + ServerReaderWriter* stream) override { + Status status; + HandshakerContext context; + HandshakerReq request; + HandshakerResp response; + gpr_log(GPR_DEBUG, "Start a new handshake."); + while (stream->Read(&request)) { + status = ProcessRequest(&context, request, &response); + if (!status.ok()) return WriteErrorResponse(stream, status); + stream->Write(response); + if (context.state == COMPLETED) return Status::OK; + request.Clear(); + } + return Status::OK; + } + + private: + // HandshakeState is used by fake handshaker server to keep track of client's + // handshake status. In the beginning of a handshake, the state is INITIAL. + // If start_client or start_server request is called, the state becomes at + // least STARTED. When the handshaker server produces the first fame, the + // state becomes SENT. After the handshaker server processes the final frame + // from the peer, the state becomes COMPLETED. + enum HandshakeState { INITIAL, STARTED, SENT, COMPLETED }; + + struct HandshakerContext { + bool is_client = true; + HandshakeState state = INITIAL; + }; + + Status ProcessRequest(HandshakerContext* context, + const HandshakerReq& request, + HandshakerResp* response) { + GPR_ASSERT(context != nullptr && response != nullptr); + response->Clear(); + if (request.has_client_start()) { + gpr_log(GPR_DEBUG, "Process client start request."); + return ProcessClientStart(context, request.client_start(), response); + } else if (request.has_server_start()) { + gpr_log(GPR_DEBUG, "Process server start request."); + return ProcessServerStart(context, request.server_start(), response); + } else if (request.has_next()) { + gpr_log(GPR_DEBUG, "Process next request."); + return ProcessNext(context, request.next(), response); + } + return Status(StatusCode::INVALID_ARGUMENT, "Request is empty."); + } + + Status ProcessClientStart(HandshakerContext* context, + const StartClientHandshakeReq& request, + HandshakerResp* response) { + GPR_ASSERT(context != nullptr && response != nullptr); + // Checks request. + if (context->state != INITIAL) { + return Status(StatusCode::FAILED_PRECONDITION, kWrongStateError); + } + if (request.application_protocols_size() == 0) { + return Status(StatusCode::INVALID_ARGUMENT, + "At least one application protocol needed."); + } + if (request.record_protocols_size() == 0) { + return Status(StatusCode::INVALID_ARGUMENT, + "At least one record protocol needed."); + } + // Sets response. + response->set_out_frames(kClientInitFrame); + response->set_bytes_consumed(0); + response->mutable_status()->set_code(StatusCode::OK); + // Updates handshaker context. + context->is_client = true; + context->state = SENT; + return Status::OK; + } + + Status ProcessServerStart(HandshakerContext* context, + const StartServerHandshakeReq& request, + HandshakerResp* response) { + GPR_ASSERT(context != nullptr && response != nullptr); + // Checks request. + if (context->state != INITIAL) { + return Status(StatusCode::FAILED_PRECONDITION, kWrongStateError); + } + if (request.application_protocols_size() == 0) { + return Status(StatusCode::INVALID_ARGUMENT, + "At least one application protocol needed."); + } + if (request.handshake_parameters().size() == 0) { + return Status(StatusCode::INVALID_ARGUMENT, + "At least one set of handshake parameters needed."); + } + // Sets response. + if (request.in_bytes().empty()) { + // start_server request does not have in_bytes. + response->set_bytes_consumed(0); + context->state = STARTED; + } else { + // start_server request has in_bytes. + if (request.in_bytes() == kClientInitFrame) { + response->set_out_frames(kServerFrame); + response->set_bytes_consumed(strlen(kClientInitFrame)); + context->state = SENT; + } else { + return Status(StatusCode::UNKNOWN, kInvalidFrameError); + } + } + response->mutable_status()->set_code(StatusCode::OK); + context->is_client = false; + return Status::OK; + } + + Status ProcessNext(HandshakerContext* context, + const NextHandshakeMessageReq& request, + HandshakerResp* response) { + GPR_ASSERT(context != nullptr && response != nullptr); + if (context->is_client) { + // Processes next request on client side. + if (context->state != SENT) { + return Status(StatusCode::FAILED_PRECONDITION, kWrongStateError); + } + if (request.in_bytes() != kServerFrame) { + return Status(StatusCode::UNKNOWN, kInvalidFrameError); + } + response->set_out_frames(kClientFinishFrame); + response->set_bytes_consumed(strlen(kServerFrame)); + context->state = COMPLETED; + } else { + // Processes next request on server side. + HandshakeState current_state = context->state; + if (current_state == STARTED) { + if (request.in_bytes() != kClientInitFrame) { + return Status(StatusCode::UNKNOWN, kInvalidFrameError); + } + response->set_out_frames(kServerFrame); + response->set_bytes_consumed(strlen(kClientInitFrame)); + context->state = SENT; + } else if (current_state == SENT) { + // Client finish frame may be sent along with the first payload from the + // client, handshaker only consumes the client finish frame. + if (request.in_bytes().substr(0, strlen(kClientFinishFrame)) != + kClientFinishFrame) { + return Status(StatusCode::UNKNOWN, kInvalidFrameError); + } + response->set_bytes_consumed(strlen(kClientFinishFrame)); + context->state = COMPLETED; + } else { + return Status(StatusCode::FAILED_PRECONDITION, kWrongStateError); + } + } + // At this point, processing next request succeeded. + response->mutable_status()->set_code(StatusCode::OK); + if (context->state == COMPLETED) { + *response->mutable_result() = GetHandshakerResult(); + } + return Status::OK; + } + + Status WriteErrorResponse( + ServerReaderWriter* stream, + const Status& status) { + GPR_ASSERT(!status.ok()); + HandshakerResp response; + response.mutable_status()->set_code(status.error_code()); + response.mutable_status()->set_details(status.error_message()); + stream->Write(response); + return status; + } + + HandshakerResult GetHandshakerResult() { + HandshakerResult result; + result.set_application_protocol("grpc"); + result.set_record_protocol("ALTSRP_GCM_AES128_REKEY"); + result.mutable_peer_identity()->set_service_account("peer_identity"); + result.mutable_local_identity()->set_service_account("local_identity"); + string key(1024, '\0'); + result.set_key_data(key); + result.mutable_peer_rpc_versions()->mutable_max_rpc_version()->set_major(2); + result.mutable_peer_rpc_versions()->mutable_max_rpc_version()->set_minor(1); + result.mutable_peer_rpc_versions()->mutable_min_rpc_version()->set_major(2); + result.mutable_peer_rpc_versions()->mutable_min_rpc_version()->set_minor(1); + return result; + } +}; + +} // namespace gcp +} // namespace grpc + +void RunServer() { + GPR_ASSERT(FLAGS_handshaker_port != 0); + std::ostringstream server_address; + server_address << "[::1]:" << FLAGS_handshaker_port; + grpc::gcp::FakeHandshakerService service; + grpc::ServerBuilder builder; + builder.AddListeningPort(server_address.str(), + grpc::InsecureServerCredentials()); + builder.RegisterService(&service); + std::unique_ptr server(builder.BuildAndStart()); + gpr_log(GPR_INFO, "Fake handshaker server listening on %s", + server_address.str().c_str()); + server->Wait(); +} + +int main(int argc, char** argv) { + grpc::testing::InitTest(&argc, &argv, true); + RunServer(); + return 0; +} diff --git a/test/core/tsi/alts/fake_handshaker/handshaker.proto b/test/core/tsi/alts/fake_handshaker/handshaker.proto new file mode 100644 index 00000000000..8af9abfbf56 --- /dev/null +++ b/test/core/tsi/alts/fake_handshaker/handshaker.proto @@ -0,0 +1,224 @@ +// Copyright 2018 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. + +syntax = "proto3"; + +import "test/core/tsi/alts/fake_handshaker/transport_security_common.proto"; + +package grpc.gcp; + +option java_package = "io.grpc.alts.internal"; + +enum HandshakeProtocol { + // Default value. + HANDSHAKE_PROTOCOL_UNSPECIFIED = 0; + + // TLS handshake protocol. + TLS = 1; + + // Application Layer Transport Security handshake protocol. + ALTS = 2; +} + +enum NetworkProtocol { + NETWORK_PROTOCOL_UNSPECIFIED = 0; + TCP = 1; + UDP = 2; +} + +message Endpoint { + // IP address. It should contain an IPv4 or IPv6 string literal, e.g. + // "192.168.0.1" or "2001:db8::1". + string ip_address = 1; + + // Port number. + int32 port = 2; + + // Network protocol (e.g., TCP, UDP) associated with this endpoint. + NetworkProtocol protocol = 3; +} + +message Identity { + oneof identity_oneof { + // Service account of a connection endpoint. + string service_account = 1; + + // Hostname of a connection endpoint. + string hostname = 2; + } +} + +message StartClientHandshakeReq { + // Handshake security protocol requested by the client. + HandshakeProtocol handshake_security_protocol = 1; + + // The application protocols supported by the client, e.g., "h2" (for http2), + // "grpc". + repeated string application_protocols = 2; + + // The record protocols supported by the client, e.g., + // "ALTSRP_GCM_AES128". + repeated string record_protocols = 3; + + // (Optional) Describes which server identities are acceptable by the client. + // If target identities are provided and none of them matches the peer + // identity of the server, handshake will fail. + repeated Identity target_identities = 4; + + // (Optional) Application may specify a local identity. Otherwise, the + // handshaker chooses a default local identity. + Identity local_identity = 5; + + // (Optional) Local endpoint information of the connection to the server, + // such as local IP address, port number, and network protocol. + Endpoint local_endpoint = 6; + + // (Optional) Endpoint information of the remote server, such as IP address, + // port number, and network protocol. + Endpoint remote_endpoint = 7; + + // (Optional) If target name is provided, a secure naming check is performed + // to verify that the peer authenticated identity is indeed authorized to run + // the target name. + string target_name = 8; + + // (Optional) RPC protocol versions supported by the client. + RpcProtocolVersions rpc_versions = 9; +} + +message ServerHandshakeParameters { + // The record protocols supported by the server, e.g., + // "ALTSRP_GCM_AES128". + repeated string record_protocols = 1; + + // (Optional) A list of local identities supported by the server, if + // specified. Otherwise, the handshaker chooses a default local identity. + repeated Identity local_identities = 2; +} + +message StartServerHandshakeReq { + // The application protocols supported by the server, e.g., "h2" (for http2), + // "grpc". + repeated string application_protocols = 1; + + // Handshake parameters (record protocols and local identities supported by + // the server) mapped by the handshake protocol. Each handshake security + // protocol (e.g., TLS or ALTS) has its own set of record protocols and local + // identities. Since protobuf does not support enum as key to the map, the key + // to handshake_parameters is the integer value of HandshakeProtocol enum. + map handshake_parameters = 2; + + // Bytes in out_frames returned from the peer's HandshakerResp. It is possible + // that the peer's out_frames are split into multiple HandshakReq messages. + bytes in_bytes = 3; + + // (Optional) Local endpoint information of the connection to the client, + // such as local IP address, port number, and network protocol. + Endpoint local_endpoint = 4; + + // (Optional) Endpoint information of the remote client, such as IP address, + // port number, and network protocol. + Endpoint remote_endpoint = 5; + + // (Optional) RPC protocol versions supported by the server. + RpcProtocolVersions rpc_versions = 6; +} + +message NextHandshakeMessageReq { + // Bytes in out_frames returned from the peer's HandshakerResp. It is possible + // that the peer's out_frames are split into multiple NextHandshakerMessageReq + // messages. + bytes in_bytes = 1; +} + +message HandshakerReq { + oneof req_oneof { + // The start client handshake request message. + StartClientHandshakeReq client_start = 1; + + // The start server handshake request message. + StartServerHandshakeReq server_start = 2; + + // The next handshake request message. + NextHandshakeMessageReq next = 3; + } +} + +message HandshakerResult { + // The application protocol negotiated for this connection. + string application_protocol = 1; + + // The record protocol negotiated for this connection. + string record_protocol = 2; + + // Cryptographic key data. The key data may be more than the key length + // required for the record protocol, thus the client of the handshaker + // service needs to truncate the key data into the right key length. + bytes key_data = 3; + + // The authenticated identity of the peer. + Identity peer_identity = 4; + + // The local identity used in the handshake. + Identity local_identity = 5; + + // Indicate whether the handshaker service client should keep the channel + // between the handshaker service open, e.g., in order to handle + // post-handshake messages in the future. + bool keep_channel_open = 6; + + // The RPC protocol versions supported by the peer. + RpcProtocolVersions peer_rpc_versions = 7; +} + +message HandshakerStatus { + // The status code. This could be the gRPC status code. + uint32 code = 1; + + // The status details. + string details = 2; +} + +message HandshakerResp { + // Frames to be given to the peer for the NextHandshakeMessageReq. May be + // empty if no out_frames have to be sent to the peer or if in_bytes in the + // HandshakerReq are incomplete. All the non-empty out frames must be sent to + // the peer even if the handshaker status is not OK as these frames may + // contain the alert frames. + bytes out_frames = 1; + + // Number of bytes in the in_bytes consumed by the handshaker. It is possible + // that part of in_bytes in HandshakerReq was unrelated to the handshake + // process. + uint32 bytes_consumed = 2; + + // This is set iff the handshake was successful. out_frames may still be set + // to frames that needs to be forwarded to the peer. + HandshakerResult result = 3; + + // Status of the handshaker. + HandshakerStatus status = 4; +} + +service HandshakerService { + // Handshaker service accepts a stream of handshaker request, returning a + // stream of handshaker response. Client is expected to send exactly one + // message with either client_start or server_start followed by one or more + // messages with next. Each time client sends a request, the handshaker + // service expects to respond. Client does not have to wait for service's + // response before sending next request. + rpc DoHandshake(stream HandshakerReq) + returns (stream HandshakerResp) { + } +} diff --git a/test/core/tsi/alts/fake_handshaker/transport_security_common.proto b/test/core/tsi/alts/fake_handshaker/transport_security_common.proto new file mode 100644 index 00000000000..d0f861e6446 --- /dev/null +++ b/test/core/tsi/alts/fake_handshaker/transport_security_common.proto @@ -0,0 +1,40 @@ +// Copyright 2018 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. + +syntax = "proto3"; + +package grpc.gcp; + +option java_package = "io.grpc.alts.internal"; + +// The security level of the created channel. The list is sorted in increasing +// level of security. This order must always be maintained. +enum SecurityLevel { + SECURITY_NONE = 0; + INTEGRITY_ONLY = 1; + INTEGRITY_AND_PRIVACY = 2; +} + +// Max and min supported RPC protocol versions. +message RpcProtocolVersions { + // RPC version contains a major version and a minor version. + message Version { + uint32 major = 1; + uint32 minor = 2; + } + // Maximum supported RPC version. + Version max_rpc_version = 1; + // Minimum supported RPC version. + Version min_rpc_version = 2; +} From d93f3e376b6e66efd9b95f1f9e8971cd9e3c133b Mon Sep 17 00:00:00 2001 From: kpayson64 Date: Wed, 11 Apr 2018 20:40:56 -0700 Subject: [PATCH 068/165] Unref uv timers/tcp handles --- src/core/lib/iomgr/tcp_uv.cc | 3 +++ src/core/lib/iomgr/timer_uv.cc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/core/lib/iomgr/tcp_uv.cc b/src/core/lib/iomgr/tcp_uv.cc index f20f8dcb740..8d0e4a5e79e 100644 --- a/src/core/lib/iomgr/tcp_uv.cc +++ b/src/core/lib/iomgr/tcp_uv.cc @@ -204,6 +204,9 @@ static grpc_error* uv_socket_init_helper(uv_socket_t* uv_socket, int domain) { uv_socket->write_buffers = nullptr; uv_socket->read_len = 0; uv_tcp_nodelay(uv_socket->handle, 1); + // Node uses a garbage collector to call destructors, so we don't + // want to hold the uv loop open with active gRPC objects. + uv_unref((uv_handle_t*)uv_socket->handle); uv_socket->pending_connection = false; uv_socket->accept_socket = nullptr; uv_socket->accept_error = GRPC_ERROR_NONE; diff --git a/src/core/lib/iomgr/timer_uv.cc b/src/core/lib/iomgr/timer_uv.cc index dadeb960b2b..8b7c82eb7de 100644 --- a/src/core/lib/iomgr/timer_uv.cc +++ b/src/core/lib/iomgr/timer_uv.cc @@ -52,6 +52,9 @@ static void timer_start(grpc_custom_timer* t) { uv_timer->data = t; t->timer = (void*)uv_timer; uv_timer_start(uv_timer, run_expired_timer, t->timeout_ms, 0); + // Node uses a garbage collector to call destructors, so we don't + // want to hold the uv loop open with active gRPC objects. + uv_unref((uv_handle_t*)uv_timer); } static void timer_stop(grpc_custom_timer* t) { From 9d00766d5a5e4a7266a35ff50ebdf084e1517173 Mon Sep 17 00:00:00 2001 From: kpayson64 Date: Fri, 13 Apr 2018 09:14:09 -0700 Subject: [PATCH 069/165] Make Node interop tests use c-core changes --- .../interoptest/grpc_interop_node/build_interop.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh index c16efc1d354..21fdd0b490f 100755 --- a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh @@ -17,12 +17,23 @@ set -e mkdir -p /var/local/git + git clone /var/local/jenkins/grpc-node /var/local/git/grpc-node # clone gRPC submodules, use data from locally cloned submodules where possible (cd /var/local/jenkins/grpc-node/ && git submodule foreach 'cd /var/local/git/grpc-node \ && git submodule update --init --recursive --reference /var/local/jenkins/grpc-node/${name} \ ${name}') +# Use the pending c-core changes if possible +if [ -d "/var/local/jenkins/grpc" ]; then + cd /var/local/jenkins/grpc + CURRENT_COMMIT="$(git rev-parse --verify HEAD)" + cd /var/local/git/grpc-node/packages/grpc-native-core/deps/grpc/ + git fetch --tags --progress https://github.com/grpc/grpc.git +refs/pull/*:refs/remotes/origin/pr/* + git checkout $CURRENT_COMMIT + git submodule update --init --recursive --reference /var/local/jenkins/grpc +fi + # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true From 106f73fb1043515041072d2bda2ff5684cabdb1c Mon Sep 17 00:00:00 2001 From: jiangtaoli2016 Date: Fri, 20 Apr 2018 13:56:27 -0700 Subject: [PATCH 070/165] Init OpenSSL callbacks if it has not been initialized. --- src/core/tsi/ssl_transport_security.cc | 33 ++++++++++++++++---------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/core/tsi/ssl_transport_security.cc b/src/core/tsi/ssl_transport_security.cc index 0ba6587678b..a2301be40a0 100644 --- a/src/core/tsi/ssl_transport_security.cc +++ b/src/core/tsi/ssl_transport_security.cc @@ -120,12 +120,14 @@ typedef struct { /* --- Library Initialization. ---*/ static gpr_once g_init_openssl_once = GPR_ONCE_INIT; -static gpr_mu* g_openssl_mutexes = nullptr; static int g_ssl_ctx_ex_factory_index = -1; +static const unsigned char kSslSessionIdContext[] = {'g', 'r', 'p', 'c'}; + +#if OPENSSL_VERSION_NUMBER < 0x10100000 +static gpr_mu* g_openssl_mutexes = nullptr; static void openssl_locking_cb(int mode, int type, const char* file, int line) GRPC_UNUSED; static unsigned long openssl_thread_id_cb(void) GRPC_UNUSED; -static const unsigned char kSslSessionIdContext[] = {'g', 'r', 'p', 'c'}; static void openssl_locking_cb(int mode, int type, const char* file, int line) { if (mode & CRYPTO_LOCK) { @@ -138,22 +140,27 @@ static void openssl_locking_cb(int mode, int type, const char* file, int line) { static unsigned long openssl_thread_id_cb(void) { return static_cast(gpr_thd_currentid()); } +#endif static void init_openssl(void) { - int i; - int num_locks; SSL_library_init(); SSL_load_error_strings(); OpenSSL_add_all_algorithms(); - num_locks = CRYPTO_num_locks(); - GPR_ASSERT(num_locks > 0); - g_openssl_mutexes = static_cast( - gpr_malloc(static_cast(num_locks) * sizeof(gpr_mu))); - for (i = 0; i < CRYPTO_num_locks(); i++) { - gpr_mu_init(&g_openssl_mutexes[i]); - } - CRYPTO_set_locking_callback(openssl_locking_cb); - CRYPTO_set_id_callback(openssl_thread_id_cb); +#if OPENSSL_VERSION_NUMBER < 0x10100000 + if (!CRYPTO_get_locking_callback()) { + int num_locks = CRYPTO_num_locks(); + GPR_ASSERT(num_locks > 0); + g_openssl_mutexes = static_cast( + gpr_malloc(static_cast(num_locks) * sizeof(gpr_mu))); + for (int i = 0; i < num_locks; i++) { + gpr_mu_init(&g_openssl_mutexes[i]); + } + CRYPTO_set_locking_callback(openssl_locking_cb); + CRYPTO_set_id_callback(openssl_thread_id_cb); + } else { + gpr_log(GPR_INFO, "OpenSSL callback has already been set."); + } +#endif g_ssl_ctx_ex_factory_index = SSL_CTX_get_ex_new_index(0, nullptr, nullptr, nullptr, nullptr); GPR_ASSERT(g_ssl_ctx_ex_factory_index != -1); From 2d05737e92ba45f7cf22b0e7ca03c78a24b7f8d1 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Mon, 23 Apr 2018 08:53:42 -0700 Subject: [PATCH 071/165] Fix the Python path for interop tests --- tools/interop_matrix/testcases/python__master | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/interop_matrix/testcases/python__master b/tools/interop_matrix/testcases/python__master index 71ba75e5d1f..467e41ff82f 100755 --- a/tools/interop_matrix/testcases/python__master +++ b/tools/interop_matrix/testcases/python__master @@ -1,20 +1,20 @@ #!/bin/bash echo "Testing ${docker_image:=grpc_interop_python:797ca293-94e8-48d4-92e9-a4d52fcfcca9}" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server\"" From 69c12357808756e48dd4d36aaef196ab8f2c5161 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Mon, 23 Apr 2018 09:20:18 -0700 Subject: [PATCH 072/165] Revert "Add fake ALTS handshaker server (bazel only)" --- test/core/tsi/alts/fake_handshaker/BUILD | 47 --- .../fake_handshaker/fake_handshaker_server.cc | 268 ------------------ .../tsi/alts/fake_handshaker/handshaker.proto | 224 --------------- .../transport_security_common.proto | 40 --- 4 files changed, 579 deletions(-) delete mode 100644 test/core/tsi/alts/fake_handshaker/BUILD delete mode 100644 test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc delete mode 100644 test/core/tsi/alts/fake_handshaker/handshaker.proto delete mode 100644 test/core/tsi/alts/fake_handshaker/transport_security_common.proto diff --git a/test/core/tsi/alts/fake_handshaker/BUILD b/test/core/tsi/alts/fake_handshaker/BUILD deleted file mode 100644 index 90e0d00209c..00000000000 --- a/test/core/tsi/alts/fake_handshaker/BUILD +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2018 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. - -licenses(["notice"]) # Apache v2 - -load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_cc_binary", "grpc_package") - -grpc_package(name = "test/core/tsi/alts/fake_handshaker", visibility = "public") - -grpc_proto_library( - name = "transport_security_common_proto", - srcs = ["transport_security_common.proto"], - has_services = False, -) - -grpc_proto_library( - name = "handshaker_proto", - srcs = ["handshaker.proto"], - has_services = True, - deps = [ - ":transport_security_common_proto", - ], -) - -grpc_cc_binary( - name = "fake_handshaker_server", - testonly = True, - srcs = ["fake_handshaker_server.cc"], - language = "C++", - deps = [ - ":handshaker_proto", - ":transport_security_common_proto", - "//:grpc++", - "//test/cpp/util:test_config", - ], -) diff --git a/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc b/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc deleted file mode 100644 index ca24ea4fb3c..00000000000 --- a/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc +++ /dev/null @@ -1,268 +0,0 @@ -/* - * - * Copyright 2018 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 -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "test/core/tsi/alts/fake_handshaker/handshaker.grpc.pb.h" -#include "test/core/tsi/alts/fake_handshaker/handshaker.pb.h" -#include "test/core/tsi/alts/fake_handshaker/transport_security_common.pb.h" -#include "test/cpp/util/test_config.h" - -DEFINE_int32(handshaker_port, 55056, - "TCP port on which the fake handshaker server listens to."); - -// Fake handshake messages. -constexpr char kClientInitFrame[] = "ClientInit"; -constexpr char kServerFrame[] = "ServerInitAndFinished"; -constexpr char kClientFinishFrame[] = "ClientFinished"; -// Error messages. -constexpr char kInvalidFrameError[] = "Invalid input frame."; -constexpr char kWrongStateError[] = "Wrong handshake state."; - -namespace grpc { -namespace gcp { - -// FakeHandshakeService implements a fake handshaker service using a fake key -// exchange protocol. The fake key exchange protocol is a 3-message protocol: -// - Client first sends ClientInit message to Server. -// - Server then sends ServerInitAndFinished message back to Client. -// - Client finally sends ClientFinished message to Server. -// This fake handshaker service is intended for ALTS integration testing without -// relying on real ALTS handshaker service inside GCE. -// It is thread-safe. -class FakeHandshakerService : public HandshakerService::Service { - public: - Status DoHandshake( - ServerContext* server_context, - ServerReaderWriter* stream) override { - Status status; - HandshakerContext context; - HandshakerReq request; - HandshakerResp response; - gpr_log(GPR_DEBUG, "Start a new handshake."); - while (stream->Read(&request)) { - status = ProcessRequest(&context, request, &response); - if (!status.ok()) return WriteErrorResponse(stream, status); - stream->Write(response); - if (context.state == COMPLETED) return Status::OK; - request.Clear(); - } - return Status::OK; - } - - private: - // HandshakeState is used by fake handshaker server to keep track of client's - // handshake status. In the beginning of a handshake, the state is INITIAL. - // If start_client or start_server request is called, the state becomes at - // least STARTED. When the handshaker server produces the first fame, the - // state becomes SENT. After the handshaker server processes the final frame - // from the peer, the state becomes COMPLETED. - enum HandshakeState { INITIAL, STARTED, SENT, COMPLETED }; - - struct HandshakerContext { - bool is_client = true; - HandshakeState state = INITIAL; - }; - - Status ProcessRequest(HandshakerContext* context, - const HandshakerReq& request, - HandshakerResp* response) { - GPR_ASSERT(context != nullptr && response != nullptr); - response->Clear(); - if (request.has_client_start()) { - gpr_log(GPR_DEBUG, "Process client start request."); - return ProcessClientStart(context, request.client_start(), response); - } else if (request.has_server_start()) { - gpr_log(GPR_DEBUG, "Process server start request."); - return ProcessServerStart(context, request.server_start(), response); - } else if (request.has_next()) { - gpr_log(GPR_DEBUG, "Process next request."); - return ProcessNext(context, request.next(), response); - } - return Status(StatusCode::INVALID_ARGUMENT, "Request is empty."); - } - - Status ProcessClientStart(HandshakerContext* context, - const StartClientHandshakeReq& request, - HandshakerResp* response) { - GPR_ASSERT(context != nullptr && response != nullptr); - // Checks request. - if (context->state != INITIAL) { - return Status(StatusCode::FAILED_PRECONDITION, kWrongStateError); - } - if (request.application_protocols_size() == 0) { - return Status(StatusCode::INVALID_ARGUMENT, - "At least one application protocol needed."); - } - if (request.record_protocols_size() == 0) { - return Status(StatusCode::INVALID_ARGUMENT, - "At least one record protocol needed."); - } - // Sets response. - response->set_out_frames(kClientInitFrame); - response->set_bytes_consumed(0); - response->mutable_status()->set_code(StatusCode::OK); - // Updates handshaker context. - context->is_client = true; - context->state = SENT; - return Status::OK; - } - - Status ProcessServerStart(HandshakerContext* context, - const StartServerHandshakeReq& request, - HandshakerResp* response) { - GPR_ASSERT(context != nullptr && response != nullptr); - // Checks request. - if (context->state != INITIAL) { - return Status(StatusCode::FAILED_PRECONDITION, kWrongStateError); - } - if (request.application_protocols_size() == 0) { - return Status(StatusCode::INVALID_ARGUMENT, - "At least one application protocol needed."); - } - if (request.handshake_parameters().size() == 0) { - return Status(StatusCode::INVALID_ARGUMENT, - "At least one set of handshake parameters needed."); - } - // Sets response. - if (request.in_bytes().empty()) { - // start_server request does not have in_bytes. - response->set_bytes_consumed(0); - context->state = STARTED; - } else { - // start_server request has in_bytes. - if (request.in_bytes() == kClientInitFrame) { - response->set_out_frames(kServerFrame); - response->set_bytes_consumed(strlen(kClientInitFrame)); - context->state = SENT; - } else { - return Status(StatusCode::UNKNOWN, kInvalidFrameError); - } - } - response->mutable_status()->set_code(StatusCode::OK); - context->is_client = false; - return Status::OK; - } - - Status ProcessNext(HandshakerContext* context, - const NextHandshakeMessageReq& request, - HandshakerResp* response) { - GPR_ASSERT(context != nullptr && response != nullptr); - if (context->is_client) { - // Processes next request on client side. - if (context->state != SENT) { - return Status(StatusCode::FAILED_PRECONDITION, kWrongStateError); - } - if (request.in_bytes() != kServerFrame) { - return Status(StatusCode::UNKNOWN, kInvalidFrameError); - } - response->set_out_frames(kClientFinishFrame); - response->set_bytes_consumed(strlen(kServerFrame)); - context->state = COMPLETED; - } else { - // Processes next request on server side. - HandshakeState current_state = context->state; - if (current_state == STARTED) { - if (request.in_bytes() != kClientInitFrame) { - return Status(StatusCode::UNKNOWN, kInvalidFrameError); - } - response->set_out_frames(kServerFrame); - response->set_bytes_consumed(strlen(kClientInitFrame)); - context->state = SENT; - } else if (current_state == SENT) { - // Client finish frame may be sent along with the first payload from the - // client, handshaker only consumes the client finish frame. - if (request.in_bytes().substr(0, strlen(kClientFinishFrame)) != - kClientFinishFrame) { - return Status(StatusCode::UNKNOWN, kInvalidFrameError); - } - response->set_bytes_consumed(strlen(kClientFinishFrame)); - context->state = COMPLETED; - } else { - return Status(StatusCode::FAILED_PRECONDITION, kWrongStateError); - } - } - // At this point, processing next request succeeded. - response->mutable_status()->set_code(StatusCode::OK); - if (context->state == COMPLETED) { - *response->mutable_result() = GetHandshakerResult(); - } - return Status::OK; - } - - Status WriteErrorResponse( - ServerReaderWriter* stream, - const Status& status) { - GPR_ASSERT(!status.ok()); - HandshakerResp response; - response.mutable_status()->set_code(status.error_code()); - response.mutable_status()->set_details(status.error_message()); - stream->Write(response); - return status; - } - - HandshakerResult GetHandshakerResult() { - HandshakerResult result; - result.set_application_protocol("grpc"); - result.set_record_protocol("ALTSRP_GCM_AES128_REKEY"); - result.mutable_peer_identity()->set_service_account("peer_identity"); - result.mutable_local_identity()->set_service_account("local_identity"); - string key(1024, '\0'); - result.set_key_data(key); - result.mutable_peer_rpc_versions()->mutable_max_rpc_version()->set_major(2); - result.mutable_peer_rpc_versions()->mutable_max_rpc_version()->set_minor(1); - result.mutable_peer_rpc_versions()->mutable_min_rpc_version()->set_major(2); - result.mutable_peer_rpc_versions()->mutable_min_rpc_version()->set_minor(1); - return result; - } -}; - -} // namespace gcp -} // namespace grpc - -void RunServer() { - GPR_ASSERT(FLAGS_handshaker_port != 0); - std::ostringstream server_address; - server_address << "[::1]:" << FLAGS_handshaker_port; - grpc::gcp::FakeHandshakerService service; - grpc::ServerBuilder builder; - builder.AddListeningPort(server_address.str(), - grpc::InsecureServerCredentials()); - builder.RegisterService(&service); - std::unique_ptr server(builder.BuildAndStart()); - gpr_log(GPR_INFO, "Fake handshaker server listening on %s", - server_address.str().c_str()); - server->Wait(); -} - -int main(int argc, char** argv) { - grpc::testing::InitTest(&argc, &argv, true); - RunServer(); - return 0; -} diff --git a/test/core/tsi/alts/fake_handshaker/handshaker.proto b/test/core/tsi/alts/fake_handshaker/handshaker.proto deleted file mode 100644 index 8af9abfbf56..00000000000 --- a/test/core/tsi/alts/fake_handshaker/handshaker.proto +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright 2018 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. - -syntax = "proto3"; - -import "test/core/tsi/alts/fake_handshaker/transport_security_common.proto"; - -package grpc.gcp; - -option java_package = "io.grpc.alts.internal"; - -enum HandshakeProtocol { - // Default value. - HANDSHAKE_PROTOCOL_UNSPECIFIED = 0; - - // TLS handshake protocol. - TLS = 1; - - // Application Layer Transport Security handshake protocol. - ALTS = 2; -} - -enum NetworkProtocol { - NETWORK_PROTOCOL_UNSPECIFIED = 0; - TCP = 1; - UDP = 2; -} - -message Endpoint { - // IP address. It should contain an IPv4 or IPv6 string literal, e.g. - // "192.168.0.1" or "2001:db8::1". - string ip_address = 1; - - // Port number. - int32 port = 2; - - // Network protocol (e.g., TCP, UDP) associated with this endpoint. - NetworkProtocol protocol = 3; -} - -message Identity { - oneof identity_oneof { - // Service account of a connection endpoint. - string service_account = 1; - - // Hostname of a connection endpoint. - string hostname = 2; - } -} - -message StartClientHandshakeReq { - // Handshake security protocol requested by the client. - HandshakeProtocol handshake_security_protocol = 1; - - // The application protocols supported by the client, e.g., "h2" (for http2), - // "grpc". - repeated string application_protocols = 2; - - // The record protocols supported by the client, e.g., - // "ALTSRP_GCM_AES128". - repeated string record_protocols = 3; - - // (Optional) Describes which server identities are acceptable by the client. - // If target identities are provided and none of them matches the peer - // identity of the server, handshake will fail. - repeated Identity target_identities = 4; - - // (Optional) Application may specify a local identity. Otherwise, the - // handshaker chooses a default local identity. - Identity local_identity = 5; - - // (Optional) Local endpoint information of the connection to the server, - // such as local IP address, port number, and network protocol. - Endpoint local_endpoint = 6; - - // (Optional) Endpoint information of the remote server, such as IP address, - // port number, and network protocol. - Endpoint remote_endpoint = 7; - - // (Optional) If target name is provided, a secure naming check is performed - // to verify that the peer authenticated identity is indeed authorized to run - // the target name. - string target_name = 8; - - // (Optional) RPC protocol versions supported by the client. - RpcProtocolVersions rpc_versions = 9; -} - -message ServerHandshakeParameters { - // The record protocols supported by the server, e.g., - // "ALTSRP_GCM_AES128". - repeated string record_protocols = 1; - - // (Optional) A list of local identities supported by the server, if - // specified. Otherwise, the handshaker chooses a default local identity. - repeated Identity local_identities = 2; -} - -message StartServerHandshakeReq { - // The application protocols supported by the server, e.g., "h2" (for http2), - // "grpc". - repeated string application_protocols = 1; - - // Handshake parameters (record protocols and local identities supported by - // the server) mapped by the handshake protocol. Each handshake security - // protocol (e.g., TLS or ALTS) has its own set of record protocols and local - // identities. Since protobuf does not support enum as key to the map, the key - // to handshake_parameters is the integer value of HandshakeProtocol enum. - map handshake_parameters = 2; - - // Bytes in out_frames returned from the peer's HandshakerResp. It is possible - // that the peer's out_frames are split into multiple HandshakReq messages. - bytes in_bytes = 3; - - // (Optional) Local endpoint information of the connection to the client, - // such as local IP address, port number, and network protocol. - Endpoint local_endpoint = 4; - - // (Optional) Endpoint information of the remote client, such as IP address, - // port number, and network protocol. - Endpoint remote_endpoint = 5; - - // (Optional) RPC protocol versions supported by the server. - RpcProtocolVersions rpc_versions = 6; -} - -message NextHandshakeMessageReq { - // Bytes in out_frames returned from the peer's HandshakerResp. It is possible - // that the peer's out_frames are split into multiple NextHandshakerMessageReq - // messages. - bytes in_bytes = 1; -} - -message HandshakerReq { - oneof req_oneof { - // The start client handshake request message. - StartClientHandshakeReq client_start = 1; - - // The start server handshake request message. - StartServerHandshakeReq server_start = 2; - - // The next handshake request message. - NextHandshakeMessageReq next = 3; - } -} - -message HandshakerResult { - // The application protocol negotiated for this connection. - string application_protocol = 1; - - // The record protocol negotiated for this connection. - string record_protocol = 2; - - // Cryptographic key data. The key data may be more than the key length - // required for the record protocol, thus the client of the handshaker - // service needs to truncate the key data into the right key length. - bytes key_data = 3; - - // The authenticated identity of the peer. - Identity peer_identity = 4; - - // The local identity used in the handshake. - Identity local_identity = 5; - - // Indicate whether the handshaker service client should keep the channel - // between the handshaker service open, e.g., in order to handle - // post-handshake messages in the future. - bool keep_channel_open = 6; - - // The RPC protocol versions supported by the peer. - RpcProtocolVersions peer_rpc_versions = 7; -} - -message HandshakerStatus { - // The status code. This could be the gRPC status code. - uint32 code = 1; - - // The status details. - string details = 2; -} - -message HandshakerResp { - // Frames to be given to the peer for the NextHandshakeMessageReq. May be - // empty if no out_frames have to be sent to the peer or if in_bytes in the - // HandshakerReq are incomplete. All the non-empty out frames must be sent to - // the peer even if the handshaker status is not OK as these frames may - // contain the alert frames. - bytes out_frames = 1; - - // Number of bytes in the in_bytes consumed by the handshaker. It is possible - // that part of in_bytes in HandshakerReq was unrelated to the handshake - // process. - uint32 bytes_consumed = 2; - - // This is set iff the handshake was successful. out_frames may still be set - // to frames that needs to be forwarded to the peer. - HandshakerResult result = 3; - - // Status of the handshaker. - HandshakerStatus status = 4; -} - -service HandshakerService { - // Handshaker service accepts a stream of handshaker request, returning a - // stream of handshaker response. Client is expected to send exactly one - // message with either client_start or server_start followed by one or more - // messages with next. Each time client sends a request, the handshaker - // service expects to respond. Client does not have to wait for service's - // response before sending next request. - rpc DoHandshake(stream HandshakerReq) - returns (stream HandshakerResp) { - } -} diff --git a/test/core/tsi/alts/fake_handshaker/transport_security_common.proto b/test/core/tsi/alts/fake_handshaker/transport_security_common.proto deleted file mode 100644 index d0f861e6446..00000000000 --- a/test/core/tsi/alts/fake_handshaker/transport_security_common.proto +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2018 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. - -syntax = "proto3"; - -package grpc.gcp; - -option java_package = "io.grpc.alts.internal"; - -// The security level of the created channel. The list is sorted in increasing -// level of security. This order must always be maintained. -enum SecurityLevel { - SECURITY_NONE = 0; - INTEGRITY_ONLY = 1; - INTEGRITY_AND_PRIVACY = 2; -} - -// Max and min supported RPC protocol versions. -message RpcProtocolVersions { - // RPC version contains a major version and a minor version. - message Version { - uint32 major = 1; - uint32 minor = 2; - } - // Maximum supported RPC version. - Version max_rpc_version = 1; - // Minimum supported RPC version. - Version min_rpc_version = 2; -} From 1b7d6af8ca3bf34afe5716aaaf9a3161a1c51a4b Mon Sep 17 00:00:00 2001 From: Jiangtao Li Date: Mon, 23 Apr 2018 12:24:37 -0700 Subject: [PATCH 073/165] Revert "Revert "Add fake ALTS handshaker server (bazel only)"" --- test/core/tsi/alts/fake_handshaker/BUILD | 47 +++ .../fake_handshaker/fake_handshaker_server.cc | 268 ++++++++++++++++++ .../tsi/alts/fake_handshaker/handshaker.proto | 224 +++++++++++++++ .../transport_security_common.proto | 40 +++ 4 files changed, 579 insertions(+) create mode 100644 test/core/tsi/alts/fake_handshaker/BUILD create mode 100644 test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc create mode 100644 test/core/tsi/alts/fake_handshaker/handshaker.proto create mode 100644 test/core/tsi/alts/fake_handshaker/transport_security_common.proto diff --git a/test/core/tsi/alts/fake_handshaker/BUILD b/test/core/tsi/alts/fake_handshaker/BUILD new file mode 100644 index 00000000000..90e0d00209c --- /dev/null +++ b/test/core/tsi/alts/fake_handshaker/BUILD @@ -0,0 +1,47 @@ +# Copyright 2018 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. + +licenses(["notice"]) # Apache v2 + +load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_cc_binary", "grpc_package") + +grpc_package(name = "test/core/tsi/alts/fake_handshaker", visibility = "public") + +grpc_proto_library( + name = "transport_security_common_proto", + srcs = ["transport_security_common.proto"], + has_services = False, +) + +grpc_proto_library( + name = "handshaker_proto", + srcs = ["handshaker.proto"], + has_services = True, + deps = [ + ":transport_security_common_proto", + ], +) + +grpc_cc_binary( + name = "fake_handshaker_server", + testonly = True, + srcs = ["fake_handshaker_server.cc"], + language = "C++", + deps = [ + ":handshaker_proto", + ":transport_security_common_proto", + "//:grpc++", + "//test/cpp/util:test_config", + ], +) diff --git a/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc b/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc new file mode 100644 index 00000000000..ca24ea4fb3c --- /dev/null +++ b/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc @@ -0,0 +1,268 @@ +/* + * + * Copyright 2018 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 +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "test/core/tsi/alts/fake_handshaker/handshaker.grpc.pb.h" +#include "test/core/tsi/alts/fake_handshaker/handshaker.pb.h" +#include "test/core/tsi/alts/fake_handshaker/transport_security_common.pb.h" +#include "test/cpp/util/test_config.h" + +DEFINE_int32(handshaker_port, 55056, + "TCP port on which the fake handshaker server listens to."); + +// Fake handshake messages. +constexpr char kClientInitFrame[] = "ClientInit"; +constexpr char kServerFrame[] = "ServerInitAndFinished"; +constexpr char kClientFinishFrame[] = "ClientFinished"; +// Error messages. +constexpr char kInvalidFrameError[] = "Invalid input frame."; +constexpr char kWrongStateError[] = "Wrong handshake state."; + +namespace grpc { +namespace gcp { + +// FakeHandshakeService implements a fake handshaker service using a fake key +// exchange protocol. The fake key exchange protocol is a 3-message protocol: +// - Client first sends ClientInit message to Server. +// - Server then sends ServerInitAndFinished message back to Client. +// - Client finally sends ClientFinished message to Server. +// This fake handshaker service is intended for ALTS integration testing without +// relying on real ALTS handshaker service inside GCE. +// It is thread-safe. +class FakeHandshakerService : public HandshakerService::Service { + public: + Status DoHandshake( + ServerContext* server_context, + ServerReaderWriter* stream) override { + Status status; + HandshakerContext context; + HandshakerReq request; + HandshakerResp response; + gpr_log(GPR_DEBUG, "Start a new handshake."); + while (stream->Read(&request)) { + status = ProcessRequest(&context, request, &response); + if (!status.ok()) return WriteErrorResponse(stream, status); + stream->Write(response); + if (context.state == COMPLETED) return Status::OK; + request.Clear(); + } + return Status::OK; + } + + private: + // HandshakeState is used by fake handshaker server to keep track of client's + // handshake status. In the beginning of a handshake, the state is INITIAL. + // If start_client or start_server request is called, the state becomes at + // least STARTED. When the handshaker server produces the first fame, the + // state becomes SENT. After the handshaker server processes the final frame + // from the peer, the state becomes COMPLETED. + enum HandshakeState { INITIAL, STARTED, SENT, COMPLETED }; + + struct HandshakerContext { + bool is_client = true; + HandshakeState state = INITIAL; + }; + + Status ProcessRequest(HandshakerContext* context, + const HandshakerReq& request, + HandshakerResp* response) { + GPR_ASSERT(context != nullptr && response != nullptr); + response->Clear(); + if (request.has_client_start()) { + gpr_log(GPR_DEBUG, "Process client start request."); + return ProcessClientStart(context, request.client_start(), response); + } else if (request.has_server_start()) { + gpr_log(GPR_DEBUG, "Process server start request."); + return ProcessServerStart(context, request.server_start(), response); + } else if (request.has_next()) { + gpr_log(GPR_DEBUG, "Process next request."); + return ProcessNext(context, request.next(), response); + } + return Status(StatusCode::INVALID_ARGUMENT, "Request is empty."); + } + + Status ProcessClientStart(HandshakerContext* context, + const StartClientHandshakeReq& request, + HandshakerResp* response) { + GPR_ASSERT(context != nullptr && response != nullptr); + // Checks request. + if (context->state != INITIAL) { + return Status(StatusCode::FAILED_PRECONDITION, kWrongStateError); + } + if (request.application_protocols_size() == 0) { + return Status(StatusCode::INVALID_ARGUMENT, + "At least one application protocol needed."); + } + if (request.record_protocols_size() == 0) { + return Status(StatusCode::INVALID_ARGUMENT, + "At least one record protocol needed."); + } + // Sets response. + response->set_out_frames(kClientInitFrame); + response->set_bytes_consumed(0); + response->mutable_status()->set_code(StatusCode::OK); + // Updates handshaker context. + context->is_client = true; + context->state = SENT; + return Status::OK; + } + + Status ProcessServerStart(HandshakerContext* context, + const StartServerHandshakeReq& request, + HandshakerResp* response) { + GPR_ASSERT(context != nullptr && response != nullptr); + // Checks request. + if (context->state != INITIAL) { + return Status(StatusCode::FAILED_PRECONDITION, kWrongStateError); + } + if (request.application_protocols_size() == 0) { + return Status(StatusCode::INVALID_ARGUMENT, + "At least one application protocol needed."); + } + if (request.handshake_parameters().size() == 0) { + return Status(StatusCode::INVALID_ARGUMENT, + "At least one set of handshake parameters needed."); + } + // Sets response. + if (request.in_bytes().empty()) { + // start_server request does not have in_bytes. + response->set_bytes_consumed(0); + context->state = STARTED; + } else { + // start_server request has in_bytes. + if (request.in_bytes() == kClientInitFrame) { + response->set_out_frames(kServerFrame); + response->set_bytes_consumed(strlen(kClientInitFrame)); + context->state = SENT; + } else { + return Status(StatusCode::UNKNOWN, kInvalidFrameError); + } + } + response->mutable_status()->set_code(StatusCode::OK); + context->is_client = false; + return Status::OK; + } + + Status ProcessNext(HandshakerContext* context, + const NextHandshakeMessageReq& request, + HandshakerResp* response) { + GPR_ASSERT(context != nullptr && response != nullptr); + if (context->is_client) { + // Processes next request on client side. + if (context->state != SENT) { + return Status(StatusCode::FAILED_PRECONDITION, kWrongStateError); + } + if (request.in_bytes() != kServerFrame) { + return Status(StatusCode::UNKNOWN, kInvalidFrameError); + } + response->set_out_frames(kClientFinishFrame); + response->set_bytes_consumed(strlen(kServerFrame)); + context->state = COMPLETED; + } else { + // Processes next request on server side. + HandshakeState current_state = context->state; + if (current_state == STARTED) { + if (request.in_bytes() != kClientInitFrame) { + return Status(StatusCode::UNKNOWN, kInvalidFrameError); + } + response->set_out_frames(kServerFrame); + response->set_bytes_consumed(strlen(kClientInitFrame)); + context->state = SENT; + } else if (current_state == SENT) { + // Client finish frame may be sent along with the first payload from the + // client, handshaker only consumes the client finish frame. + if (request.in_bytes().substr(0, strlen(kClientFinishFrame)) != + kClientFinishFrame) { + return Status(StatusCode::UNKNOWN, kInvalidFrameError); + } + response->set_bytes_consumed(strlen(kClientFinishFrame)); + context->state = COMPLETED; + } else { + return Status(StatusCode::FAILED_PRECONDITION, kWrongStateError); + } + } + // At this point, processing next request succeeded. + response->mutable_status()->set_code(StatusCode::OK); + if (context->state == COMPLETED) { + *response->mutable_result() = GetHandshakerResult(); + } + return Status::OK; + } + + Status WriteErrorResponse( + ServerReaderWriter* stream, + const Status& status) { + GPR_ASSERT(!status.ok()); + HandshakerResp response; + response.mutable_status()->set_code(status.error_code()); + response.mutable_status()->set_details(status.error_message()); + stream->Write(response); + return status; + } + + HandshakerResult GetHandshakerResult() { + HandshakerResult result; + result.set_application_protocol("grpc"); + result.set_record_protocol("ALTSRP_GCM_AES128_REKEY"); + result.mutable_peer_identity()->set_service_account("peer_identity"); + result.mutable_local_identity()->set_service_account("local_identity"); + string key(1024, '\0'); + result.set_key_data(key); + result.mutable_peer_rpc_versions()->mutable_max_rpc_version()->set_major(2); + result.mutable_peer_rpc_versions()->mutable_max_rpc_version()->set_minor(1); + result.mutable_peer_rpc_versions()->mutable_min_rpc_version()->set_major(2); + result.mutable_peer_rpc_versions()->mutable_min_rpc_version()->set_minor(1); + return result; + } +}; + +} // namespace gcp +} // namespace grpc + +void RunServer() { + GPR_ASSERT(FLAGS_handshaker_port != 0); + std::ostringstream server_address; + server_address << "[::1]:" << FLAGS_handshaker_port; + grpc::gcp::FakeHandshakerService service; + grpc::ServerBuilder builder; + builder.AddListeningPort(server_address.str(), + grpc::InsecureServerCredentials()); + builder.RegisterService(&service); + std::unique_ptr server(builder.BuildAndStart()); + gpr_log(GPR_INFO, "Fake handshaker server listening on %s", + server_address.str().c_str()); + server->Wait(); +} + +int main(int argc, char** argv) { + grpc::testing::InitTest(&argc, &argv, true); + RunServer(); + return 0; +} diff --git a/test/core/tsi/alts/fake_handshaker/handshaker.proto b/test/core/tsi/alts/fake_handshaker/handshaker.proto new file mode 100644 index 00000000000..8af9abfbf56 --- /dev/null +++ b/test/core/tsi/alts/fake_handshaker/handshaker.proto @@ -0,0 +1,224 @@ +// Copyright 2018 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. + +syntax = "proto3"; + +import "test/core/tsi/alts/fake_handshaker/transport_security_common.proto"; + +package grpc.gcp; + +option java_package = "io.grpc.alts.internal"; + +enum HandshakeProtocol { + // Default value. + HANDSHAKE_PROTOCOL_UNSPECIFIED = 0; + + // TLS handshake protocol. + TLS = 1; + + // Application Layer Transport Security handshake protocol. + ALTS = 2; +} + +enum NetworkProtocol { + NETWORK_PROTOCOL_UNSPECIFIED = 0; + TCP = 1; + UDP = 2; +} + +message Endpoint { + // IP address. It should contain an IPv4 or IPv6 string literal, e.g. + // "192.168.0.1" or "2001:db8::1". + string ip_address = 1; + + // Port number. + int32 port = 2; + + // Network protocol (e.g., TCP, UDP) associated with this endpoint. + NetworkProtocol protocol = 3; +} + +message Identity { + oneof identity_oneof { + // Service account of a connection endpoint. + string service_account = 1; + + // Hostname of a connection endpoint. + string hostname = 2; + } +} + +message StartClientHandshakeReq { + // Handshake security protocol requested by the client. + HandshakeProtocol handshake_security_protocol = 1; + + // The application protocols supported by the client, e.g., "h2" (for http2), + // "grpc". + repeated string application_protocols = 2; + + // The record protocols supported by the client, e.g., + // "ALTSRP_GCM_AES128". + repeated string record_protocols = 3; + + // (Optional) Describes which server identities are acceptable by the client. + // If target identities are provided and none of them matches the peer + // identity of the server, handshake will fail. + repeated Identity target_identities = 4; + + // (Optional) Application may specify a local identity. Otherwise, the + // handshaker chooses a default local identity. + Identity local_identity = 5; + + // (Optional) Local endpoint information of the connection to the server, + // such as local IP address, port number, and network protocol. + Endpoint local_endpoint = 6; + + // (Optional) Endpoint information of the remote server, such as IP address, + // port number, and network protocol. + Endpoint remote_endpoint = 7; + + // (Optional) If target name is provided, a secure naming check is performed + // to verify that the peer authenticated identity is indeed authorized to run + // the target name. + string target_name = 8; + + // (Optional) RPC protocol versions supported by the client. + RpcProtocolVersions rpc_versions = 9; +} + +message ServerHandshakeParameters { + // The record protocols supported by the server, e.g., + // "ALTSRP_GCM_AES128". + repeated string record_protocols = 1; + + // (Optional) A list of local identities supported by the server, if + // specified. Otherwise, the handshaker chooses a default local identity. + repeated Identity local_identities = 2; +} + +message StartServerHandshakeReq { + // The application protocols supported by the server, e.g., "h2" (for http2), + // "grpc". + repeated string application_protocols = 1; + + // Handshake parameters (record protocols and local identities supported by + // the server) mapped by the handshake protocol. Each handshake security + // protocol (e.g., TLS or ALTS) has its own set of record protocols and local + // identities. Since protobuf does not support enum as key to the map, the key + // to handshake_parameters is the integer value of HandshakeProtocol enum. + map handshake_parameters = 2; + + // Bytes in out_frames returned from the peer's HandshakerResp. It is possible + // that the peer's out_frames are split into multiple HandshakReq messages. + bytes in_bytes = 3; + + // (Optional) Local endpoint information of the connection to the client, + // such as local IP address, port number, and network protocol. + Endpoint local_endpoint = 4; + + // (Optional) Endpoint information of the remote client, such as IP address, + // port number, and network protocol. + Endpoint remote_endpoint = 5; + + // (Optional) RPC protocol versions supported by the server. + RpcProtocolVersions rpc_versions = 6; +} + +message NextHandshakeMessageReq { + // Bytes in out_frames returned from the peer's HandshakerResp. It is possible + // that the peer's out_frames are split into multiple NextHandshakerMessageReq + // messages. + bytes in_bytes = 1; +} + +message HandshakerReq { + oneof req_oneof { + // The start client handshake request message. + StartClientHandshakeReq client_start = 1; + + // The start server handshake request message. + StartServerHandshakeReq server_start = 2; + + // The next handshake request message. + NextHandshakeMessageReq next = 3; + } +} + +message HandshakerResult { + // The application protocol negotiated for this connection. + string application_protocol = 1; + + // The record protocol negotiated for this connection. + string record_protocol = 2; + + // Cryptographic key data. The key data may be more than the key length + // required for the record protocol, thus the client of the handshaker + // service needs to truncate the key data into the right key length. + bytes key_data = 3; + + // The authenticated identity of the peer. + Identity peer_identity = 4; + + // The local identity used in the handshake. + Identity local_identity = 5; + + // Indicate whether the handshaker service client should keep the channel + // between the handshaker service open, e.g., in order to handle + // post-handshake messages in the future. + bool keep_channel_open = 6; + + // The RPC protocol versions supported by the peer. + RpcProtocolVersions peer_rpc_versions = 7; +} + +message HandshakerStatus { + // The status code. This could be the gRPC status code. + uint32 code = 1; + + // The status details. + string details = 2; +} + +message HandshakerResp { + // Frames to be given to the peer for the NextHandshakeMessageReq. May be + // empty if no out_frames have to be sent to the peer or if in_bytes in the + // HandshakerReq are incomplete. All the non-empty out frames must be sent to + // the peer even if the handshaker status is not OK as these frames may + // contain the alert frames. + bytes out_frames = 1; + + // Number of bytes in the in_bytes consumed by the handshaker. It is possible + // that part of in_bytes in HandshakerReq was unrelated to the handshake + // process. + uint32 bytes_consumed = 2; + + // This is set iff the handshake was successful. out_frames may still be set + // to frames that needs to be forwarded to the peer. + HandshakerResult result = 3; + + // Status of the handshaker. + HandshakerStatus status = 4; +} + +service HandshakerService { + // Handshaker service accepts a stream of handshaker request, returning a + // stream of handshaker response. Client is expected to send exactly one + // message with either client_start or server_start followed by one or more + // messages with next. Each time client sends a request, the handshaker + // service expects to respond. Client does not have to wait for service's + // response before sending next request. + rpc DoHandshake(stream HandshakerReq) + returns (stream HandshakerResp) { + } +} diff --git a/test/core/tsi/alts/fake_handshaker/transport_security_common.proto b/test/core/tsi/alts/fake_handshaker/transport_security_common.proto new file mode 100644 index 00000000000..d0f861e6446 --- /dev/null +++ b/test/core/tsi/alts/fake_handshaker/transport_security_common.proto @@ -0,0 +1,40 @@ +// Copyright 2018 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. + +syntax = "proto3"; + +package grpc.gcp; + +option java_package = "io.grpc.alts.internal"; + +// The security level of the created channel. The list is sorted in increasing +// level of security. This order must always be maintained. +enum SecurityLevel { + SECURITY_NONE = 0; + INTEGRITY_ONLY = 1; + INTEGRITY_AND_PRIVACY = 2; +} + +// Max and min supported RPC protocol versions. +message RpcProtocolVersions { + // RPC version contains a major version and a minor version. + message Version { + uint32 major = 1; + uint32 minor = 2; + } + // Maximum supported RPC version. + Version max_rpc_version = 1; + // Minimum supported RPC version. + Version min_rpc_version = 2; +} From 9c32619ab015d36d532460da4f260791b19a2044 Mon Sep 17 00:00:00 2001 From: jiangtaoli2016 Date: Mon, 23 Apr 2018 12:47:15 -0700 Subject: [PATCH 074/165] Fix BUILD to allow successful import --- test/core/tsi/alts/fake_handshaker/BUILD | 22 ++++++++++++++----- .../fake_handshaker/fake_handshaker_server.cc | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/test/core/tsi/alts/fake_handshaker/BUILD b/test/core/tsi/alts/fake_handshaker/BUILD index 90e0d00209c..a09a046d27b 100644 --- a/test/core/tsi/alts/fake_handshaker/BUILD +++ b/test/core/tsi/alts/fake_handshaker/BUILD @@ -14,7 +14,7 @@ licenses(["notice"]) # Apache v2 -load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_cc_binary", "grpc_package") +load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_cc_library", "grpc_cc_binary", "grpc_package") grpc_package(name = "test/core/tsi/alts/fake_handshaker", visibility = "public") @@ -29,19 +29,29 @@ grpc_proto_library( srcs = ["handshaker.proto"], has_services = True, deps = [ - ":transport_security_common_proto", + "transport_security_common_proto", ], ) -grpc_cc_binary( - name = "fake_handshaker_server", +grpc_cc_library( + name = "fake_handshaker_lib", testonly = True, srcs = ["fake_handshaker_server.cc"], language = "C++", deps = [ - ":handshaker_proto", - ":transport_security_common_proto", + "handshaker_proto", + "transport_security_common_proto", "//:grpc++", "//test/cpp/util:test_config", ], ) + +grpc_cc_binary( + name = "fake_handshaker_server", + testonly = True, + srcs = ["fake_handshaker_server.cc"], + language = "C++", + deps = [ + "fake_handshaker_lib", + ], +) diff --git a/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc b/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc index ca24ea4fb3c..f6a4791b492 100644 --- a/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc +++ b/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc @@ -146,7 +146,7 @@ class FakeHandshakerService : public HandshakerService::Service { return Status(StatusCode::INVALID_ARGUMENT, "At least one application protocol needed."); } - if (request.handshake_parameters().size() == 0) { + if (request.handshake_parameters().empty()) { return Status(StatusCode::INVALID_ARGUMENT, "At least one set of handshake parameters needed."); } From 3fb36a141067057ab283b2dc9bb3e5c364cabe4e Mon Sep 17 00:00:00 2001 From: dmaclach Date: Mon, 23 Apr 2018 15:14:21 -0700 Subject: [PATCH 075/165] Update License As far as I can tell, the license file here was completely wrong and was adding 300+ K of unnecessary bloat to every app that included grpc. --- third_party/address_sorting/LICENSE | 6075 --------------------------- 1 file changed, 6075 deletions(-) diff --git a/third_party/address_sorting/LICENSE b/third_party/address_sorting/LICENSE index db4b5a5941b..824d542db94 100644 --- a/third_party/address_sorting/LICENSE +++ b/third_party/address_sorting/LICENSE @@ -1,262 +1,3 @@ - Copyright (c) 2014, ARM Limited - All rights Reserved. - Copyright (c) 2014, Linaro Ltd. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the company nor the names of its contributors - may be used to endorse or promote products derived from this - software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - - Copyright (c) 2014, Linaro Limited - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Linaro nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - - Copyright (c) 1993 John Brezak - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - - Copyright (c) 2009-2013 The Linux Foundation. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of The Linux Foundation nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -==================================================== -Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - -Developed at SunPro, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. - -------------------------------------------------------------------- - -==================================================== -Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - -Developed at SunPro, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. -==================================================== - -Optimized by Bruce D. Evans. - -------------------------------------------------------------------- - -==================================================== -Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - -Developed at SunSoft, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. - -------------------------------------------------------------------- - -==================================================== -Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - -Developed at SunSoft, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. -==================================================== - -Optimized by Bruce D. Evans. - -------------------------------------------------------------------- - -==================================================== -Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. -Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans. - -Developed at SunSoft, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. - -------------------------------------------------------------------- - -==================================================== -Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. -Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans. - -Developed at SunSoft, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. -==================================================== - -Optimized by Bruce D. Evans. - -------------------------------------------------------------------- - -==================================================== -Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. -Copyright (c) 2009-2011, Bruce D. Evans, Steven G. Kargl, David Schultz. - -Developed at SunPro, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. -==================================================== - -The argument reduction and testing for exceptional cases was -written by Steven G. Kargl with input from Bruce D. Evans -and David A. Schultz. - -------------------------------------------------------------------- - -==================================================== -Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. - -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. - -------------------------------------------------------------------- - -==================================================== -Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. - -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. - -------------------------------------------------------------------- - -==================================================== -Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. -Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans. - -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. - -------------------------------------------------------------------- - -Based on the UCB version with the ID appearing below. -This is ANSIish only when "multibyte character == plain character". - -Copyright (c) 1989, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. All rights reserved. @@ -283,5819 +24,3 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") -Copyright (C) 1995-1999, 2001, 2003 Internet Software Consortium. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") -Copyright (C) 1997-2001 Internet Software Consortium. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (C) 2006 The Android Open Source Project - -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. - -------------------------------------------------------------------- - -Copyright (C) 2006 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2007 The Android Open Source Project - -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. - -------------------------------------------------------------------- - -Copyright (C) 2007 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2008 The Android Open Source Project - -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. - -------------------------------------------------------------------- - -Copyright (C) 2008 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2008 The Android Open Source Project -All rights reserved. -Copyright (c) 2013-2014, NVIDIA Corporation. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2009 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2010 The Android Open Source Project - -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. - -------------------------------------------------------------------- - -Copyright (C) 2010 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2010 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2010 The Android Open Source Project -Copyright (c) 2008 ARM Ltd -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the company may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Android adaptation and tweak by Jim Huang . - -------------------------------------------------------------------- - -Copyright (C) 2011 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2012 The Android Open Source Project - -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. - -------------------------------------------------------------------- - -Copyright (C) 2012 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2013 Pietro Cerutti - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2013 The Android Open Source Project - -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. - -------------------------------------------------------------------- - -Copyright (C) 2013 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2013 The Android Open Source Project -All rights reserved. -Copyright (c) 2013-2014 NVIDIA Corporation. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2013 The Android Open Source Project -Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2014 The Android Open Source Project - -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. - -------------------------------------------------------------------- - -Copyright (C) 2014 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2014 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2015 The Android Open Source Project - -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. - -------------------------------------------------------------------- - -Copyright (C) 2015 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2016 The Android Open Source Project - -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. - -------------------------------------------------------------------- - -Copyright (C) 2016 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2017 The Android Open Source Project - -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. - -------------------------------------------------------------------- - -Copyright (C) 2017 The Android Open Source Project -All rights reserved. - -Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (C) 2017 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1980, 1983, 1988, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - - -Portions Copyright (c) 1993 by Digital Equipment Corporation. - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies, and that -the name of Digital Equipment Corporation not be used in advertising or -publicity pertaining to distribution of the document or software without -specific, written prior permission. - -THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL -WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT -CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 1982, 1986, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1982, 1986, 1993 - The Regents of the University of California. All rights reserved. -(c) UNIX System Laboratories, Inc. -All or some portions of this file are derived from material licensed -to the University of California by American Telephone and Telegraph -Co. or Unix System Laboratories, Inc. and are reproduced herein with -the permission of UNIX System Laboratories, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1983, 1987, 1989 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1983, 1989 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1983, 1989, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1983, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1985 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1985 Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1985, 1988, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -Portions Copyright (c) 1993 by Digital Equipment Corporation. - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies, and that -the name of Digital Equipment Corporation not be used in advertising or -publicity pertaining to distribution of the document or software without -specific, written prior permission. - -THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL -WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT -CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 1985, 1989, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1985, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1985, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1985, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1987 Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1987, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1987, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1988 Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1988 The Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1988, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1988, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1988, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1988, 1993 - The Regents of the University of California. All rights reserved. - -This code is derived from software written by Ken Arnold and -published in UNIX Review, Vol. 6, No. 8. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1989 The Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1989 The Regents of the University of California. -All rights reserved. -(c) UNIX System Laboratories, Inc. -All or some portions of this file are derived from material licensed -to the University of California by American Telephone and Telegraph -Co. or Unix System Laboratories, Inc. and are reproduced herein with -the permission of UNIX System Laboratories, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1989, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1989, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1989, 1993 - The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to Berkeley by -Guido van Rossum. - -Copyright (c) 2011 The FreeBSD Foundation -All rights reserved. -Portions of this software were developed by David Chisnall -under sponsorship from the FreeBSD Foundation. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1989, 1993 - The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to Berkeley by -Guido van Rossum. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1989, 1993 - The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to Berkeley by -Roger L. Snyder. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1989, 1993 - The Regents of the University of California. All rights reserved. -(c) UNIX System Laboratories, Inc. -All or some portions of this file are derived from material licensed -to the University of California by American Telephone and Telegraph -Co. or Unix System Laboratories, Inc. and are reproduced herein with -the permission of UNIX System Laboratories, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1990 Regents of the University of California. -All rights reserved. - -This code is derived from software contributed to Berkeley by -Chris Torek. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1990 The Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1990 The Regents of the University of California. -All rights reserved. - -This code is derived from software contributed to Berkeley by -Chris Torek. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1990 The Regents of the University of California. -All rights reserved. - -This code is derived from software contributed to Berkeley by -William Jolitz. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1990, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1990, 1993 - The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to Berkeley by -Chris Torek. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1990, 1993 - The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to Berkeley by -Donn Seeley at UUNET Technologies, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1990, 1993 - The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to Berkeley by -Donn Seeley at UUNET Technologies, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1990, 1993 - The Regents of the University of California. All rights reserved. -(c) UNIX System Laboratories, Inc. -All or some portions of this file are derived from material licensed -to the University of California by American Telephone and Telegraph -Co. or Unix System Laboratories, Inc. and are reproduced herein with -the permission of UNIX System Laboratories, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1990, 1993, 1994 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1990, 1993, 1994 - The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to Berkeley by -Chris Torek. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1991 The Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1991, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1991, 1993 - The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to Berkeley by -Berkeley Software Design, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1991, 1993 - The Regents of the University of California. All rights reserved. -(c) UNIX System Laboratories, Inc. -All or some portions of this file are derived from material licensed -to the University of California by American Telephone and Telegraph -Co. or Unix System Laboratories, Inc. and are reproduced herein with -the permission of UNIX System Laboratories, Inc. - -This code is derived from software contributed to Berkeley by -Hugh Smith at The University of Guelph. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1991, 1993, 1995, - The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to Berkeley by -Havard Eidnes. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1992 Henry Spencer. -Copyright (c) 1992, 1993 - The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to Berkeley by -Henry Spencer of the University of Toronto. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1992 The Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1992, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1992, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1992, 1993 - The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to Berkeley by -Ralph Campbell. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1992, 1993 - The Regents of the University of California. All rights reserved. - -This software was developed by the Computer Systems Engineering group -at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and -contributed to Berkeley. - -All advertising materials mentioning features or use of this software -must display the following acknowledgement: - This product includes software developed by the University of - California, Lawrence Berkeley Laboratory. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1992, 1993 - The Regents of the University of California. All rights reserved. -(c) UNIX System Laboratories, Inc. -All or some portions of this file are derived from material licensed -to the University of California by American Telephone and Telegraph -Co. or Unix System Laboratories, Inc. and are reproduced herein with -the permission of UNIX System Laboratories, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1992, 1993, 1994 - The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to Berkeley by -Henry Spencer. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1992, 1993, 1994 Henry Spencer. - -This code is derived from software contributed to Berkeley by -Henry Spencer. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1993 Martin Birgmeier -All rights reserved. - -You may redistribute unmodified or modified versions of this source -code provided that the above copyright notice and this and the -following conditions are retained. - -This software is provided ``as is'', and comes with no warranties -of any kind. I shall in no event be liable for anything that happens -to anyone/anything when using this software. - -------------------------------------------------------------------- - -Copyright (c) 1994 SigmaSoft, Th. Lockert -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1996 by Internet Software Consortium. - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS -ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE -CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 1996, David Mazieres -Copyright (c) 2008, Damien Miller -Copyright (c) 2013, Markus Friedl - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 1996, David Mazieres -Copyright (c) 2008, Damien Miller -Copyright (c) 2013, Markus Friedl -Copyright (c) 2014, Theo de Raadt - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 1996-1998, 2008 Theo de Raadt -Copyright (c) 1997, 2008-2009 Todd C. Miller - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 1997 Mark Brinicombe -Copyright (C) 2010 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by Mark Brinicombe -4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1997 Niklas Hallqvist. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1997 Todd C. Miller - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 1997 Todd C. Miller -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. -All rights reserved. - -This code was contributed to The NetBSD Foundation by Klaus Klein. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the NetBSD - Foundation, Inc. and its contributors. -4. Neither the name of The NetBSD Foundation nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1997, 1998, 1999, 2004 The NetBSD Foundation, Inc. -All rights reserved. - -This code is derived from software contributed to The NetBSD Foundation -by Luke Mewburn. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1997, 1998, 1999, 2004 The NetBSD Foundation, Inc. -All rights reserved. - -This code is derived from software contributed to The NetBSD Foundation -by Luke Mewburn; and by Jason R. Thorpe. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the NetBSD - Foundation, Inc. and its contributors. -4. Neither the name of The NetBSD Foundation nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1997, 2005 Todd C. Miller - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 1998 Softweyr LLC. All rights reserved. - -strtok_r, from Berkeley strtok -Oct 13, 1998 by Wes Peters - -Copyright (c) 1988, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notices, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notices, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY SOFTWEYR LLC, THE REGENTS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTWEYR LLC, THE -REGENTS, OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1998 The NetBSD Foundation, Inc. -All rights reserved. - -This code is derived from software contributed to The NetBSD Foundation -by Klaus Klein. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the NetBSD - Foundation, Inc. and its contributors. -4. Neither the name of The NetBSD Foundation nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1998 Todd C. Miller -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 1998, 2015 Todd C. Miller - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 1999 - David E. O'Brien -Copyright (c) 1988, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2000 Ben Harris. -Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the project nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2000 The NetBSD Foundation, Inc. -All rights reserved. - -This code is derived from software contributed to The NetBSD Foundation -by Dieter Baron and Thomas Klausner. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2001 Wasabi Systems, Inc. -All rights reserved. - -Written by Frank van der Linden for Wasabi Systems, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed for the NetBSD Project by - Wasabi Systems, Inc. -4. The name of Wasabi Systems, Inc. may not be used to endorse - or promote products derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Opsycon AB nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2001-2011 The FreeBSD Project. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2002 Daniel Hartmeier -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2002 The NetBSD Foundation, Inc. -All rights reserved. - -This code is derived from software contributed to The NetBSD Foundation -by Christos Zoulas. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2002 Tim J. Robbins -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2002 Tim J. Robbins. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2002 Todd C. Miller - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Sponsored in part by the Defense Advanced Research Projects -Agency (DARPA) and Air Force Research Laboratory, Air Force -Materiel Command, USAF, under agreement number F39502-99-1-0512. - -------------------------------------------------------------------- - -Copyright (c) 2002, 2003 Tim J. Robbins. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2002-2004 Tim J. Robbins -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2002-2004 Tim J. Robbins. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2003 Constantin S. Svintsoff - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2003 Dag-Erling Smørgrav -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer - in this position and unchanged. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2003 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2003 Mike Barcroft -Copyright (c) 2002 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2003 Networks Associates Technology, Inc. -All rights reserved. - -Portions of this software were developed for the FreeBSD Project by -Jacques A. Vidrine, Safeport Network Services, and Network -Associates Laboratories, the Security Research Division of Network -Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 -("CBOSS"), as part of the DARPA CHATS research program. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2003 Todd C. Miller - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Sponsored in part by the Defense Advanced Research Projects -Agency (DARPA) and Air Force Research Laboratory, Air Force -Materiel Command, USAF, under agreement number F39502-99-1-0512. - -------------------------------------------------------------------- - -Copyright (c) 2003, 2004 Todd C. Miller - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Sponsored in part by the Defense Advanced Research Projects -Agency (DARPA) and Air Force Research Laboratory, Air Force -Materiel Command, USAF, under agreement number F39502-99-1-0512. - -------------------------------------------------------------------- - -Copyright (c) 2003, Steven G. Kargl -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice unmodified, this list of conditions, and the following - disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2004 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2004 Stefan Farfeleder -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") -Copyright (c) 1995,1999 by Internet Software Consortium. - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") -Copyright (c) 1995-1999 by Internet Software Consortium - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") -Copyright (c) 1995-1999 by Internet Software Consortium. - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") -Copyright (c) 1996,1999 by Internet Software Consortium. - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") -Copyright (c) 1996-1999 by Internet Software Consortium - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") -Copyright (c) 1996-1999 by Internet Software Consortium. - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") -Copyright (c) 1997,1999 by Internet Software Consortium. - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") -Copyright (c) 1999 by Internet Software Consortium. - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") -Portions Copyright (c) 1996-1999 by Internet Software Consortium. - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2004, 2005 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2004-2005 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2004-2005 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2005 Bruce D. Evans and Steven G. Kargl -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice unmodified, this list of conditions, and the following - disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2005 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2005 Tim J. Robbins. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2005 by Internet Systems Consortium, Inc. ("ISC") -Copyright (c) 1995-1999 by Internet Software Consortium - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2005-2008 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2005-2011 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2007 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2007 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2007 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -Derived from s_modf.c, which has the following Copyright: -==================================================== -Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - -Developed at SunPro, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. - -------------------------------------------------------------------- - -Copyright (c) 2007 Steven G. Kargl -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice unmodified, this list of conditions, and the following - disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2007 The NetBSD Foundation, Inc. -All rights reserved. - -This code is derived from software written by Stephen L. Moshier. -It is redistributed by the NetBSD Foundation by permission of the author. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2007 Todd C. Miller - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2007-2008 Michael G Schwern - -This software originally derived from Paul Sheer's pivotal_gmtime_r.c. - -The MIT License: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2007-2008 Michael G Schwern - -This software originally derived from Paul Sheer's pivotal_gmtime_r.c. - -The MIT License: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Origin: http://code.google.com/p/y2038 -Modified for Bionic by the Android Open Source Project - -------------------------------------------------------------------- - -Copyright (c) 2007-2008 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2007-2013 Bruce D. Evans -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice unmodified, this list of conditions, and the following - disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2008 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2008 Otto Moerbeek - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2008 Todd C. Miller - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2008, Damien Miller - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2009 David Schultz -All rights reserved. - -Copyright (c) 2011 The FreeBSD Foundation -All rights reserved. -Portions of this software were developed by David Chisnall -under sponsorship from the FreeBSD Foundation. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2009 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2009 The NetBSD Foundation, Inc. - -This code is derived from software contributed to The NetBSD Foundation -by Roy Marples. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2009-2013 Steven G. Kargl -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice unmodified, this list of conditions, and the following - disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Optimized by Bruce D. Evans. - -------------------------------------------------------------------- - -Copyright (c) 2010 The NetBSD Foundation, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2010 Todd C. Miller - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2010, 2011, 2012, 2013 Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - - * Neither the name of Intel Corporation nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2010, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - - * Neither the name of Intel Corporation nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2011 David Chisnall -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2011 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice unmodified, this list of conditions, and the following - disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2011 David Schultz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2011 Ed Schouten - David Chisnall -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2011 Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - - * Neither the name of Intel Corporation nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2011 Martin Pieuchot - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2011 The Android Open Source Project -Copyright (c) 2008 ARM Ltd -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the company may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2011, 2012, 2013 Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - - * Neither the name of Intel Corporation nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2011, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - - * Neither the name of Intel Corporation nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2011, VMware, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the VMware, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2012 Stephen Montgomery-Smith -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2012, Linaro Limited - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Linaro nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2012, Linaro Limited - All rights reserved. - Copyright (c) 2014, NVIDIA Corporation. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Linaro nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2012-2013, Linaro Limited - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Linaro nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - -------------------------------------------------------------------- - -Copyright (c) 2013 - MIPS Technologies, Inc., California. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the MIPS Technologies, Inc., nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2013 ARM Ltd -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the company may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2013 Antoine Jacoutot - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Copyright (c) 2013 The NetBSD Foundation, Inc. -All rights reserved. - -This code is derived from software contributed to The NetBSD Foundation -by Christos Zoulas. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2013, Linaro Limited - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Linaro nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - -------------------------------------------------------------------- - -Copyright (c) 2013-2014, NVIDIA Corporation. All rights reserved. -Johnny Qiu -Shu Zhang - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of The Linux Foundation nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2013-2015, Linaro Limited - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Linaro nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - -------------------------------------------------------------------- - -Copyright (c) 2014 Theo de Raadt -Copyright (c) 2014 Bob Beck - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Emulation of getentropy(2) as documented at: -http://man.openbsd.org/getentropy.2 - -------------------------------------------------------------------- - -Copyright (c) 2014, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - - * Neither the name of Intel Corporation nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2014, Linaro Limited - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Linaro nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2015 ARM Ltd -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the company may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2015 Joerg Sonnenberger . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2015 Nuxi, https://nuxi.nl/ - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2017 ARM Ltd -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the company may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c) 2017 Imagination Technologies. - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with - the distribution. - * Neither the name of Imagination Technologies nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c)1999 Citrus Project, -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c)2001 Citrus Project, -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright (c)2003 Citrus Project, -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -Copyright 1989 The Regents of the University of California. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - -------------------------------------------------------------------- - -Copyright 1997 Niels Provos -Copyright 2008 Damien Miller -All rights reserved. - -Theo de Raadt came up with the idea of using -such a mathematical system to generate more random (yet non-repeating) -ids to solve the resolver/named problem. But Niels designed the -actual system based on the constraints. - -Later modified by Damien Miller to wrap the LCG output in a 15-bit -permutation generator based on a Luby-Rackoff block cipher. This -ensures the output is non-repeating and preserves the MSB twiddle -trick, but makes it more resistant to LCG prediction. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - -From: @(#)s_ilogb.c 5.1 93/09/24 -==================================================== -Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - -Developed at SunPro, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. - -------------------------------------------------------------------- - -Portions Copyright (C) 2004, 2005, 2008, 2009 Internet Systems Consortium, Inc. ("ISC") -Portions Copyright (C) 1996-2003 Internet Software Consortium. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------------------- - -Portions Copyright (c) 1993 by Digital Equipment Corporation. - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies, and that -the name of Digital Equipment Corporation not be used in advertising or -publicity pertaining to distribution of the document or software without -specific, written prior permission. - -THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL -WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT -CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -------------------------------------------------------------------- - -Portions Copyright (c) 1995 by International Business Machines, Inc. - -International Business Machines, Inc. (hereinafter called IBM) grants -permission under its copyrights to use, copy, modify, and distribute this -Software with or without fee, provided that the above copyright notice and -all paragraphs of this notice appear in all copies, and that the name of IBM -not be used in connection with the marketing of any product incorporating -the Software or modifications thereof, without specific, written prior -permission. - -To the extent it has a right to do so, IBM grants an immunity from suit -under its patents, if any, for the use, sale or manufacture of products to -the extent that such products are used for performing Domain Name System -dynamic updates in TCP/IP networks by means of the Software. No immunity is -granted for any product per se or for any other function of any product. - -THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, -DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING -OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN -IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. - -------------------------------------------------------------------- - -Portions Copyright(C) 1995, Jason Downs. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS -OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - -The author of this software is David M. Gay. - -Copyright (C) 1998 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -------------------------------------------------------------------- - -The author of this software is David M. Gay. - -Copyright (C) 1998, 1999 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -------------------------------------------------------------------- - -The author of this software is David M. Gay. - -Copyright (C) 1998, 2000 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -------------------------------------------------------------------- - -The author of this software is David M. Gay. - -Copyright (C) 1998-2000 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -------------------------------------------------------------------- - -The author of this software is David M. Gay. - -Copyright (C) 1998-2001 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -------------------------------------------------------------------- - -The author of this software is David M. Gay. - -Copyright (C) 2000 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -------------------------------------------------------------------- - From e10d588c86b6b9d3efeb1564a14657538d19a409 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Mon, 23 Apr 2018 15:47:37 -0700 Subject: [PATCH 076/165] Split off pre_1.11 Python interop script --- .../interop_matrix/testcases/python__pre_1.11 | 20 +++++++++++++++++++ tools/interop_matrix/testcases/python__v1.0.x | 2 ++ tools/interop_matrix/testcases/python__v1.1.4 | 2 ++ .../interop_matrix/testcases/python__v1.10.0 | 2 ++ tools/interop_matrix/testcases/python__v1.2.5 | 2 ++ tools/interop_matrix/testcases/python__v1.3.9 | 2 ++ tools/interop_matrix/testcases/python__v1.4.2 | 2 ++ tools/interop_matrix/testcases/python__v1.6.6 | 2 ++ tools/interop_matrix/testcases/python__v1.7.2 | 2 ++ tools/interop_matrix/testcases/python__v1.8.1 | 2 ++ tools/interop_matrix/testcases/python__v1.9.1 | 2 ++ 11 files changed, 40 insertions(+) create mode 100755 tools/interop_matrix/testcases/python__pre_1.11 create mode 100755 tools/interop_matrix/testcases/python__v1.0.x create mode 100755 tools/interop_matrix/testcases/python__v1.1.4 create mode 100755 tools/interop_matrix/testcases/python__v1.10.0 create mode 100755 tools/interop_matrix/testcases/python__v1.2.5 create mode 100755 tools/interop_matrix/testcases/python__v1.3.9 create mode 100755 tools/interop_matrix/testcases/python__v1.4.2 create mode 100755 tools/interop_matrix/testcases/python__v1.6.6 create mode 100755 tools/interop_matrix/testcases/python__v1.7.2 create mode 100755 tools/interop_matrix/testcases/python__v1.8.1 create mode 100755 tools/interop_matrix/testcases/python__v1.9.1 diff --git a/tools/interop_matrix/testcases/python__pre_1.11 b/tools/interop_matrix/testcases/python__pre_1.11 new file mode 100755 index 00000000000..71ba75e5d1f --- /dev/null +++ b/tools/interop_matrix/testcases/python__pre_1.11 @@ -0,0 +1,20 @@ +#!/bin/bash +echo "Testing ${docker_image:=grpc_interop_python:797ca293-94e8-48d4-92e9-a4d52fcfcca9}" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server\"" diff --git a/tools/interop_matrix/testcases/python__v1.0.x b/tools/interop_matrix/testcases/python__v1.0.x new file mode 100755 index 00000000000..983d03de65b --- /dev/null +++ b/tools/interop_matrix/testcases/python__v1.0.x @@ -0,0 +1,2 @@ +#!/bin/bash +"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.1.4 b/tools/interop_matrix/testcases/python__v1.1.4 new file mode 100755 index 00000000000..983d03de65b --- /dev/null +++ b/tools/interop_matrix/testcases/python__v1.1.4 @@ -0,0 +1,2 @@ +#!/bin/bash +"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.10.0 b/tools/interop_matrix/testcases/python__v1.10.0 new file mode 100755 index 00000000000..983d03de65b --- /dev/null +++ b/tools/interop_matrix/testcases/python__v1.10.0 @@ -0,0 +1,2 @@ +#!/bin/bash +"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.2.5 b/tools/interop_matrix/testcases/python__v1.2.5 new file mode 100755 index 00000000000..983d03de65b --- /dev/null +++ b/tools/interop_matrix/testcases/python__v1.2.5 @@ -0,0 +1,2 @@ +#!/bin/bash +"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.3.9 b/tools/interop_matrix/testcases/python__v1.3.9 new file mode 100755 index 00000000000..983d03de65b --- /dev/null +++ b/tools/interop_matrix/testcases/python__v1.3.9 @@ -0,0 +1,2 @@ +#!/bin/bash +"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.4.2 b/tools/interop_matrix/testcases/python__v1.4.2 new file mode 100755 index 00000000000..983d03de65b --- /dev/null +++ b/tools/interop_matrix/testcases/python__v1.4.2 @@ -0,0 +1,2 @@ +#!/bin/bash +"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.6.6 b/tools/interop_matrix/testcases/python__v1.6.6 new file mode 100755 index 00000000000..983d03de65b --- /dev/null +++ b/tools/interop_matrix/testcases/python__v1.6.6 @@ -0,0 +1,2 @@ +#!/bin/bash +"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.7.2 b/tools/interop_matrix/testcases/python__v1.7.2 new file mode 100755 index 00000000000..983d03de65b --- /dev/null +++ b/tools/interop_matrix/testcases/python__v1.7.2 @@ -0,0 +1,2 @@ +#!/bin/bash +"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.8.1 b/tools/interop_matrix/testcases/python__v1.8.1 new file mode 100755 index 00000000000..983d03de65b --- /dev/null +++ b/tools/interop_matrix/testcases/python__v1.8.1 @@ -0,0 +1,2 @@ +#!/bin/bash +"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.9.1 b/tools/interop_matrix/testcases/python__v1.9.1 new file mode 100755 index 00000000000..983d03de65b --- /dev/null +++ b/tools/interop_matrix/testcases/python__v1.9.1 @@ -0,0 +1,2 @@ +#!/bin/bash +"$(dirname "$0")/python__pre_1.11" From 6bdcc6f7cf641503697dcc3d29cb8b43c98bd451 Mon Sep 17 00:00:00 2001 From: Ruslan Nigmatullin Date: Mon, 23 Apr 2018 16:20:30 -0700 Subject: [PATCH 077/165] [openssl] Use 80-bytes STEK for OpenSSL-1.1 --- test/core/tsi/ssl_transport_security_test.cc | 22 +++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/test/core/tsi/ssl_transport_security_test.cc b/test/core/tsi/ssl_transport_security_test.cc index 88f1abc18c3..cf1ac824139 100644 --- a/test/core/tsi/ssl_transport_security_test.cc +++ b/test/core/tsi/ssl_transport_security_test.cc @@ -34,6 +34,10 @@ #include #include +extern "C" { +#include +} + #define SSL_TSI_TEST_ALPN1 "foo" #define SSL_TSI_TEST_ALPN2 "toto" #define SSL_TSI_TEST_ALPN3 "baz" @@ -42,6 +46,14 @@ #define SSL_TSI_TEST_BAD_SERVER_KEY_CERT_PAIRS_NUM 1 #define SSL_TSI_TEST_CREDENTIALS_DIR "src/core/tsi/test_creds/" +// OpenSSL 1.1 uses AES256 for encryption session ticket by default so specify +// different STEK size. +#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(OPENSSL_IS_BORINGSSL) +const size_t kSessionTicketEncryptionKeySize = 80; +#else +const size_t kSessionTicketEncryptionKeySize = 48; +#endif + typedef enum AlpnMode { NO_ALPN, ALPN_CLIENT_NO_SERVER, @@ -624,7 +636,7 @@ void ssl_tsi_test_do_round_trip_odd_buffer_size() { void ssl_tsi_test_do_handshake_session_cache() { tsi_ssl_session_cache* session_cache = tsi_ssl_session_cache_create_lru(16); - char session_ticket_key[48]; + char session_ticket_key[kSessionTicketEncryptionKeySize]; auto do_handshake = [&session_ticket_key, &session_cache](bool session_reused) { tsi_test_fixture* fixture = ssl_tsi_test_fixture_create(); @@ -633,22 +645,22 @@ void ssl_tsi_test_do_handshake_session_cache() { ssl_fixture->server_name_indication = const_cast("waterzooi.test.google.be"); ssl_fixture->session_ticket_key = session_ticket_key; - ssl_fixture->session_ticket_key_size = 48; + ssl_fixture->session_ticket_key_size = sizeof(session_ticket_key); tsi_ssl_session_cache_ref(session_cache); ssl_fixture->session_cache = session_cache; ssl_fixture->session_reused = session_reused; tsi_test_do_round_trip(&ssl_fixture->base); tsi_test_fixture_destroy(fixture); }; - memset(session_ticket_key, 'a', 48); + memset(session_ticket_key, 'a', sizeof(session_ticket_key)); do_handshake(false); do_handshake(true); do_handshake(true); // Changing session_ticket_key on server invalidates ticket. - memset(session_ticket_key, 'b', 48); + memset(session_ticket_key, 'b', sizeof(session_ticket_key)); do_handshake(false); do_handshake(true); - memset(session_ticket_key, 'c', 48); + memset(session_ticket_key, 'c', sizeof(session_ticket_key)); do_handshake(false); do_handshake(true); tsi_ssl_session_cache_unref(session_cache); From 663a71b51fca2ca68a9e3dde2346b8edfbea25ce Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Mon, 23 Apr 2018 23:01:40 -0700 Subject: [PATCH 078/165] Fix Python backward compatibility tests --- tools/interop_matrix/client_matrix.py | 10 ++++++++++ .../interop_matrix/testcases/python__pre_1.11 | 20 ------------------- tools/interop_matrix/testcases/python__v1.0.x | 20 ++++++++++++++++++- tools/interop_matrix/testcases/python__v1.1.4 | 2 -- .../interop_matrix/testcases/python__v1.10.0 | 2 -- tools/interop_matrix/testcases/python__v1.2.5 | 2 -- tools/interop_matrix/testcases/python__v1.3.9 | 2 -- tools/interop_matrix/testcases/python__v1.4.2 | 2 -- tools/interop_matrix/testcases/python__v1.6.6 | 2 -- tools/interop_matrix/testcases/python__v1.7.2 | 2 -- tools/interop_matrix/testcases/python__v1.8.1 | 2 -- tools/interop_matrix/testcases/python__v1.9.1 | 2 -- 12 files changed, 29 insertions(+), 39 deletions(-) delete mode 100755 tools/interop_matrix/testcases/python__pre_1.11 delete mode 100755 tools/interop_matrix/testcases/python__v1.1.4 delete mode 100755 tools/interop_matrix/testcases/python__v1.10.0 delete mode 100755 tools/interop_matrix/testcases/python__v1.2.5 delete mode 100755 tools/interop_matrix/testcases/python__v1.3.9 delete mode 100755 tools/interop_matrix/testcases/python__v1.4.2 delete mode 100755 tools/interop_matrix/testcases/python__v1.6.6 delete mode 100755 tools/interop_matrix/testcases/python__v1.7.2 delete mode 100755 tools/interop_matrix/testcases/python__v1.8.1 delete mode 100755 tools/interop_matrix/testcases/python__v1.9.1 diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index 730fe64dc0e..e39fabec9cf 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -358,4 +358,14 @@ TESTCASES_VERSION_MATRIX = { 'ruby_v1.0.1': 'ruby__v1.0.1', 'csharp_v1.1.4': 'csharp__v1.1.4', 'csharp_v1.2.5': 'csharp__v1.1.4', + 'python_v1.0.x': 'python__v1.0.x', + 'python_v1.1.4': 'python__v1.0.x', + 'python_v1.2.5': 'python__v1.0.x', + 'python_v1.3.9': 'python__v1.0.x', + 'python_v1.4.2': 'python__v1.0.x', + 'python_v1.6.6': 'python__v1.0.x', + 'python_v1.7.2': 'python__v1.0.x', + 'python_v1.8.1': 'python__v1.0.x', + 'python_v1.9.1': 'python__v1.0.x', + 'python_v1.10.0': 'python__v1.0.x', } diff --git a/tools/interop_matrix/testcases/python__pre_1.11 b/tools/interop_matrix/testcases/python__pre_1.11 deleted file mode 100755 index 71ba75e5d1f..00000000000 --- a/tools/interop_matrix/testcases/python__pre_1.11 +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -echo "Testing ${docker_image:=grpc_interop_python:797ca293-94e8-48d4-92e9-a4d52fcfcca9}" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response\"" -docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server\"" diff --git a/tools/interop_matrix/testcases/python__v1.0.x b/tools/interop_matrix/testcases/python__v1.0.x index 983d03de65b..71ba75e5d1f 100755 --- a/tools/interop_matrix/testcases/python__v1.0.x +++ b/tools/interop_matrix/testcases/python__v1.0.x @@ -1,2 +1,20 @@ #!/bin/bash -"$(dirname "$0")/python__pre_1.11" +echo "Testing ${docker_image:=grpc_interop_python:797ca293-94e8-48d4-92e9-a4d52fcfcca9}" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response\"" +docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py27/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server\"" diff --git a/tools/interop_matrix/testcases/python__v1.1.4 b/tools/interop_matrix/testcases/python__v1.1.4 deleted file mode 100755 index 983d03de65b..00000000000 --- a/tools/interop_matrix/testcases/python__v1.1.4 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.10.0 b/tools/interop_matrix/testcases/python__v1.10.0 deleted file mode 100755 index 983d03de65b..00000000000 --- a/tools/interop_matrix/testcases/python__v1.10.0 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.2.5 b/tools/interop_matrix/testcases/python__v1.2.5 deleted file mode 100755 index 983d03de65b..00000000000 --- a/tools/interop_matrix/testcases/python__v1.2.5 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.3.9 b/tools/interop_matrix/testcases/python__v1.3.9 deleted file mode 100755 index 983d03de65b..00000000000 --- a/tools/interop_matrix/testcases/python__v1.3.9 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.4.2 b/tools/interop_matrix/testcases/python__v1.4.2 deleted file mode 100755 index 983d03de65b..00000000000 --- a/tools/interop_matrix/testcases/python__v1.4.2 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.6.6 b/tools/interop_matrix/testcases/python__v1.6.6 deleted file mode 100755 index 983d03de65b..00000000000 --- a/tools/interop_matrix/testcases/python__v1.6.6 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.7.2 b/tools/interop_matrix/testcases/python__v1.7.2 deleted file mode 100755 index 983d03de65b..00000000000 --- a/tools/interop_matrix/testcases/python__v1.7.2 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.8.1 b/tools/interop_matrix/testcases/python__v1.8.1 deleted file mode 100755 index 983d03de65b..00000000000 --- a/tools/interop_matrix/testcases/python__v1.8.1 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -"$(dirname "$0")/python__pre_1.11" diff --git a/tools/interop_matrix/testcases/python__v1.9.1 b/tools/interop_matrix/testcases/python__v1.9.1 deleted file mode 100755 index 983d03de65b..00000000000 --- a/tools/interop_matrix/testcases/python__v1.9.1 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -"$(dirname "$0")/python__pre_1.11" From aac848ff19726af7b0e936f8e47dfce650377f7c Mon Sep 17 00:00:00 2001 From: Hope Casey-Allen Date: Tue, 24 Apr 2018 14:52:34 -0700 Subject: [PATCH 079/165] Add missing include for GPR_TIMER_SCOPE in latency profiling --- src/core/lib/profiling/basic_timers.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/lib/profiling/basic_timers.cc b/src/core/lib/profiling/basic_timers.cc index 652a498b6ee..b19ad9fc23d 100644 --- a/src/core/lib/profiling/basic_timers.cc +++ b/src/core/lib/profiling/basic_timers.cc @@ -27,6 +27,7 @@ #include #include #include +#include #include #include From 8d6f4619e3eb17250d35d52f3192e21f24c5750e Mon Sep 17 00:00:00 2001 From: Hope Casey-Allen Date: Tue, 24 Apr 2018 15:31:40 -0700 Subject: [PATCH 080/165] Update the run tests instructions to clarify a python module error --- tools/run_tests/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/run_tests/README.md b/tools/run_tests/README.md index ceddc21a984..64d67e47d9e 100644 --- a/tools/run_tests/README.md +++ b/tools/run_tests/README.md @@ -14,6 +14,8 @@ Builds gRPC in given language and runs unit tests. Use `tools/run_tests/run_test - `--use_docker` Builds a docker container containing all the prerequisites for given language and runs the tests under that container. - `--build_only` Only build, do not run the tests. +Note: If you get an error such as `ImportError: No module named httplib2`, then you may be missing some Python modules. Install the module listed in the error and try again. + Note: some tests may be flaky. Check the "Issues" tab for known flakes and other issues. The full suite of unit tests will take many minutes to run. From 7e228c7f166b8a78bdf0cb7b3008c515a2f54cc3 Mon Sep 17 00:00:00 2001 From: Wenbo Zhu Date: Tue, 24 Apr 2018 18:15:28 -0700 Subject: [PATCH 081/165] Update README.md Mention grpc-web --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e66c0b14fd4..e1febd8ea74 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ Libraries in different languages may be in different states of development. We a | Go | [grpc-go](http://github.com/grpc/grpc-go) | | NodeJS | [grpc-node](https://github.com/grpc/grpc-node) | | Dart | [grpc-dart](https://github.com/grpc/grpc-dart) | +| WebJS | [grpc-web](https://github.com/grpc/grpc-web) | See [MANIFEST.md](MANIFEST.md) for a listing of top-level items in the repository. From 2ddbb1738a8f7f4af94aa378cacc7abc49614ccd Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 25 Apr 2018 10:24:55 +0200 Subject: [PATCH 082/165] better C# instructions --- src/csharp/README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/csharp/README.md b/src/csharp/README.md index 6821ad225eb..e96b944a8be 100644 --- a/src/csharp/README.md +++ b/src/csharp/README.md @@ -39,10 +39,14 @@ If you are a user of gRPC C#, go to Usage section above. **Windows, Linux or Mac OS X** -- The easiest way to build is using the `run_tests.py` script that will take care of building the `grpc_csharp_ext` native library: +- The easiest way to build is using the `run_tests.py` script that will take care of building the `grpc_csharp_ext` native library. + You might first need to install the prerequisites mentioned in [INSTALL.md](../../INSTALL.md#pre-requisites). ``` + # NOTE: make sure all necessary git submodules with dependencies + # are available by running "git submodule update --init" + # from the gRPC repository root - $ python tools/run_tests/run_tests.py -c dbg -l csharp --build_only + $ python tools/run_tests/run_tests.py -l csharp -c dbg --build_only ``` - Use Visual Studio 2017 (on Windows) to open the solution `Grpc.sln` or use Visual Studio Code with C# extension (on Linux and Mac). gRPC C# code has been migrated to @@ -57,11 +61,12 @@ gRPC C# is using NUnit as the testing framework. Under Visual Studio, make sure NUnit test adapter is installed (under "Extensions and Updates"). Then you should be able to run all the tests using Test Explorer. -gRPC team uses a Python script to simplify facilitate running tests for +gRPC team uses a Python script to facilitate running tests for different languages. ``` -tools/run_tests/run_tests.py -l csharp +# from the gRPC repository root +$ python tools/run_tests/run_tests.py -l csharp -c dbg ``` DOCUMENTATION From 5947d337fd94d156ba937555fb5492df24d7f3ba Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 25 Apr 2018 11:03:16 +0200 Subject: [PATCH 083/165] run_tests.py --auto_set_flakes should be disabled by default --- tools/run_tests/run_tests.py | 8 +++++--- tools/run_tests/run_tests_matrix.py | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 6fb0f89381f..0c270fa77ed 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -1420,16 +1420,18 @@ argp.add_argument( nargs='?', help='Upload test results to a specified BQ table.') argp.add_argument( - '--disable_auto_set_flakes', + '--auto_set_flakes', default=False, const=True, action='store_const', - help='Disable rerunning historically flaky tests') + help= + 'Allow repeated runs for tests that have been failing recently (based on BQ historical data).' +) args = argp.parse_args() flaky_tests = set() shortname_to_cpu = {} -if not args.disable_auto_set_flakes: +if args.auto_set_flakes: try: for test in get_bqtest_data(): if test.flaky: flaky_tests.add(test.name) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 85f91b04463..64d80ab721d 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -529,7 +529,6 @@ if __name__ == "__main__": extra_args.append('--bq_result_table') extra_args.append('%s' % args.bq_result_table) extra_args.append('--measure_cpu_costs') - extra_args.append('--disable_auto_set_flakes') all_jobs = _create_test_jobs(extra_args=extra_args, inner_jobs=args.inner_jobs) + \ _create_portability_test_jobs(extra_args=extra_args, inner_jobs=args.inner_jobs) From 253358da4283d8bec9292c197fcf24935d790986 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 25 Apr 2018 08:07:54 -0700 Subject: [PATCH 084/165] Update connected subchannel on RR init. --- .../lb_policy/subchannel_list.h | 60 ++++++++++++------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index e13504313d6..b88719b7473 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -116,6 +116,7 @@ class SubchannelData { grpc_error* error = GRPC_ERROR_NONE; pending_connectivity_state_unsafe_ = grpc_subchannel_check_connectivity(subchannel(), &error); + UpdateConnectedSubchannelLocked(); if (pending_connectivity_state_unsafe_ != curr_connectivity_state_) { curr_connectivity_state_ = pending_connectivity_state_unsafe_; ProcessConnectivityChangeLocked(error); @@ -167,6 +168,9 @@ class SubchannelData { virtual void ProcessConnectivityChangeLocked(grpc_error* error) GRPC_ABSTRACT; private: +// FIXME: document + bool UpdateConnectedSubchannelLocked(); + static void OnConnectivityChangedLocked(void* arg, grpc_error* error); // Backpointer to owning subchannel list. Not owned. @@ -346,33 +350,47 @@ void SubchannelData:: } template -void SubchannelData:: - OnConnectivityChangedLocked(void* arg, grpc_error* error) { - SubchannelData* sd = static_cast(arg); +bool SubchannelData:: + UpdateConnectedSubchannelLocked() { // FIXME: add trace logging // If the subchannel is READY, get a ref to the connected subchannel. - if (sd->pending_connectivity_state_unsafe_ == GRPC_CHANNEL_READY) { - sd->connected_subchannel_ = - grpc_subchannel_get_connected_subchannel(sd->subchannel_); - // If the subchannel became disconnected between the time that this - // callback was scheduled and the time that it was actually run in the - // combiner, then the connected subchannel may have disappeared out from - // under us. In that case, instead of propagating the READY notification, - // we simply renew our watch and wait for the next notification. - // Note that we start the renewed watch from IDLE to make sure we - // get a notification for the next state, even if that state is - // READY again (e.g., if the subchannel has transitioned back to - // READY before the callback gets scheduled). - if (sd->connected_subchannel_ == nullptr) { - sd->pending_connectivity_state_unsafe_ = GRPC_CHANNEL_IDLE; - sd->StartConnectivityWatchLocked(); - return; + if (pending_connectivity_state_unsafe_ == GRPC_CHANNEL_READY) { + connected_subchannel_ = + grpc_subchannel_get_connected_subchannel(subchannel_); + // If the subchannel became disconnected between the time that READY + // was reported and the time we got here (e.g., between when a + // notification callback is scheduled and when it was actually run in + // the combiner), then the connected subchannel may have disappeared out + // from under us. In that case, we don't actually want to consider the + // subchannel to be in state READY. Instead, we use IDLE as the + // basis for any future connectivity watch; this is the one state that + // the subchannel will never transition back into, so this ensures + // that we will get a notification for the next state, even if that state + // is READY again (e.g., if the subchannel has transitioned back to + // READY before the next watch gets requested). + if (connected_subchannel_ == nullptr) { + pending_connectivity_state_unsafe_ = GRPC_CHANNEL_IDLE; + return false; } } +// FIXME: do this for any other state? // If we get TRANSIENT_FAILURE, unref the connected subchannel. - else if (sd->pending_connectivity_state_unsafe_ == + else if (pending_connectivity_state_unsafe_ == GRPC_CHANNEL_TRANSIENT_FAILURE) { - sd->connected_subchannel_.reset(); + connected_subchannel_.reset(); + } + return true; +} + +template +void SubchannelData:: + OnConnectivityChangedLocked(void* arg, grpc_error* error) { + SubchannelData* sd = static_cast(arg); +// FIXME: add trace logging + if (!sd->UpdateConnectedSubchannelLocked()) { + // We don't want to report this connectivity state, so renew the watch. + sd->StartConnectivityWatchLocked(); + return; } // Now that we're inside the combiner, copy the pending connectivity // state (which was set by the connectivity state watcher) to From 09963465c8bcccfb1b9abcaf725e1740a64f310d Mon Sep 17 00:00:00 2001 From: Wenbo Zhu Date: Wed, 25 Apr 2018 10:22:29 -0700 Subject: [PATCH 085/165] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e1febd8ea74..21a9910e3ef 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ Libraries in different languages may be in different states of development. We a | Java | [grpc-java](http://github.com/grpc/grpc-java) | | Go | [grpc-go](http://github.com/grpc/grpc-go) | | NodeJS | [grpc-node](https://github.com/grpc/grpc-node) | +| WebJS | [grpc-web](https://github.com/grpc/grpc-web) | | Dart | [grpc-dart](https://github.com/grpc/grpc-dart) | -| WebJS | [grpc-web](https://github.com/grpc/grpc-web) | See [MANIFEST.md](MANIFEST.md) for a listing of top-level items in the repository. From b1c1309bfcbe7d8834965169d9e527528d477c2e Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 25 Apr 2018 12:39:45 -0700 Subject: [PATCH 086/165] Clean up refcounting. --- .../lb_policy/pick_first/pick_first.cc | 66 ++++--------------- .../lb_policy/round_robin/round_robin.cc | 40 +---------- .../lb_policy/subchannel_list.h | 29 +++++--- 3 files changed, 33 insertions(+), 102 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 24a0c83b1a6..0883a4ed6c3 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -90,9 +90,6 @@ class PickFirst : public LoadBalancingPolicy { const grpc_channel_args& args) : SubchannelList(policy, tracer, addresses, combiner, client_channel_factory, args) {} - - void RefForConnectivityWatch(const char* reason); - void UnrefForConnectivityWatch(const char* reason); }; void ShutdownLocked() override; @@ -220,9 +217,7 @@ void PickFirst::StartPickingLocked() { if (subchannel_list_ != nullptr) { for (size_t i = 0; i < subchannel_list_->num_subchannels(); ++i) { if (subchannel_list_->subchannel(i)->subchannel() != nullptr) { - subchannel_list_->RefForConnectivityWatch( - "connectivity_watch+start_picking"); - subchannel_list_->subchannel(i)->StartConnectivityWatchLocked(); + subchannel_list_->subchannel(i)->StartOrRenewConnectivityWatchLocked(); break; } } @@ -332,8 +327,7 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { // If we've started picking, start trying to connect to the first // subchannel in the new list. if (started_picking_) { - subchannel_list_->RefForConnectivityWatch("connectivity_watch+update"); - subchannel_list_->subchannel(0)->StartConnectivityWatchLocked(); + subchannel_list_->subchannel(0)->StartOrRenewConnectivityWatchLocked(); } } else { // We do have a selected subchannel. @@ -359,9 +353,7 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { } subchannel_list_ = std::move(subchannel_list); DestroyUnselectedSubchannelsLocked(); - subchannel_list_->RefForConnectivityWatch( - "connectivity_watch+replace_selected"); - sd->StartConnectivityWatchLocked(); + sd->StartOrRenewConnectivityWatchLocked(); // If there was a previously pending update (which may or may // not have contained the currently selected subchannel), drop // it, so that it doesn't override what we've done here. @@ -391,35 +383,12 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { // If we've started picking, start trying to connect to the first // subchannel in the new list. if (started_picking_) { - latest_pending_subchannel_list_->RefForConnectivityWatch( - "connectivity_watch+update"); latest_pending_subchannel_list_->subchannel(0) - ->StartConnectivityWatchLocked(); + ->StartOrRenewConnectivityWatchLocked(); } } } -void PickFirst::PickFirstSubchannelList::RefForConnectivityWatch( - const char* reason) { - // TODO(roth): We currently track these refs manually. Once the new - // ClosureRef API is ready, find a way to pass the RefCountedPtr<> - // along with the closures instead of doing this manually. - // Ref subchannel list. - Ref(DEBUG_LOCATION, reason).release(); - // Ref LB policy. - PickFirst* p = static_cast(policy()); - p->Ref(DEBUG_LOCATION, reason).release(); -} - -void PickFirst::PickFirstSubchannelList::UnrefForConnectivityWatch( - const char* reason) { - // Unref LB policy. - PickFirst* p = static_cast(policy()); - p->Unref(DEBUG_LOCATION, reason); - // Unref subchannel list. - Unref(DEBUG_LOCATION, reason); -} - void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( grpc_error* error) { PickFirst* p = static_cast(subchannel_list()->policy()); @@ -434,17 +403,8 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( grpc_connectivity_state_name(connectivity_state()), p->shutdown_, subchannel_list()->shutting_down(), grpc_error_string(error)); } -// FIXME: move this to SubchannelData::OnConnectivityChangedLocked() - // If the subchannel list is shutting down, stop watching. - if (subchannel_list()->shutting_down() || error == GRPC_ERROR_CANCELLED) { - StopConnectivityWatchLocked(); - UnrefSubchannelLocked("pf_sl_shutdown"); - subchannel_list()->UnrefForConnectivityWatch("pf_sl_shutdown"); - GRPC_ERROR_UNREF(error); - return; - } - // If we're still here, the notification must be for a subchannel in - // either the current or latest pending subchannel lists. + // The notification must be for a subchannel in either the current or + // latest pending subchannel lists. GPR_ASSERT(p->subchannel_list_ == subchannel_list() || p->latest_pending_subchannel_list_ == subchannel_list()); // Handle updates for the currently selected subchannel. @@ -455,8 +415,6 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( p->latest_pending_subchannel_list_ != nullptr) { p->selected_ = nullptr; StopConnectivityWatchLocked(); - subchannel_list()->UnrefForConnectivityWatch( - "selected_not_ready+switch_to_update"); subchannel_list()->ShutdownLocked("selected_not_ready+switch_to_update"); p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); grpc_connectivity_state_set( @@ -478,14 +436,13 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( p->TryReresolutionLocked(&grpc_lb_pick_first_trace, GRPC_ERROR_NONE); // In transient failure. Rely on re-resolution to recover. p->selected_ = nullptr; - StopConnectivityWatchLocked(); - subchannel_list()->UnrefForConnectivityWatch("pf_selected_shutdown"); UnrefSubchannelLocked("pf_selected_shutdown"); + StopConnectivityWatchLocked(); } else { grpc_connectivity_state_set(&p->state_tracker_, connectivity_state(), GRPC_ERROR_REF(error), "selected_changed"); // Renew notification. - StartConnectivityWatchLocked(); + StartOrRenewConnectivityWatchLocked(); } } GRPC_ERROR_UNREF(error); @@ -533,7 +490,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( GRPC_CLOSURE_SCHED(pick->on_complete, GRPC_ERROR_NONE); } // Renew notification. - StartConnectivityWatchLocked(); + StartOrRenewConnectivityWatchLocked(); break; } case GRPC_CHANNEL_TRANSIENT_FAILURE: { @@ -551,8 +508,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( &p->state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, GRPC_ERROR_REF(error), "connecting_transient_failure"); } - // Reuses the connectivity refs from the previous watch. - sd->StartConnectivityWatchLocked(); + sd->StartOrRenewConnectivityWatchLocked(); break; } case GRPC_CHANNEL_CONNECTING: @@ -564,7 +520,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( "connecting_changed"); } // Renew notification. - StartConnectivityWatchLocked(); + StartOrRenewConnectivityWatchLocked(); break; } case GRPC_CHANNEL_SHUTDOWN: diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 889616e0561..2b2c0e51327 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -134,10 +134,6 @@ class RoundRobin : public LoadBalancingPolicy { GRPC_ERROR_UNREF(last_transient_failure_error_); } - // Manages references for connectivity watches. - void RefForConnectivityWatch(const char* reason); - void UnrefForConnectivityWatch(const char* reason); - // Starts watching the subchannels in this list. void StartWatchingLocked(); @@ -377,6 +373,7 @@ bool RoundRobin::DoPickLocked(PickState* pick) { /* readily available, report right away */ RoundRobinSubchannelData* sd = subchannel_list_->subchannel(next_ready_index); + GPR_ASSERT(sd->connected_subchannel() != nullptr); pick->connected_subchannel = sd->connected_subchannel()->Ref(); if (pick->user_data != nullptr) { *pick->user_data = sd->user_data(); @@ -422,27 +419,6 @@ bool RoundRobin::PickLocked(PickState* pick) { return false; } -void RoundRobin::RoundRobinSubchannelList::RefForConnectivityWatch( - const char* reason) { - // TODO(roth): We currently track these refs manually. Once the new - // ClosureRef API is ready, find a way to pass the RefCountedPtr<> - // along with the closures instead of doing this manually. - // Ref subchannel list. - Ref(DEBUG_LOCATION, reason).release(); - // Ref LB policy. - RoundRobin* p = static_cast(policy()); - p->Ref(DEBUG_LOCATION, reason).release(); -} - -void RoundRobin::RoundRobinSubchannelList::UnrefForConnectivityWatch( - const char* reason) { - // Unref LB policy. - RoundRobin* p = static_cast(policy()); - p->Unref(DEBUG_LOCATION, reason); - // Unref subchannel list. - Unref(DEBUG_LOCATION, reason); -} - void RoundRobin::RoundRobinSubchannelList::StartWatchingLocked() { if (num_subchannels() == 0) return; // Check current state of each subchannel synchronously, since any @@ -474,8 +450,7 @@ void RoundRobin::RoundRobinSubchannelList::StartWatchingLocked() { // Start connectivity watch for each subchannel. for (size_t i = 0; i < num_subchannels(); i++) { if (subchannel(i)->subchannel() != nullptr) { - RefForConnectivityWatch("connectivity_watch"); - subchannel(i)->StartConnectivityWatchLocked(); + subchannel(i)->StartOrRenewConnectivityWatchLocked(); } } } @@ -597,15 +572,6 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( subchannel_list()->shutting_down(), grpc_error_string(error)); } GPR_ASSERT(subchannel() != nullptr); -// FIXME: move this to SubchannelData::OnConnectivityChangedLocked() - // If the subchannel list is shutting down, stop watching. - if (subchannel_list()->shutting_down() || error == GRPC_ERROR_CANCELLED) { - StopConnectivityWatchLocked(); - UnrefSubchannelLocked("rr_sl_shutdown"); - subchannel_list()->UnrefForConnectivityWatch("rr_sl_shutdown"); - GRPC_ERROR_UNREF(error); - return; - } // If the new state is TRANSIENT_FAILURE, re-resolve. // Only do this if we've started watching, not at startup time. // Otherwise, if the subchannel was already in state TRANSIENT_FAILURE @@ -628,7 +594,7 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( // If we've started watching, update overall state and renew notification. if (subchannel_list()->started_watching()) { subchannel_list()->UpdateRoundRobinStateFromSubchannelStateCountsLocked(); - StartConnectivityWatchLocked(); + StartOrRenewConnectivityWatchLocked(); } GRPC_ERROR_UNREF(error); } diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index b88719b7473..8b843b16c00 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -109,8 +109,8 @@ class SubchannelData { // Synchronously checks the subchannel's connectivity state. Calls // ProcessConnectivityChangeLocked() if the state has changed. // Must not be called while there is a connectivity notification - // pending (i.e., between calling StartConnectivityWatchLocked() and - // the resulting invocation of ProcessConnectivityChangeLocked()). + // pending (i.e., between calling StartOrRenewConnectivityWatchLocked() + // and the resulting invocation of ProcessConnectivityChangeLocked()). void CheckConnectivityStateLocked() { GPR_ASSERT(!connectivity_notification_pending_); grpc_error* error = GRPC_ERROR_NONE; @@ -133,15 +133,15 @@ class SubchannelData { // Starts or renewes watching the connectivity state of the subchannel. // ProcessConnectivityChangeLocked() will be called when the // connectivity state changes. - void StartConnectivityWatchLocked(); + void StartOrRenewConnectivityWatchLocked(); // Stops watching the connectivity state of the subchannel. void StopConnectivityWatchLocked(); // Cancels watching the connectivity state of the subchannel. // Must be called only while there is a connectivity notification - // pending (i.e., between calling StartConnectivityWatchLocked() and - // the resulting invocation of ProcessConnectivityChangeLocked()). + // pending (i.e., between calling StartOrRenewConnectivityWatchLocked() + // and the resulting invocation of ProcessConnectivityChangeLocked()). // From within ProcessConnectivityChangeLocked(), use // StopConnectivityWatchLocked() instead. void CancelConnectivityWatchLocked(const char* reason); @@ -159,8 +159,8 @@ class SubchannelData { virtual ~SubchannelData(); - // After StartConnectivityWatchLocked() is called, this method will be - // invoked when the subchannel's connectivity state changes. + // After StartOrRenewConnectivityWatchLocked() is called, this method + // will be invoked when the subchannel's connectivity state changes. // Implementations can use connectivity_state() to get the new // connectivity state. // Implementations must invoke either StopConnectivityWatch() or again @@ -302,7 +302,7 @@ void SubchannelData:: template void SubchannelData::StartConnectivityWatchLocked() { + SubchannelDataType>::StartOrRenewConnectivityWatchLocked() { if (subchannel_list_->tracer()->enabled()) { gpr_log(GPR_DEBUG, "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR @@ -313,7 +313,10 @@ void SubchannelDataRef(DEBUG_LOCATION, "connectivity_watch").release(); + connectivity_notification_pending_ = true; + } grpc_subchannel_notify_on_state_change( subchannel_, subchannel_list_->policy()->interested_parties(), &pending_connectivity_state_unsafe_, &connectivity_changed_closure_); @@ -332,6 +335,7 @@ void SubchannelDataUnref(DEBUG_LOCATION, "connectivity_watch"); } template @@ -387,9 +391,14 @@ void SubchannelData:: OnConnectivityChangedLocked(void* arg, grpc_error* error) { SubchannelData* sd = static_cast(arg); // FIXME: add trace logging + if (sd->subchannel_list()->shutting_down() || error == GRPC_ERROR_CANCELLED) { + sd->UnrefSubchannelLocked("connectivity_shutdown"); + sd->StopConnectivityWatchLocked(); + return; + } if (!sd->UpdateConnectedSubchannelLocked()) { // We don't want to report this connectivity state, so renew the watch. - sd->StartConnectivityWatchLocked(); + sd->StartOrRenewConnectivityWatchLocked(); return; } // Now that we're inside the combiner, copy the pending connectivity From 7f2880d2ac53bb28f35294720a5e953c36468a3b Mon Sep 17 00:00:00 2001 From: Yihua Zhang Date: Wed, 25 Apr 2018 13:07:45 -0700 Subject: [PATCH 087/165] enable c++ for ALTS kokoro tests --- src/core/lib/security/transport/security_handshaker.cc | 6 ++++++ tools/run_tests/run_interop_tests.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/lib/security/transport/security_handshaker.cc b/src/core/lib/security/transport/security_handshaker.cc index 57dd3406bc7..daeedf48105 100644 --- a/src/core/lib/security/transport/security_handshaker.cc +++ b/src/core/lib/security/transport/security_handshaker.cc @@ -232,6 +232,12 @@ static grpc_error* on_handshake_next_done_locked( const unsigned char* bytes_to_send, size_t bytes_to_send_size, tsi_handshaker_result* handshaker_result) { grpc_error* error = GRPC_ERROR_NONE; + + // Handshaker was shutdown. + if (h->shutdown) { + security_handshake_failed_locked(h, GRPC_ERROR_REF(error)); + return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Handshaker shutdown"); + } // Read more if we need to. if (result == TSI_INCOMPLETE_DATA) { GPR_ASSERT(bytes_to_send_size == 0); diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 56aee6419ea..1f5a2df2856 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -638,10 +638,10 @@ _LANGUAGES_WITH_HTTP2_CLIENTS_FOR_HTTP2_SERVER_TEST_CASES = [ ] #TODO: Add c++ when c++ ALTS interop client is ready. -_LANGUAGES_FOR_ALTS_TEST_CASES = ['java', 'go'] +_LANGUAGES_FOR_ALTS_TEST_CASES = ['java', 'go', 'c++'] #TODO: Add c++ when c++ ALTS interop server is ready. -_SERVERS_FOR_ALTS_TEST_CASES = ['java', 'go'] +_SERVERS_FOR_ALTS_TEST_CASES = ['java', 'go', 'c++'] _TRANSPORT_SECURITY_OPTIONS = ['tls', 'alts', 'insecure'] From 48854d20614108cf1ee9b4f0141c4b9f4eb5b233 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 25 Apr 2018 13:05:26 -0700 Subject: [PATCH 088/165] Change trace logging to use GPR_INFO instead of GPR_DEBUG. --- .../filters/client_channel/client_channel.cc | 151 +++++++++--------- .../ext/filters/client_channel/lb_policy.cc | 4 +- .../client_channel/lb_policy/grpclb/grpclb.cc | 17 +- .../lb_policy/pick_first/pick_first.cc | 10 +- .../lb_policy/round_robin/round_robin.cc | 31 ++-- .../lb_policy/subchannel_list.cc | 22 +-- .../message_compress_filter.cc | 4 +- .../chttp2/transport/chttp2_transport.cc | 25 ++- .../chttp2/transport/frame_settings.cc | 6 +- .../chttp2/transport/hpack_encoder.cc | 4 +- .../chttp2/transport/hpack_parser.cc | 2 +- .../transport/chttp2/transport/hpack_table.cc | 4 +- .../chttp2/transport/stream_lists.cc | 6 +- .../ext/transport/chttp2/transport/writing.cc | 10 +- .../ext/transport/inproc/inproc_transport.cc | 84 +++++----- src/core/lib/channel/handshaker.cc | 8 +- src/core/lib/gprpp/orphanable.h | 4 +- src/core/lib/gprpp/ref_counted.h | 4 +- src/core/lib/iomgr/call_combiner.cc | 26 +-- src/core/lib/iomgr/combiner.cc | 22 +-- src/core/lib/iomgr/ev_epoll1_linux.cc | 48 +++--- src/core/lib/iomgr/ev_epollex_linux.cc | 54 +++---- src/core/lib/iomgr/ev_epollsig_linux.cc | 4 +- src/core/lib/iomgr/ev_poll_posix.cc | 6 +- src/core/lib/iomgr/ev_posix.cc | 6 +- src/core/lib/iomgr/executor.cc | 12 +- src/core/lib/iomgr/resource_quota.cc | 21 ++- src/core/lib/iomgr/tcp_client_custom.cc | 4 +- src/core/lib/iomgr/tcp_client_posix.cc | 8 +- src/core/lib/iomgr/tcp_custom.cc | 20 +-- src/core/lib/iomgr/tcp_posix.cc | 48 +++--- src/core/lib/iomgr/tcp_server_custom.cc | 10 +- src/core/lib/iomgr/tcp_server_posix.cc | 2 +- src/core/lib/iomgr/timer_generic.cc | 34 ++-- src/core/lib/iomgr/timer_manager.cc | 23 ++- .../lib/security/transport/secure_endpoint.cc | 4 +- src/core/lib/surface/call.cc | 4 +- src/core/lib/transport/bdp_estimator.cc | 6 +- src/core/lib/transport/bdp_estimator.h | 4 +- src/core/lib/transport/connectivity_state.cc | 13 +- 40 files changed, 383 insertions(+), 392 deletions(-) diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index 33cf56519ef..875af66168c 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -174,7 +174,7 @@ static void set_channel_connectivity_state_locked(channel_data* chand, } } if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p: setting connectivity state to %s", chand, + gpr_log(GPR_INFO, "chand=%p: setting connectivity state to %s", chand, grpc_connectivity_state_name(state)); } grpc_connectivity_state_set(&chand->state_tracker, state, error, reason); @@ -186,7 +186,7 @@ static void on_lb_policy_state_changed_locked(void* arg, grpc_error* error) { /* check if the notification is for the latest policy */ if (w->lb_policy == w->chand->lb_policy.get()) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p: lb_policy=%p state changed to %s", w->chand, + gpr_log(GPR_INFO, "chand=%p: lb_policy=%p state changed to %s", w->chand, w->lb_policy, grpc_connectivity_state_name(w->state)); } set_channel_connectivity_state_locked(w->chand, w->state, @@ -215,7 +215,7 @@ static void watch_lb_policy_locked(channel_data* chand, static void start_resolving_locked(channel_data* chand) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p: starting name resolution", chand); + gpr_log(GPR_INFO, "chand=%p: starting name resolution", chand); } GPR_ASSERT(!chand->started_resolving); chand->started_resolving = true; @@ -297,7 +297,7 @@ static void request_reresolution_locked(void* arg, grpc_error* error) { return; } if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p: started name re-resolving", chand); + gpr_log(GPR_INFO, "chand=%p: started name re-resolving", chand); } chand->resolver->RequestReresolutionLocked(); // Give back the closure to the LB policy. @@ -311,7 +311,7 @@ static void request_reresolution_locked(void* arg, grpc_error* error) { static void on_resolver_result_changed_locked(void* arg, grpc_error* error) { channel_data* chand = static_cast(arg); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p: got resolver result: resolver_result=%p error=%s", chand, chand->resolver_result, grpc_error_string(error)); } @@ -431,7 +431,7 @@ static void on_resolver_result_changed_locked(void* arg, grpc_error* error) { } } if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p: resolver result: lb_policy_name=\"%s\"%s, " "service_config=\"%s\"", chand, lb_policy_name_dup, @@ -466,7 +466,7 @@ static void on_resolver_result_changed_locked(void* arg, grpc_error* error) { chand->resolver == nullptr) { if (chand->lb_policy != nullptr) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p: unreffing lb_policy=%p", chand, + gpr_log(GPR_INFO, "chand=%p: unreffing lb_policy=%p", chand, chand->lb_policy.get()); } grpc_pollset_set_del_pollset_set(chand->lb_policy->interested_parties(), @@ -480,11 +480,11 @@ static void on_resolver_result_changed_locked(void* arg, grpc_error* error) { // error or shutdown. if (error != GRPC_ERROR_NONE || chand->resolver == nullptr) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p: shutting down", chand); + gpr_log(GPR_INFO, "chand=%p: shutting down", chand); } if (chand->resolver != nullptr) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p: shutting down resolver", chand); + gpr_log(GPR_INFO, "chand=%p: shutting down resolver", chand); } chand->resolver.reset(); } @@ -506,7 +506,7 @@ static void on_resolver_result_changed_locked(void* arg, grpc_error* error) { GRPC_ERROR_CREATE_FROM_STATIC_STRING("No load balancing policy"); if (lb_policy_created) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p: initializing new LB policy", chand); + gpr_log(GPR_INFO, "chand=%p: initializing new LB policy", chand); } GRPC_ERROR_UNREF(state_error); state = chand->lb_policy->CheckConnectivityLocked(&state_error); @@ -999,7 +999,7 @@ static void maybe_cache_send_ops_for_batch(call_data* calld, static void free_cached_send_initial_metadata(channel_data* chand, call_data* calld) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: destroying calld->send_initial_metadata", chand, calld); } @@ -1010,7 +1010,7 @@ static void free_cached_send_initial_metadata(channel_data* chand, static void free_cached_send_message(channel_data* chand, call_data* calld, size_t idx) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: destroying calld->send_messages[%" PRIuPTR "]", chand, calld, idx); } @@ -1021,7 +1021,7 @@ static void free_cached_send_message(channel_data* chand, call_data* calld, static void free_cached_send_trailing_metadata(channel_data* chand, call_data* calld) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: destroying calld->send_trailing_metadata", chand, calld); } @@ -1088,7 +1088,7 @@ static void pending_batches_add(grpc_call_element* elem, call_data* calld = static_cast(elem->call_data); const size_t idx = get_batch_index(batch); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: adding pending batch at index %" PRIuPTR, chand, calld, idx); } @@ -1116,7 +1116,7 @@ static void pending_batches_add(grpc_call_element* elem, } if (calld->bytes_buffered_for_retry > chand->per_rpc_retry_buffer_size) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: exceeded retry buffer size, committing", chand, calld); } @@ -1131,7 +1131,7 @@ static void pending_batches_add(grpc_call_element* elem, // retries are disabled so that we don't bother with retry overhead. if (calld->num_attempts_completed == 0) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: disabling retries before first attempt", chand, calld); } @@ -1178,7 +1178,7 @@ static void pending_batches_fail(grpc_call_element* elem, grpc_error* error, for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches); ++i) { if (calld->pending_batches[i].batch != nullptr) ++num_batches; } - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: failing %" PRIuPTR " pending batches: %s", elem->channel_data, calld, num_batches, grpc_error_string(error)); } @@ -1240,7 +1240,7 @@ static void pending_batches_resume(grpc_call_element* elem) { for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches); ++i) { if (calld->pending_batches[i].batch != nullptr) ++num_batches; } - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: starting %" PRIuPTR " pending batches on subchannel_call=%p", chand, calld, num_batches, calld->subchannel_call); @@ -1285,7 +1285,7 @@ static void maybe_clear_pending_batch(grpc_call_element* elem, (!batch->recv_message || batch->payload->recv_message.recv_message_ready == nullptr)) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: clearing pending batch", chand, + gpr_log(GPR_INFO, "chand=%p calld=%p: clearing pending batch", chand, calld); } pending_batch_clear(calld, pending); @@ -1375,7 +1375,7 @@ static void retry_commit(grpc_call_element* elem, if (calld->retry_committed) return; calld->retry_committed = true; if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: committing retries", chand, calld); + gpr_log(GPR_INFO, "chand=%p calld=%p: committing retries", chand, calld); } if (retry_state != nullptr) { free_cached_send_op_data_after_commit(elem, retry_state); @@ -1420,7 +1420,7 @@ static void do_retry(grpc_call_element* elem, next_attempt_time = calld->retry_backoff->NextAttemptTime(); } if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: retrying failed call in %" PRIuPTR " ms", chand, calld, next_attempt_time - grpc_core::ExecCtx::Get()->Now()); } @@ -1454,7 +1454,7 @@ static bool maybe_retry(grpc_call_element* elem, batch_data->subchannel_call)); if (retry_state->retry_dispatched) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: retry already dispatched", chand, + gpr_log(GPR_INFO, "chand=%p calld=%p: retry already dispatched", chand, calld); } return true; @@ -1466,14 +1466,14 @@ static bool maybe_retry(grpc_call_element* elem, calld->retry_throttle_data->RecordSuccess(); } if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: call succeeded", chand, calld); + gpr_log(GPR_INFO, "chand=%p calld=%p: call succeeded", chand, calld); } return false; } // Status is not OK. Check whether the status is retryable. if (!retry_policy->retryable_status_codes.Contains(status)) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: status %s not configured as retryable", chand, calld, grpc_status_code_to_string(status)); } @@ -1489,14 +1489,14 @@ static bool maybe_retry(grpc_call_element* elem, if (calld->retry_throttle_data != nullptr && !calld->retry_throttle_data->RecordFailure()) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: retries throttled", chand, calld); + gpr_log(GPR_INFO, "chand=%p calld=%p: retries throttled", chand, calld); } return false; } // Check whether the call is committed. if (calld->retry_committed) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: retries already committed", chand, + gpr_log(GPR_INFO, "chand=%p calld=%p: retries already committed", chand, calld); } return false; @@ -1505,7 +1505,7 @@ static bool maybe_retry(grpc_call_element* elem, ++calld->num_attempts_completed; if (calld->num_attempts_completed >= retry_policy->max_attempts) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: exceeded %d retry attempts", chand, + gpr_log(GPR_INFO, "chand=%p calld=%p: exceeded %d retry attempts", chand, calld, retry_policy->max_attempts); } return false; @@ -1513,7 +1513,7 @@ static bool maybe_retry(grpc_call_element* elem, // If the call was cancelled from the surface, don't retry. if (calld->cancel_error != GRPC_ERROR_NONE) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: call cancelled from surface, not retrying", chand, calld); } @@ -1526,16 +1526,15 @@ static bool maybe_retry(grpc_call_element* elem, uint32_t ms; if (!grpc_parse_slice_to_uint32(GRPC_MDVALUE(*server_pushback_md), &ms)) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: not retrying due to server push-back", chand, calld); } return false; } else { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, - "chand=%p calld=%p: server push-back: retry in %u ms", chand, - calld, ms); + gpr_log(GPR_INFO, "chand=%p calld=%p: server push-back: retry in %u ms", + chand, calld, ms); } server_pushback_ms = (grpc_millis)ms; } @@ -1608,7 +1607,7 @@ static void invoke_recv_initial_metadata_callback(void* arg, batch->payload->recv_initial_metadata.recv_initial_metadata_ready != nullptr) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: invoking recv_initial_metadata_ready for " "pending batch at index %" PRIuPTR, chand, calld, i); @@ -1644,7 +1643,7 @@ static void recv_initial_metadata_ready(void* arg, grpc_error* error) { channel_data* chand = static_cast(elem->channel_data); call_data* calld = static_cast(elem->call_data); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: got recv_initial_metadata_ready, error=%s", chand, calld, grpc_error_string(error)); } @@ -1659,7 +1658,7 @@ static void recv_initial_metadata_ready(void* arg, grpc_error* error) { if ((batch_data->trailing_metadata_available || error != GRPC_ERROR_NONE) && !retry_state->completed_recv_trailing_metadata) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: deferring recv_initial_metadata_ready " "(Trailers-Only)", chand, calld); @@ -1701,7 +1700,7 @@ static void invoke_recv_message_callback(void* arg, grpc_error* error) { if (batch != nullptr && batch->recv_message && batch->payload->recv_message.recv_message_ready != nullptr) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: invoking recv_message_ready for " "pending batch at index %" PRIuPTR, chand, calld, i); @@ -1734,7 +1733,7 @@ static void recv_message_ready(void* arg, grpc_error* error) { channel_data* chand = static_cast(elem->channel_data); call_data* calld = static_cast(elem->call_data); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: got recv_message_ready, error=%s", + gpr_log(GPR_INFO, "chand=%p calld=%p: got recv_message_ready, error=%s", chand, calld, grpc_error_string(error)); } subchannel_call_retry_state* retry_state = @@ -1748,7 +1747,7 @@ static void recv_message_ready(void* arg, grpc_error* error) { if ((batch_data->recv_message == nullptr || error != GRPC_ERROR_NONE) && !retry_state->completed_recv_trailing_metadata) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: deferring recv_message_ready (nullptr " "message and recv_trailing_metadata pending)", chand, calld); @@ -1796,7 +1795,7 @@ static void execute_closures_in_call_combiner(grpc_call_element* elem, // have to re-enter the call combiner. if (num_closures > 0) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: %s starting closure: %s", chand, + gpr_log(GPR_INFO, "chand=%p calld=%p: %s starting closure: %s", chand, calld, caller, closures[0].reason); } GRPC_CLOSURE_SCHED(closures[0].closure, closures[0].error); @@ -1805,7 +1804,7 @@ static void execute_closures_in_call_combiner(grpc_call_element* elem, } for (size_t i = 1; i < num_closures; ++i) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: %s starting closure in call combiner: %s", chand, calld, caller, closures[i].reason); } @@ -1817,7 +1816,7 @@ static void execute_closures_in_call_combiner(grpc_call_element* elem, } } else { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: no closures to run for %s", chand, + gpr_log(GPR_INFO, "chand=%p calld=%p: no closures to run for %s", chand, calld, caller); } GRPC_CALL_COMBINER_STOP(calld->call_combiner, "no closures to run"); @@ -1912,7 +1911,7 @@ static void add_closures_for_replay_or_pending_send_ops( } if (have_pending_send_message_ops || have_pending_send_trailing_metadata_op) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: starting next batch for pending send op(s)", chand, calld); } @@ -1937,7 +1936,7 @@ static void add_closures_for_completed_pending_batches( pending_batch* pending = &calld->pending_batches[i]; if (pending_batch_is_completed(pending, calld, retry_state)) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: pending batch completed at index %" PRIuPTR, chand, calld, i); } @@ -1970,7 +1969,7 @@ static void add_closures_to_fail_unstarted_pending_batches( pending_batch* pending = &calld->pending_batches[i]; if (pending_batch_is_unstarted(pending, calld, retry_state)) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: failing unstarted pending batch at index " "%" PRIuPTR, chand, calld, i); @@ -2014,7 +2013,7 @@ static void on_complete(void* arg, grpc_error* error) { call_data* calld = static_cast(elem->call_data); if (grpc_client_channel_trace.enabled()) { char* batch_str = grpc_transport_stream_op_batch_string(&batch_data->batch); - gpr_log(GPR_DEBUG, "chand=%p calld=%p: got on_complete, error=%s, batch=%s", + gpr_log(GPR_INFO, "chand=%p calld=%p: got on_complete, error=%s, batch=%s", chand, calld, grpc_error_string(error), batch_str); gpr_free(batch_str); } @@ -2031,7 +2030,7 @@ static void on_complete(void* arg, grpc_error* error) { update_retry_state_for_completed_batch(batch_data, retry_state); if (call_finished) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: call already finished", chand, + gpr_log(GPR_INFO, "chand=%p calld=%p: call already finished", chand, calld); } } else { @@ -2059,7 +2058,7 @@ static void on_complete(void* arg, grpc_error* error) { // If the call just finished, check if we should retry. if (call_finished) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: call finished, status=%s", chand, + gpr_log(GPR_INFO, "chand=%p calld=%p: call finished, status=%s", chand, calld, grpc_status_code_to_string(status)); } if (maybe_retry(elem, batch_data, status, server_pushback_md)) { @@ -2224,7 +2223,7 @@ static void add_retriable_send_message_op( channel_data* chand = static_cast(elem->channel_data); call_data* calld = static_cast(elem->call_data); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: starting calld->send_messages[%" PRIuPTR "]", chand, calld, retry_state->started_send_message_count); } @@ -2311,7 +2310,7 @@ static void start_internal_recv_trailing_metadata(grpc_call_element* elem) { channel_data* chand = static_cast(elem->channel_data); call_data* calld = static_cast(elem->call_data); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: call failed but recv_trailing_metadata not " "started; starting it internally", chand, calld); @@ -2343,7 +2342,7 @@ static subchannel_batch_data* maybe_create_subchannel_batch_for_replay( !retry_state->started_send_initial_metadata && !calld->pending_send_initial_metadata) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: replaying previously completed " "send_initial_metadata op", chand, calld); @@ -2359,7 +2358,7 @@ static subchannel_batch_data* maybe_create_subchannel_batch_for_replay( retry_state->completed_send_message_count && !calld->pending_send_message) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: replaying previously completed " "send_message op", chand, calld); @@ -2378,7 +2377,7 @@ static subchannel_batch_data* maybe_create_subchannel_batch_for_replay( !retry_state->started_send_trailing_metadata && !calld->pending_send_trailing_metadata) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: replaying previously completed " "send_trailing_metadata op", chand, calld); @@ -2518,7 +2517,7 @@ static void start_retriable_subchannel_batches(void* arg, grpc_error* ignored) { channel_data* chand = static_cast(elem->channel_data); call_data* calld = static_cast(elem->call_data); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: constructing retriable batches", + gpr_log(GPR_INFO, "chand=%p calld=%p: constructing retriable batches", chand, calld); } subchannel_call_retry_state* retry_state = @@ -2541,7 +2540,7 @@ static void start_retriable_subchannel_batches(void* arg, grpc_error* ignored) { &num_closures); // Start batches on subchannel call. if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: starting %" PRIuPTR " retriable batches on subchannel_call=%p", chand, calld, num_closures, calld->subchannel_call); @@ -2572,7 +2571,7 @@ static void create_subchannel_call(grpc_call_element* elem, grpc_error* error) { grpc_error* new_error = calld->pick.connected_subchannel->CreateCall( call_args, &calld->subchannel_call); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: create subchannel_call=%p: error=%s", + gpr_log(GPR_INFO, "chand=%p calld=%p: create subchannel_call=%p: error=%s", chand, calld, calld->subchannel_call, grpc_error_string(new_error)); } if (new_error != GRPC_ERROR_NONE) { @@ -2613,7 +2612,7 @@ static void pick_done(void* arg, grpc_error* error) { : GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( "Failed to create subchannel", &error, 1); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: failed to create subchannel: error=%s", chand, calld, grpc_error_string(new_error)); } @@ -2657,7 +2656,7 @@ static void pick_callback_cancel_locked(void* arg, grpc_error* error) { // the one we started it on. However, this will just be a no-op. if (error != GRPC_ERROR_NONE && chand->lb_policy != nullptr) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: cancelling pick from LB policy %p", + gpr_log(GPR_INFO, "chand=%p calld=%p: cancelling pick from LB policy %p", chand, calld, chand->lb_policy.get()); } chand->lb_policy->CancelPickLocked(&calld->pick, GRPC_ERROR_REF(error)); @@ -2672,8 +2671,8 @@ static void pick_callback_done_locked(void* arg, grpc_error* error) { channel_data* chand = static_cast(elem->channel_data); call_data* calld = static_cast(elem->call_data); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: pick completed asynchronously", - chand, calld); + gpr_log(GPR_INFO, "chand=%p calld=%p: pick completed asynchronously", chand, + calld); } async_pick_done_locked(elem, GRPC_ERROR_REF(error)); GRPC_CALL_STACK_UNREF(calld->owning_call, "pick_callback"); @@ -2685,7 +2684,7 @@ static void apply_service_config_to_call_locked(grpc_call_element* elem) { channel_data* chand = static_cast(elem->channel_data); call_data* calld = static_cast(elem->call_data); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: applying service config to call", + gpr_log(GPR_INFO, "chand=%p calld=%p: applying service config to call", chand, calld); } if (chand->retry_throttle_data != nullptr) { @@ -2723,8 +2722,8 @@ static bool pick_callback_start_locked(grpc_call_element* elem) { channel_data* chand = static_cast(elem->channel_data); call_data* calld = static_cast(elem->call_data); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: starting pick on lb_policy=%p", - chand, calld, chand->lb_policy.get()); + gpr_log(GPR_INFO, "chand=%p calld=%p: starting pick on lb_policy=%p", chand, + calld, chand->lb_policy.get()); } // Only get service config data on the first attempt. if (calld->num_attempts_completed == 0) { @@ -2771,7 +2770,7 @@ static bool pick_callback_start_locked(grpc_call_element* elem) { if (pick_done) { // Pick completed synchronously. if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: pick completed synchronously", + gpr_log(GPR_INFO, "chand=%p calld=%p: pick completed synchronously", chand, calld); } GRPC_CALL_STACK_UNREF(calld->owning_call, "pick_callback"); @@ -2815,7 +2814,7 @@ static void pick_after_resolver_result_cancel_locked(void* arg, channel_data* chand = static_cast(elem->channel_data); call_data* calld = static_cast(elem->call_data); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: cancelling pick waiting for resolver result", chand, calld); } @@ -2835,7 +2834,7 @@ static void pick_after_resolver_result_done_locked(void* arg, if (args->finished) { /* cancelled, do nothing */ if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "call cancelled before resolver result"); + gpr_log(GPR_INFO, "call cancelled before resolver result"); } gpr_free(args); return; @@ -2846,14 +2845,14 @@ static void pick_after_resolver_result_done_locked(void* arg, call_data* calld = static_cast(elem->call_data); if (error != GRPC_ERROR_NONE) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: resolver failed to return data", + gpr_log(GPR_INFO, "chand=%p calld=%p: resolver failed to return data", chand, calld); } async_pick_done_locked(elem, GRPC_ERROR_REF(error)); } else if (chand->resolver == nullptr) { // Shutting down. if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: resolver disconnected", chand, + gpr_log(GPR_INFO, "chand=%p calld=%p: resolver disconnected", chand, calld); } async_pick_done_locked( @@ -2869,7 +2868,7 @@ static void pick_after_resolver_result_done_locked(void* arg, .send_initial_metadata_flags; if (send_initial_metadata_flags & GRPC_INITIAL_METADATA_WAIT_FOR_READY) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: resolver returned but no LB policy; " "wait_for_ready=true; trying again", chand, calld); @@ -2877,7 +2876,7 @@ static void pick_after_resolver_result_done_locked(void* arg, pick_after_resolver_result_start_locked(elem); } else { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: resolver returned but no LB policy; " "wait_for_ready=false; failing", chand, calld); @@ -2890,7 +2889,7 @@ static void pick_after_resolver_result_done_locked(void* arg, } } else { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: resolver returned, doing pick", + gpr_log(GPR_INFO, "chand=%p calld=%p: resolver returned, doing pick", chand, calld); } if (pick_callback_start_locked(elem)) { @@ -2908,7 +2907,7 @@ static void pick_after_resolver_result_start_locked(grpc_call_element* elem) { channel_data* chand = static_cast(elem->channel_data); call_data* calld = static_cast(elem->call_data); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: deferring pick pending resolver result", chand, calld); } @@ -2975,7 +2974,7 @@ static void cc_start_transport_stream_op_batch( // If we've previously been cancelled, immediately fail any new batches. if (calld->cancel_error != GRPC_ERROR_NONE) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: failing batch with error: %s", + gpr_log(GPR_INFO, "chand=%p calld=%p: failing batch with error: %s", chand, calld, grpc_error_string(calld->cancel_error)); } // Note: This will release the call combiner. @@ -2994,7 +2993,7 @@ static void cc_start_transport_stream_op_batch( calld->cancel_error = GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error); if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: recording cancel_error=%s", chand, + gpr_log(GPR_INFO, "chand=%p calld=%p: recording cancel_error=%s", chand, calld, grpc_error_string(calld->cancel_error)); } // If we do not have a subchannel call (i.e., a pick has not yet @@ -3020,7 +3019,7 @@ static void cc_start_transport_stream_op_batch( // streaming calls). if (calld->subchannel_call != nullptr) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: starting batch on subchannel_call=%p", chand, calld, calld->subchannel_call); } @@ -3032,7 +3031,7 @@ static void cc_start_transport_stream_op_batch( // combiner to start a pick. if (batch->send_initial_metadata) { if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, "chand=%p calld=%p: entering client_channel combiner", + gpr_log(GPR_INFO, "chand=%p calld=%p: entering client_channel combiner", chand, calld); } GRPC_CLOSURE_SCHED( @@ -3042,7 +3041,7 @@ static void cc_start_transport_stream_op_batch( } else { // For all other batches, release the call combiner. if (grpc_client_channel_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "chand=%p calld=%p: saved batch, yeilding call combiner", chand, calld); } diff --git a/src/core/ext/filters/client_channel/lb_policy.cc b/src/core/ext/filters/client_channel/lb_policy.cc index fa63dd75b5c..e065f45639b 100644 --- a/src/core/ext/filters/client_channel/lb_policy.cc +++ b/src/core/ext/filters/client_channel/lb_policy.cc @@ -44,13 +44,13 @@ void LoadBalancingPolicy::TryReresolutionLocked( GRPC_CLOSURE_SCHED(request_reresolution_, error); request_reresolution_ = nullptr; if (grpc_lb_trace->enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "%s %p: scheduling re-resolution closure with error=%s.", grpc_lb_trace->name(), this, grpc_error_string(error)); } } else { if (grpc_lb_trace->enabled()) { - gpr_log(GPR_DEBUG, "%s %p: no available re-resolution closure.", + gpr_log(GPR_INFO, "%s %p: no available re-resolution closure.", grpc_lb_trace->name(), this); } } diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 097ff112f9a..1a675476f07 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -1247,7 +1247,7 @@ bool GrpcLb::PickLocked(PickState* pick) { } } else { // rr_policy_ == NULL if (grpc_lb_glb_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "[grpclb %p] No RR policy. Adding to grpclb's pending picks", this); } @@ -1413,14 +1413,13 @@ void GrpcLb::OnFallbackTimerLocked(void* arg, grpc_error* error) { void GrpcLb::StartBalancerCallRetryTimerLocked() { grpc_millis next_try = lb_call_backoff_.NextAttemptTime(); if (grpc_lb_glb_trace.enabled()) { - gpr_log(GPR_DEBUG, "[grpclb %p] Connection to LB server lost...", this); + gpr_log(GPR_INFO, "[grpclb %p] Connection to LB server lost...", this); grpc_millis timeout = next_try - ExecCtx::Get()->Now(); if (timeout > 0) { - gpr_log(GPR_DEBUG, - "[grpclb %p] ... retry_timer_active in %" PRIuPTR "ms.", this, - timeout); + gpr_log(GPR_INFO, "[grpclb %p] ... retry_timer_active in %" PRIuPTR "ms.", + this, timeout); } else { - gpr_log(GPR_DEBUG, "[grpclb %p] ... retry_timer_active immediately.", + gpr_log(GPR_INFO, "[grpclb %p] ... retry_timer_active immediately.", this); } } @@ -1728,7 +1727,7 @@ void GrpcLb::CreateOrUpdateRoundRobinPolicyLocked() { GPR_ASSERT(args != nullptr); if (rr_policy_ != nullptr) { if (grpc_lb_glb_trace.enabled()) { - gpr_log(GPR_DEBUG, "[grpclb %p] Updating RR policy %p", this, + gpr_log(GPR_INFO, "[grpclb %p] Updating RR policy %p", this, rr_policy_.get()); } rr_policy_->UpdateLocked(*args); @@ -1739,7 +1738,7 @@ void GrpcLb::CreateOrUpdateRoundRobinPolicyLocked() { lb_policy_args.args = args; CreateRoundRobinPolicyLocked(lb_policy_args); if (grpc_lb_glb_trace.enabled()) { - gpr_log(GPR_DEBUG, "[grpclb %p] Created new RR policy %p", this, + gpr_log(GPR_INFO, "[grpclb %p] Created new RR policy %p", this, rr_policy_.get()); } } @@ -1755,7 +1754,7 @@ void GrpcLb::OnRoundRobinRequestReresolutionLocked(void* arg, } if (grpc_lb_glb_trace.enabled()) { gpr_log( - GPR_DEBUG, + GPR_INFO, "[grpclb %p] Re-resolution requested from the internal RR policy (%p).", grpclb_policy, grpclb_policy->rr_policy_.get()); } diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 9090c344123..a07e90322c5 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -95,7 +95,7 @@ PickFirst::PickFirst(const Args& args) : LoadBalancingPolicy(args) { grpc_connectivity_state_init(&state_tracker_, GRPC_CHANNEL_IDLE, "pick_first"); if (grpc_lb_pick_first_trace.enabled()) { - gpr_log(GPR_DEBUG, "Pick First %p created.", this); + gpr_log(GPR_INFO, "Pick First %p created.", this); } UpdateLocked(*args.args); grpc_subchannel_index_ref(); @@ -103,7 +103,7 @@ PickFirst::PickFirst(const Args& args) : LoadBalancingPolicy(args) { PickFirst::~PickFirst() { if (grpc_lb_pick_first_trace.enabled()) { - gpr_log(GPR_DEBUG, "Destroying Pick First %p", this); + gpr_log(GPR_INFO, "Destroying Pick First %p", this); } GPR_ASSERT(subchannel_list_ == nullptr); GPR_ASSERT(latest_pending_subchannel_list_ == nullptr); @@ -126,7 +126,7 @@ void PickFirst::HandOffPendingPicksLocked(LoadBalancingPolicy* new_policy) { void PickFirst::ShutdownLocked() { grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel shutdown"); if (grpc_lb_pick_first_trace.enabled()) { - gpr_log(GPR_DEBUG, "Pick First %p Shutting down", this); + gpr_log(GPR_INFO, "Pick First %p Shutting down", this); } shutdown_ = true; PickState* pick; @@ -372,7 +372,7 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { // subchannel list. if (latest_pending_subchannel_list_ != nullptr) { if (grpc_lb_pick_first_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "Pick First %p Shutting down latest pending subchannel list " "%p, about to be replaced by newer latest %p", this, latest_pending_subchannel_list_, subchannel_list); @@ -396,7 +396,7 @@ void PickFirst::OnConnectivityChangedLocked(void* arg, grpc_error* error) { grpc_lb_subchannel_data* sd = static_cast(arg); PickFirst* p = static_cast(sd->subchannel_list->policy); if (grpc_lb_pick_first_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "Pick First %p connectivity changed for subchannel %p (%" PRIuPTR " of %" PRIuPTR "), subchannel_list %p: state=%s p->shutdown_=%d " diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index e534131c02c..b470016bd99 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -114,7 +114,7 @@ RoundRobin::RoundRobin(const Args& args) : LoadBalancingPolicy(args) { "round_robin"); UpdateLocked(*args.args); if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, "[RR %p] Created with %" PRIuPTR " subchannels", this, + gpr_log(GPR_INFO, "[RR %p] Created with %" PRIuPTR " subchannels", this, subchannel_list_->num_subchannels); } grpc_subchannel_index_ref(); @@ -122,7 +122,7 @@ RoundRobin::RoundRobin(const Args& args) : LoadBalancingPolicy(args) { RoundRobin::~RoundRobin() { if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, "[RR %p] Destroying Round Robin policy", this); + gpr_log(GPR_INFO, "[RR %p] Destroying Round Robin policy", this); } GPR_ASSERT(subchannel_list_ == nullptr); GPR_ASSERT(latest_pending_subchannel_list_ == nullptr); @@ -152,7 +152,7 @@ size_t RoundRobin::GetNextReadySubchannelIndexLocked() { subchannel_list_->num_subchannels; if (grpc_lb_round_robin_trace.enabled()) { gpr_log( - GPR_DEBUG, + GPR_INFO, "[RR %p] checking subchannel %p, subchannel_list %p, index %" PRIuPTR ": state=%s", this, subchannel_list_->subchannels[index].subchannel, @@ -163,7 +163,7 @@ size_t RoundRobin::GetNextReadySubchannelIndexLocked() { if (subchannel_list_->subchannels[index].curr_connectivity_state == GRPC_CHANNEL_READY) { if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "[RR %p] found next ready subchannel (%p) at index %" PRIuPTR " of subchannel_list %p", this, subchannel_list_->subchannels[index].subchannel, index, @@ -173,7 +173,7 @@ size_t RoundRobin::GetNextReadySubchannelIndexLocked() { } } if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, "[RR %p] no subchannels in ready state", this); + gpr_log(GPR_INFO, "[RR %p] no subchannels in ready state", this); } return subchannel_list_->num_subchannels; } @@ -183,7 +183,7 @@ void RoundRobin::UpdateLastReadySubchannelIndexLocked(size_t last_ready_index) { GPR_ASSERT(last_ready_index < subchannel_list_->num_subchannels); last_ready_subchannel_index_ = last_ready_index; if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "[RR %p] setting last_ready_subchannel_index=%" PRIuPTR " (SC %p, CSC %p)", this, last_ready_index, @@ -207,7 +207,7 @@ void RoundRobin::HandOffPendingPicksLocked(LoadBalancingPolicy* new_policy) { void RoundRobin::ShutdownLocked() { grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel shutdown"); if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, "[RR %p] Shutting down", this); + gpr_log(GPR_INFO, "[RR %p] Shutting down", this); } shutdown_ = true; PickState* pick; @@ -311,8 +311,7 @@ void RoundRobin::ExitIdleLocked() { bool RoundRobin::PickLocked(PickState* pick) { if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, "[RR %p] Trying to pick (shutdown: %d)", this, - shutdown_); + gpr_log(GPR_INFO, "[RR %p] Trying to pick (shutdown: %d)", this, shutdown_); } GPR_ASSERT(!shutdown_); if (subchannel_list_ != nullptr) { @@ -327,7 +326,7 @@ bool RoundRobin::PickLocked(PickState* pick) { } if (grpc_lb_round_robin_trace.enabled()) { gpr_log( - GPR_DEBUG, + GPR_INFO, "[RR %p] Picked target <-- Subchannel %p (connected %p) (sl %p, " "index %" PRIuPTR ")", this, sd->subchannel, pick->connected_subchannel.get(), @@ -416,7 +415,7 @@ void RoundRobin::OnConnectivityChangedLocked(void* arg, grpc_error* error) { RoundRobin* p = static_cast(sd->subchannel_list->policy); if (grpc_lb_round_robin_trace.enabled()) { gpr_log( - GPR_DEBUG, + GPR_INFO, "[RR %p] connectivity changed for subchannel %p, subchannel_list %p: " "prev_state=%s new_state=%s p->shutdown=%d " "sd->subchannel_list->shutting_down=%d error=%s", @@ -458,7 +457,7 @@ void RoundRobin::OnConnectivityChangedLocked(void* arg, grpc_error* error) { case GRPC_CHANNEL_TRANSIENT_FAILURE: { sd->connected_subchannel.reset(); if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "[RR %p] Subchannel %p has gone into TRANSIENT_FAILURE. " "Requesting re-resolution", p, sd->subchannel); @@ -483,7 +482,7 @@ void RoundRobin::OnConnectivityChangedLocked(void* arg, grpc_error* error) { p->subchannel_list_ != nullptr ? p->subchannel_list_->num_subchannels : 0; - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "[RR %p] phasing out subchannel list %p (size %" PRIuPTR ") in favor of %p (size %" PRIuPTR ")", p, p->subchannel_list_, num_subchannels, sd->subchannel_list, @@ -517,7 +516,7 @@ void RoundRobin::OnConnectivityChangedLocked(void* arg, grpc_error* error) { *pick->user_data = selected->user_data; } if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "[RR %p] Fulfilling pending pick. Target <-- subchannel %p " "(subchannel_list %p, index %" PRIuPTR ")", p, selected->subchannel, p->subchannel_list_, @@ -584,7 +583,7 @@ void RoundRobin::UpdateLocked(const grpc_channel_args& args) { } grpc_lb_addresses* addresses = (grpc_lb_addresses*)arg->value.pointer.p; if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, "[RR %p] received update with %" PRIuPTR " addresses", + gpr_log(GPR_INFO, "[RR %p] received update with %" PRIuPTR " addresses", this, addresses->num_addresses); } grpc_lb_subchannel_list* subchannel_list = grpc_lb_subchannel_list_create( @@ -629,7 +628,7 @@ void RoundRobin::UpdateLocked(const grpc_channel_args& args) { } if (latest_pending_subchannel_list_ != nullptr) { if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "[RR %p] Shutting down latest pending subchannel list %p, " "about to be replaced by newer latest %p", this, latest_pending_subchannel_list_, subchannel_list); diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc index 79cb64c6c60..257db57575f 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc @@ -34,7 +34,7 @@ void grpc_lb_subchannel_data_unref_subchannel(grpc_lb_subchannel_data* sd, const char* reason) { if (sd->subchannel != nullptr) { if (sd->subchannel_list->tracer->enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR " (subchannel %p): unreffing subchannel", sd->subchannel_list->tracer->name(), sd->subchannel_list->policy, @@ -57,7 +57,7 @@ void grpc_lb_subchannel_data_start_connectivity_watch( grpc_lb_subchannel_data* sd) { if (sd->subchannel_list->tracer->enabled()) { gpr_log( - GPR_DEBUG, + GPR_INFO, "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR " (subchannel %p): requesting connectivity change " "notification (from %s)", @@ -77,7 +77,7 @@ void grpc_lb_subchannel_data_start_connectivity_watch( void grpc_lb_subchannel_data_stop_connectivity_watch( grpc_lb_subchannel_data* sd) { if (sd->subchannel_list->tracer->enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR " (subchannel %p): stopping connectivity watch", sd->subchannel_list->tracer->name(), sd->subchannel_list->policy, @@ -98,7 +98,7 @@ grpc_lb_subchannel_list* grpc_lb_subchannel_list_create( static_cast( gpr_zalloc(sizeof(*subchannel_list))); if (tracer->enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "[%s %p] Creating subchannel list %p for %" PRIuPTR " subchannels", tracer->name(), p, subchannel_list, addresses->num_addresses); } @@ -132,7 +132,7 @@ grpc_lb_subchannel_list* grpc_lb_subchannel_list_create( if (tracer->enabled()) { char* address_uri = grpc_sockaddr_to_uri(&addresses->addresses[i].address); - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "[%s %p] could not create subchannel for address uri %s, " "ignoring", tracer->name(), subchannel_list->policy, address_uri); @@ -143,7 +143,7 @@ grpc_lb_subchannel_list* grpc_lb_subchannel_list_create( if (tracer->enabled()) { char* address_uri = grpc_sockaddr_to_uri(&addresses->addresses[i].address); - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "[%s %p] subchannel list %p index %" PRIuPTR ": Created subchannel %p for address uri %s", tracer->name(), p, subchannel_list, subchannel_index, subchannel, @@ -175,7 +175,7 @@ grpc_lb_subchannel_list* grpc_lb_subchannel_list_create( static void subchannel_list_destroy(grpc_lb_subchannel_list* subchannel_list) { if (subchannel_list->tracer->enabled()) { - gpr_log(GPR_DEBUG, "[%s %p] Destroying subchannel_list %p", + gpr_log(GPR_INFO, "[%s %p] Destroying subchannel_list %p", subchannel_list->tracer->name(), subchannel_list->policy, subchannel_list); } @@ -192,7 +192,7 @@ void grpc_lb_subchannel_list_ref(grpc_lb_subchannel_list* subchannel_list, gpr_ref_non_zero(&subchannel_list->refcount); if (subchannel_list->tracer->enabled()) { const gpr_atm count = gpr_atm_acq_load(&subchannel_list->refcount.count); - gpr_log(GPR_DEBUG, "[%s %p] subchannel_list %p REF %lu->%lu (%s)", + gpr_log(GPR_INFO, "[%s %p] subchannel_list %p REF %lu->%lu (%s)", subchannel_list->tracer->name(), subchannel_list->policy, subchannel_list, static_cast(count - 1), static_cast(count), reason); @@ -204,7 +204,7 @@ void grpc_lb_subchannel_list_unref(grpc_lb_subchannel_list* subchannel_list, const bool done = gpr_unref(&subchannel_list->refcount); if (subchannel_list->tracer->enabled()) { const gpr_atm count = gpr_atm_acq_load(&subchannel_list->refcount.count); - gpr_log(GPR_DEBUG, "[%s %p] subchannel_list %p UNREF %lu->%lu (%s)", + gpr_log(GPR_INFO, "[%s %p] subchannel_list %p UNREF %lu->%lu (%s)", subchannel_list->tracer->name(), subchannel_list->policy, subchannel_list, static_cast(count + 1), static_cast(count), reason); @@ -217,7 +217,7 @@ void grpc_lb_subchannel_list_unref(grpc_lb_subchannel_list* subchannel_list, static void subchannel_data_cancel_connectivity_watch( grpc_lb_subchannel_data* sd, const char* reason) { if (sd->subchannel_list->tracer->enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR " (subchannel %p): canceling connectivity watch (%s)", sd->subchannel_list->tracer->name(), sd->subchannel_list->policy, @@ -232,7 +232,7 @@ static void subchannel_data_cancel_connectivity_watch( void grpc_lb_subchannel_list_shutdown_and_unref( grpc_lb_subchannel_list* subchannel_list, const char* reason) { if (subchannel_list->tracer->enabled()) { - gpr_log(GPR_DEBUG, "[%s %p] Shutting down subchannel_list %p (%s)", + gpr_log(GPR_INFO, "[%s %p] Shutting down subchannel_list %p (%s)", subchannel_list->tracer->name(), subchannel_list->policy, subchannel_list, reason); } diff --git a/src/core/ext/filters/http/message_compress/message_compress_filter.cc b/src/core/ext/filters/http/message_compress/message_compress_filter.cc index e7d9949386f..f8f478b6c04 100644 --- a/src/core/ext/filters/http/message_compress/message_compress_filter.cc +++ b/src/core/ext/filters/http/message_compress/message_compress_filter.cc @@ -234,7 +234,7 @@ static void finish_send_message(grpc_call_element* elem) { static_cast(before_size); GPR_ASSERT(grpc_message_compression_algorithm_name( calld->message_compression_algorithm, &algo_name)); - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "Compressed[%s] %" PRIuPTR " bytes vs. %" PRIuPTR " bytes (%.2f%% savings)", algo_name, before_size, after_size, 100 * savings_ratio); @@ -246,7 +246,7 @@ static void finish_send_message(grpc_call_element* elem) { const char* algo_name; GPR_ASSERT(grpc_message_compression_algorithm_name( calld->message_compression_algorithm, &algo_name)); - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "Algorithm '%s' enabled but decided not to compress. Input size: " "%" PRIuPTR, algo_name, calld->slices.length); diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 6980b8671e1..0ef73961a56 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -807,7 +807,7 @@ static const char* write_state_name(grpc_chttp2_write_state st) { static void set_write_state(grpc_chttp2_transport* t, grpc_chttp2_write_state st, const char* reason) { - GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_DEBUG, "W:%p %s state %s -> %s [%s]", t, + GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "W:%p %s state %s -> %s [%s]", t, t->is_client ? "CLIENT" : "SERVER", write_state_name(t->write_state), write_state_name(st), reason)); @@ -1072,7 +1072,7 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t, uint32_t goaway_error, grpc_slice goaway_text) { // GRPC_CHTTP2_IF_TRACING( - // gpr_log(GPR_DEBUG, "got goaway [%d]: %s", goaway_error, msg)); + // gpr_log(GPR_INFO, "got goaway [%d]: %s", goaway_error, msg)); // Discard the error from a previous goaway frame (if any) if (t->goaway_error != GRPC_ERROR_NONE) { @@ -1118,7 +1118,7 @@ static void maybe_start_some_streams(grpc_chttp2_transport* t) { grpc_chttp2_list_pop_waiting_for_concurrency(t, &s)) { /* safe since we can't (legally) be parsing this stream yet */ GRPC_CHTTP2_IF_TRACING(gpr_log( - GPR_DEBUG, "HTTP:%s: Allocating new grpc_chttp2_stream %p to id %d", + GPR_INFO, "HTTP:%s: Allocating new grpc_chttp2_stream %p to id %d", t->is_client ? "CLI" : "SVR", s, t->next_stream_id)); GPR_ASSERT(s->id == 0); @@ -1183,7 +1183,7 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t, if (grpc_http_trace.enabled()) { const char* errstr = grpc_error_string(error); gpr_log( - GPR_DEBUG, + GPR_INFO, "complete_closure_step: t=%p %p refs=%d flags=0x%04x desc=%s err=%s " "write_state=%s", t, closure, @@ -1336,7 +1336,7 @@ static void perform_stream_op_locked(void* stream_op, if (grpc_http_trace.enabled()) { char* str = grpc_transport_stream_op_batch_string(op); - gpr_log(GPR_DEBUG, "perform_stream_op_locked: %s; on_complete = %p", str, + gpr_log(GPR_INFO, "perform_stream_op_locked: %s; on_complete = %p", str, op->on_complete); gpr_free(str); if (op->send_initial_metadata) { @@ -1638,7 +1638,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs, if (grpc_http_trace.enabled()) { char* str = grpc_transport_stream_op_batch_string(op); - gpr_log(GPR_DEBUG, "perform_stream_op[s=%p]: %s", s, str); + gpr_log(GPR_INFO, "perform_stream_op[s=%p]: %s", s, str); gpr_free(str); } @@ -2529,7 +2529,7 @@ static void schedule_bdp_ping_locked(grpc_chttp2_transport* t) { static void start_bdp_ping_locked(void* tp, grpc_error* error) { grpc_chttp2_transport* t = static_cast(tp); if (grpc_http_trace.enabled()) { - gpr_log(GPR_DEBUG, "%s: Start BDP ping err=%s", t->peer_string, + gpr_log(GPR_INFO, "%s: Start BDP ping err=%s", t->peer_string, grpc_error_string(error)); } /* Reset the keepalive ping timer */ @@ -2542,7 +2542,7 @@ static void start_bdp_ping_locked(void* tp, grpc_error* error) { static void finish_bdp_ping_locked(void* tp, grpc_error* error) { grpc_chttp2_transport* t = static_cast(tp); if (grpc_http_trace.enabled()) { - gpr_log(GPR_DEBUG, "%s: Complete BDP ping err=%s", t->peer_string, + gpr_log(GPR_INFO, "%s: Complete BDP ping err=%s", t->peer_string, grpc_error_string(error)); } if (error != GRPC_ERROR_NONE) { @@ -2716,8 +2716,7 @@ static void keepalive_watchdog_fired_locked(void* arg, grpc_error* error) { static void connectivity_state_set(grpc_chttp2_transport* t, grpc_connectivity_state state, grpc_error* error, const char* reason) { - GRPC_CHTTP2_IF_TRACING( - gpr_log(GPR_DEBUG, "set connectivity_state=%d", state)); + GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "set connectivity_state=%d", state)); grpc_connectivity_state_set(&t->channel_callback.state_tracker, state, error, reason); } @@ -2984,7 +2983,7 @@ static void benign_reclaimer_locked(void* arg, grpc_error* error) { /* Channel with no active streams: send a goaway to try and make it * disconnect cleanly */ if (grpc_resource_quota_trace.enabled()) { - gpr_log(GPR_DEBUG, "HTTP2: %s - send goaway to free memory", + gpr_log(GPR_INFO, "HTTP2: %s - send goaway to free memory", t->peer_string); } send_goaway(t, @@ -2992,7 +2991,7 @@ static void benign_reclaimer_locked(void* arg, grpc_error* error) { GRPC_ERROR_CREATE_FROM_STATIC_STRING("Buffers full"), GRPC_ERROR_INT_HTTP2_ERROR, GRPC_HTTP2_ENHANCE_YOUR_CALM)); } else if (error == GRPC_ERROR_NONE && grpc_resource_quota_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "HTTP2: %s - skip benign reclamation, there are still %" PRIdPTR " streams", t->peer_string, grpc_chttp2_stream_map_size(&t->stream_map)); @@ -3013,7 +3012,7 @@ static void destructive_reclaimer_locked(void* arg, grpc_error* error) { grpc_chttp2_stream* s = static_cast( grpc_chttp2_stream_map_rand(&t->stream_map)); if (grpc_resource_quota_trace.enabled()) { - gpr_log(GPR_DEBUG, "HTTP2: %s - abandon stream id %d", t->peer_string, + gpr_log(GPR_INFO, "HTTP2: %s - abandon stream id %d", t->peer_string, s->id); } grpc_chttp2_cancel_stream( diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.cc b/src/core/ext/transport/chttp2/transport/frame_settings.cc index 9ea27dcd473..987ac0e79d0 100644 --- a/src/core/ext/transport/chttp2/transport/frame_settings.cc +++ b/src/core/ext/transport/chttp2/transport/frame_settings.cc @@ -217,14 +217,14 @@ grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t, t->initial_window_update += static_cast(parser->value) - parser->incoming_settings[id]; if (grpc_http_trace.enabled() || grpc_flowctl_trace.enabled()) { - gpr_log(GPR_DEBUG, "%p[%s] adding %d for initial_window change", - t, t->is_client ? "cli" : "svr", + gpr_log(GPR_INFO, "%p[%s] adding %d for initial_window change", t, + t->is_client ? "cli" : "svr", static_cast(t->initial_window_update)); } } parser->incoming_settings[id] = parser->value; if (grpc_http_trace.enabled()) { - gpr_log(GPR_DEBUG, "CHTTP2:%s:%s: got setting %s = %d", + gpr_log(GPR_INFO, "CHTTP2:%s:%s: got setting %s = %d", t->is_client ? "CLI" : "SVR", t->peer_string, sp->name, parser->value); } diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc index e4f3c1b81e1..d5ef063883b 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc @@ -470,7 +470,7 @@ static void hpack_enc(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem, v = grpc_slice_to_c_string(GRPC_MDVALUE(elem)); } gpr_log( - GPR_DEBUG, + GPR_INFO, "Encode: '%s: %s', elem_interned=%d [%d], k_interned=%d, v_interned=%d", k, v, GRPC_MDELEM_IS_INTERNED(elem), GRPC_MDELEM_STORAGE(elem), grpc_slice_is_interned(GRPC_MDKEY(elem)), @@ -654,7 +654,7 @@ void grpc_chttp2_hpack_compressor_set_max_table_size( } c->advertise_table_size_change = 1; if (grpc_http_trace.enabled()) { - gpr_log(GPR_DEBUG, "set max table size from encoder to %d", max_table_size); + gpr_log(GPR_INFO, "set max table size from encoder to %d", max_table_size); } } diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/src/core/ext/transport/chttp2/transport/hpack_parser.cc index fc96a8b3e4d..907ba71178c 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.cc @@ -633,7 +633,7 @@ static grpc_error* on_hdr(grpc_chttp2_hpack_parser* p, grpc_mdelem md, v = grpc_slice_to_c_string(GRPC_MDVALUE(md)); } gpr_log( - GPR_DEBUG, + GPR_INFO, "Decode: '%s: %s', elem_interned=%d [%d], k_interned=%d, v_interned=%d", k, v, GRPC_MDELEM_IS_INTERNED(md), GRPC_MDELEM_STORAGE(md), grpc_slice_is_interned(GRPC_MDKEY(md)), diff --git a/src/core/ext/transport/chttp2/transport/hpack_table.cc b/src/core/ext/transport/chttp2/transport/hpack_table.cc index f050f502f5a..79292583567 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_table.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_table.cc @@ -247,7 +247,7 @@ void grpc_chttp2_hptbl_set_max_bytes(grpc_chttp2_hptbl* tbl, return; } if (grpc_http_trace.enabled()) { - gpr_log(GPR_DEBUG, "Update hpack parser max size to %d", max_bytes); + gpr_log(GPR_INFO, "Update hpack parser max size to %d", max_bytes); } while (tbl->mem_used > max_bytes) { evict1(tbl); @@ -270,7 +270,7 @@ grpc_error* grpc_chttp2_hptbl_set_current_table_size(grpc_chttp2_hptbl* tbl, return err; } if (grpc_http_trace.enabled()) { - gpr_log(GPR_DEBUG, "Update hpack parser table size to %d", bytes); + gpr_log(GPR_INFO, "Update hpack parser table size to %d", bytes); } while (tbl->mem_used > bytes) { evict1(tbl); diff --git a/src/core/ext/transport/chttp2/transport/stream_lists.cc b/src/core/ext/transport/chttp2/transport/stream_lists.cc index 5d3ec4b53ba..6626170a7e4 100644 --- a/src/core/ext/transport/chttp2/transport/stream_lists.cc +++ b/src/core/ext/transport/chttp2/transport/stream_lists.cc @@ -68,7 +68,7 @@ static bool stream_list_pop(grpc_chttp2_transport* t, } *stream = s; if (s && grpc_trace_http2_stream_state.enabled()) { - gpr_log(GPR_DEBUG, "%p[%d][%s]: pop from %s", t, s->id, + gpr_log(GPR_INFO, "%p[%d][%s]: pop from %s", t, s->id, t->is_client ? "cli" : "svr", stream_list_id_string(id)); } return s != nullptr; @@ -90,7 +90,7 @@ static void stream_list_remove(grpc_chttp2_transport* t, grpc_chttp2_stream* s, t->lists[id].tail = s->links[id].prev; } if (grpc_trace_http2_stream_state.enabled()) { - gpr_log(GPR_DEBUG, "%p[%d][%s]: remove from %s", t, s->id, + gpr_log(GPR_INFO, "%p[%d][%s]: remove from %s", t, s->id, t->is_client ? "cli" : "svr", stream_list_id_string(id)); } } @@ -122,7 +122,7 @@ static void stream_list_add_tail(grpc_chttp2_transport* t, t->lists[id].tail = s; s->included[id] = 1; if (grpc_trace_http2_stream_state.enabled()) { - gpr_log(GPR_DEBUG, "%p[%d][%s]: add to %s", t, s->id, + gpr_log(GPR_INFO, "%p[%d][%s]: add to %s", t, s->id, t->is_client ? "cli" : "svr", stream_list_id_string(id)); } } diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc index 6f32397a3ac..85efe270800 100644 --- a/src/core/ext/transport/chttp2/transport/writing.cc +++ b/src/core/ext/transport/chttp2/transport/writing.cc @@ -52,7 +52,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { if (!grpc_closure_list_empty(pq->lists[GRPC_CHTTP2_PCL_INFLIGHT])) { /* ping already in-flight: wait */ if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) { - gpr_log(GPR_DEBUG, "%s: Ping delayed [%p]: already pinging", + gpr_log(GPR_INFO, "%s: Ping delayed [%p]: already pinging", t->is_client ? "CLIENT" : "SERVER", t->peer_string); } return; @@ -61,7 +61,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { t->ping_policy.max_pings_without_data != 0) { /* need to receive something of substance before sending a ping again */ if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) { - gpr_log(GPR_DEBUG, "%s: Ping delayed [%p]: too many recent pings: %d/%d", + gpr_log(GPR_INFO, "%s: Ping delayed [%p]: too many recent pings: %d/%d", t->is_client ? "CLIENT" : "SERVER", t->peer_string, t->ping_state.pings_before_data_required, t->ping_policy.max_pings_without_data); @@ -81,7 +81,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { if (next_allowed_ping > now) { /* not enough elapsed time between successive pings */ if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "%s: Ping delayed [%p]: not enough time elapsed since last ping. " " Last ping %f: Next ping %f: Now %f", t->is_client ? "CLIENT" : "SERVER", t->peer_string, @@ -107,7 +107,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { GRPC_STATS_INC_HTTP2_PINGS_SENT(); t->ping_state.last_ping_sent_time = now; if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) { - gpr_log(GPR_DEBUG, "%s: Ping sent [%p]: %d/%d", + gpr_log(GPR_INFO, "%s: Ping sent [%p]: %d/%d", t->is_client ? "CLIENT" : "SERVER", t->peer_string, t->ping_state.pings_before_data_required, t->ping_policy.max_pings_without_data); @@ -401,7 +401,7 @@ class StreamWriteContext { StreamWriteContext(WriteContext* write_context, grpc_chttp2_stream* s) : write_context_(write_context), t_(write_context->transport()), s_(s) { GRPC_CHTTP2_IF_TRACING( - gpr_log(GPR_DEBUG, "W:%p %s[%d] im-(sent,send)=(%d,%d) announce=%d", t_, + gpr_log(GPR_INFO, "W:%p %s[%d] im-(sent,send)=(%d,%d) announce=%d", t_, t_->is_client ? "CLIENT" : "SERVER", s->id, s->sent_initial_metadata, s->send_initial_metadata != nullptr, (int)(s->flow_control->local_window_delta() - diff --git a/src/core/ext/transport/inproc/inproc_transport.cc b/src/core/ext/transport/inproc/inproc_transport.cc index 67a380077b4..2c3bff5c1e5 100644 --- a/src/core/ext/transport/inproc/inproc_transport.cc +++ b/src/core/ext/transport/inproc/inproc_transport.cc @@ -125,12 +125,12 @@ static bool cancel_stream_locked(inproc_stream* s, grpc_error* error); static void op_state_machine(void* arg, grpc_error* error); static void ref_transport(inproc_transport* t) { - INPROC_LOG(GPR_DEBUG, "ref_transport %p", t); + INPROC_LOG(GPR_INFO, "ref_transport %p", t); gpr_ref(&t->refs); } static void really_destroy_transport(inproc_transport* t) { - INPROC_LOG(GPR_DEBUG, "really_destroy_transport %p", t); + INPROC_LOG(GPR_INFO, "really_destroy_transport %p", t); grpc_connectivity_state_destroy(&t->connectivity); if (gpr_unref(&t->mu->refs)) { gpr_free(t->mu); @@ -139,7 +139,7 @@ static void really_destroy_transport(inproc_transport* t) { } static void unref_transport(inproc_transport* t) { - INPROC_LOG(GPR_DEBUG, "unref_transport %p", t); + INPROC_LOG(GPR_INFO, "unref_transport %p", t); if (gpr_unref(&t->refs)) { really_destroy_transport(t); } @@ -154,17 +154,17 @@ static void unref_transport(inproc_transport* t) { #endif static void ref_stream(inproc_stream* s, const char* reason) { - INPROC_LOG(GPR_DEBUG, "ref_stream %p %s", s, reason); + INPROC_LOG(GPR_INFO, "ref_stream %p %s", s, reason); STREAM_REF(s->refs, reason); } static void unref_stream(inproc_stream* s, const char* reason) { - INPROC_LOG(GPR_DEBUG, "unref_stream %p %s", s, reason); + INPROC_LOG(GPR_INFO, "unref_stream %p %s", s, reason); STREAM_UNREF(s->refs, reason); } static void really_destroy_stream(inproc_stream* s) { - INPROC_LOG(GPR_DEBUG, "really_destroy_stream %p", s); + INPROC_LOG(GPR_INFO, "really_destroy_stream %p", s); GRPC_ERROR_UNREF(s->write_buffer_cancel_error); GRPC_ERROR_UNREF(s->cancel_self_error); @@ -225,7 +225,7 @@ static grpc_error* fill_in_metadata(inproc_stream* s, static int init_stream(grpc_transport* gt, grpc_stream* gs, grpc_stream_refcount* refcount, const void* server_data, gpr_arena* arena) { - INPROC_LOG(GPR_DEBUG, "init_stream %p %p %p", gt, gs, server_data); + INPROC_LOG(GPR_INFO, "init_stream %p %p %p", gt, gs, server_data); inproc_transport* t = reinterpret_cast(gt); inproc_stream* s = reinterpret_cast(gs); s->arena = arena; @@ -282,8 +282,8 @@ static int init_stream(grpc_transport* gt, grpc_stream* gs, // Pass the client-side stream address to the server-side for a ref ref_stream(s, "inproc_init_stream:clt"); // ref it now on behalf of server // side to avoid destruction - INPROC_LOG(GPR_DEBUG, "calling accept stream cb %p %p", - st->accept_stream_cb, st->accept_stream_data); + INPROC_LOG(GPR_INFO, "calling accept stream cb %p %p", st->accept_stream_cb, + st->accept_stream_data); (*st->accept_stream_cb)(st->accept_stream_data, &st->base, (void*)s); } else { // This is the server-side and is being called through accept_stream_cb @@ -378,7 +378,7 @@ static void complete_if_batch_end_locked(inproc_stream* s, grpc_error* error, int is_rtm = static_cast(op == s->recv_trailing_md_op); if ((is_sm + is_stm + is_rim + is_rm + is_rtm) == 1) { - INPROC_LOG(GPR_DEBUG, "%s %p %p %p", msg, s, op, error); + INPROC_LOG(GPR_INFO, "%s %p %p %p", msg, s, op, error); GRPC_CLOSURE_SCHED(op->on_complete, GRPC_ERROR_REF(error)); } } @@ -393,7 +393,7 @@ static void maybe_schedule_op_closure_locked(inproc_stream* s, } static void fail_helper_locked(inproc_stream* s, grpc_error* error) { - INPROC_LOG(GPR_DEBUG, "op_state_machine %p fail_helper", s); + INPROC_LOG(GPR_INFO, "op_state_machine %p fail_helper", s); // If we're failing this side, we need to make sure that // we also send or have already sent trailing metadata if (!s->trailing_md_sent) { @@ -458,7 +458,7 @@ static void fail_helper_locked(inproc_stream* s, grpc_error* error) { *s->recv_initial_md_op->payload->recv_initial_metadata .trailing_metadata_available = true; } - INPROC_LOG(GPR_DEBUG, + INPROC_LOG(GPR_INFO, "fail_helper %p scheduling initial-metadata-ready %p %p", s, error, err); GRPC_CLOSURE_SCHED(s->recv_initial_md_op->payload->recv_initial_metadata @@ -472,7 +472,7 @@ static void fail_helper_locked(inproc_stream* s, grpc_error* error) { s->recv_initial_md_op = nullptr; } if (s->recv_message_op) { - INPROC_LOG(GPR_DEBUG, "fail_helper %p scheduling message-ready %p", s, + INPROC_LOG(GPR_INFO, "fail_helper %p scheduling message-ready %p", s, error); GRPC_CLOSURE_SCHED( s->recv_message_op->payload->recv_message.recv_message_ready, @@ -496,9 +496,8 @@ static void fail_helper_locked(inproc_stream* s, grpc_error* error) { s->send_trailing_md_op = nullptr; } if (s->recv_trailing_md_op) { - INPROC_LOG(GPR_DEBUG, - "fail_helper %p scheduling trailing-md-on-complete %p", s, - error); + INPROC_LOG(GPR_INFO, "fail_helper %p scheduling trailing-md-on-complete %p", + s, error); complete_if_batch_end_locked( s, error, s->recv_trailing_md_op, "fail_helper scheduling recv-trailing-metadata-on-complete"); @@ -549,7 +548,7 @@ static void message_transfer_locked(inproc_stream* sender, receiver->recv_stream.Init(&receiver->recv_message, 0); receiver->recv_message_op->payload->recv_message.recv_message->reset( receiver->recv_stream.get()); - INPROC_LOG(GPR_DEBUG, "message_transfer_locked %p scheduling message-ready", + INPROC_LOG(GPR_INFO, "message_transfer_locked %p scheduling message-ready", receiver); GRPC_CLOSURE_SCHED( receiver->recv_message_op->payload->recv_message.recv_message_ready, @@ -577,7 +576,7 @@ static void op_state_machine(void* arg, grpc_error* error) { bool needs_close = false; - INPROC_LOG(GPR_DEBUG, "op_state_machine %p", arg); + INPROC_LOG(GPR_INFO, "op_state_machine %p", arg); inproc_stream* s = static_cast(arg); gpr_mu* mu = &s->t->mu->mu; // keep aside in case s gets closed gpr_mu_lock(mu); @@ -626,7 +625,7 @@ static void op_state_machine(void* arg, grpc_error* error) { : &other->to_read_trailing_md_filled; if (*destfilled || s->trailing_md_sent) { // The buffer is already in use; that's an error! - INPROC_LOG(GPR_DEBUG, "Extra trailing metadata %p", s); + INPROC_LOG(GPR_INFO, "Extra trailing metadata %p", s); new_err = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Extra trailing metadata"); fail_helper_locked(s, GRPC_ERROR_REF(new_err)); goto done; @@ -639,7 +638,7 @@ static void op_state_machine(void* arg, grpc_error* error) { } s->trailing_md_sent = true; if (!s->t->is_client && s->trailing_md_recvd && s->recv_trailing_md_op) { - INPROC_LOG(GPR_DEBUG, + INPROC_LOG(GPR_INFO, "op_state_machine %p scheduling trailing-md-on-complete", s); GRPC_CLOSURE_SCHED(s->recv_trailing_md_op->on_complete, GRPC_ERROR_NONE); @@ -658,7 +657,7 @@ static void op_state_machine(void* arg, grpc_error* error) { new_err = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Already recvd initial md"); INPROC_LOG( - GPR_DEBUG, + GPR_INFO, "op_state_machine %p scheduling on_complete errors for already " "recvd initial md %p", s, new_err); @@ -684,7 +683,7 @@ static void op_state_machine(void* arg, grpc_error* error) { } grpc_metadata_batch_clear(&s->to_read_initial_md); s->to_read_initial_md_filled = false; - INPROC_LOG(GPR_DEBUG, + INPROC_LOG(GPR_INFO, "op_state_machine %p scheduling initial-metadata-ready %p", s, new_err); GRPC_CLOSURE_SCHED(s->recv_initial_md_op->payload->recv_initial_metadata @@ -696,7 +695,7 @@ static void op_state_machine(void* arg, grpc_error* error) { s->recv_initial_md_op = nullptr; if (new_err != GRPC_ERROR_NONE) { - INPROC_LOG(GPR_DEBUG, + INPROC_LOG(GPR_INFO, "op_state_machine %p scheduling on_complete errors2 %p", s, new_err); fail_helper_locked(s, GRPC_ERROR_REF(new_err)); @@ -719,7 +718,7 @@ static void op_state_machine(void* arg, grpc_error* error) { new_err = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Already recvd trailing md"); INPROC_LOG( - GPR_DEBUG, + GPR_INFO, "op_state_machine %p scheduling on_complete errors for already " "recvd trailing md %p", s, new_err); @@ -729,7 +728,7 @@ static void op_state_machine(void* arg, grpc_error* error) { if (s->recv_message_op != nullptr) { // This message needs to be wrapped up because it will never be // satisfied - INPROC_LOG(GPR_DEBUG, "op_state_machine %p scheduling message-ready", s); + INPROC_LOG(GPR_INFO, "op_state_machine %p scheduling message-ready", s); GRPC_CLOSURE_SCHED( s->recv_message_op->payload->recv_message.recv_message_ready, GRPC_ERROR_NONE); @@ -764,7 +763,7 @@ static void op_state_machine(void* arg, grpc_error* error) { // (If the server hasn't already sent its trailing md, it doesn't have // a final status, so don't mark this op complete) if (s->t->is_client || s->trailing_md_sent) { - INPROC_LOG(GPR_DEBUG, + INPROC_LOG(GPR_INFO, "op_state_machine %p scheduling trailing-md-on-complete %p", s, new_err); GRPC_CLOSURE_SCHED(s->recv_trailing_md_op->on_complete, @@ -772,21 +771,21 @@ static void op_state_machine(void* arg, grpc_error* error) { s->recv_trailing_md_op = nullptr; needs_close = true; } else { - INPROC_LOG(GPR_DEBUG, + INPROC_LOG(GPR_INFO, "op_state_machine %p server needs to delay handling " "trailing-md-on-complete %p", s, new_err); } } else { INPROC_LOG( - GPR_DEBUG, + GPR_INFO, "op_state_machine %p has trailing md but not yet waiting for it", s); } } if (s->trailing_md_recvd && s->recv_message_op) { // No further message will come on this stream, so finish off the // recv_message_op - INPROC_LOG(GPR_DEBUG, "op_state_machine %p scheduling message-ready", s); + INPROC_LOG(GPR_INFO, "op_state_machine %p scheduling message-ready", s); GRPC_CLOSURE_SCHED( s->recv_message_op->payload->recv_message.recv_message_ready, GRPC_ERROR_NONE); @@ -810,7 +809,7 @@ static void op_state_machine(void* arg, grpc_error* error) { // Didn't get the item we wanted so we still need to get // rescheduled INPROC_LOG( - GPR_DEBUG, "op_state_machine %p still needs closure %p %p %p %p %p", s, + GPR_INFO, "op_state_machine %p still needs closure %p %p %p %p %p", s, s->send_message_op, s->send_trailing_md_op, s->recv_initial_md_op, s->recv_message_op, s->recv_trailing_md_op); s->ops_needed = true; @@ -826,8 +825,7 @@ done: static bool cancel_stream_locked(inproc_stream* s, grpc_error* error) { bool ret = false; // was the cancel accepted - INPROC_LOG(GPR_DEBUG, "cancel_stream %p with %s", s, - grpc_error_string(error)); + INPROC_LOG(GPR_INFO, "cancel_stream %p with %s", s, grpc_error_string(error)); if (s->cancel_self_error == GRPC_ERROR_NONE) { ret = true; s->cancel_self_error = GRPC_ERROR_REF(error); @@ -877,7 +875,7 @@ static bool cancel_stream_locked(inproc_stream* s, grpc_error* error) { static void perform_stream_op(grpc_transport* gt, grpc_stream* gs, grpc_transport_stream_op_batch* op) { - INPROC_LOG(GPR_DEBUG, "perform_stream_op %p %p %p", gt, gs, op); + INPROC_LOG(GPR_INFO, "perform_stream_op %p %p %p", gt, gs, op); inproc_stream* s = reinterpret_cast(gs); gpr_mu* mu = &s->t->mu->mu; // save aside in case s gets closed gpr_mu_lock(mu); @@ -907,7 +905,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs, // already self-canceled so still give it an error error = GRPC_ERROR_REF(s->cancel_self_error); } else { - INPROC_LOG(GPR_DEBUG, "perform_stream_op %p %s%s%s%s%s%s%s", s, + INPROC_LOG(GPR_INFO, "perform_stream_op %p %s%s%s%s%s%s%s", s, s->t->is_client ? "client" : "server", op->send_initial_metadata ? " send_initial_metadata" : "", op->send_message ? " send_message" : "", @@ -936,7 +934,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs, : &other->to_read_initial_md_filled; if (*destfilled || s->initial_md_sent) { // The buffer is already in use; that's an error! - INPROC_LOG(GPR_DEBUG, "Extra initial metadata %p", s); + INPROC_LOG(GPR_INFO, "Extra initial metadata %p", s); error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Extra initial metadata"); } else { if (!other || !other->closed) { @@ -1013,7 +1011,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs, true; } INPROC_LOG( - GPR_DEBUG, + GPR_INFO, "perform_stream_op error %p scheduling initial-metadata-ready %p", s, error); GRPC_CLOSURE_SCHED( @@ -1022,14 +1020,14 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs, } if (op->recv_message) { INPROC_LOG( - GPR_DEBUG, + GPR_INFO, "perform_stream_op error %p scheduling recv message-ready %p", s, error); GRPC_CLOSURE_SCHED(op->payload->recv_message.recv_message_ready, GRPC_ERROR_REF(error)); } } - INPROC_LOG(GPR_DEBUG, "perform_stream_op %p scheduling on_complete %p", s, + INPROC_LOG(GPR_INFO, "perform_stream_op %p scheduling on_complete %p", s, error); GRPC_CLOSURE_SCHED(on_complete, GRPC_ERROR_REF(error)); } @@ -1042,7 +1040,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs, } static void close_transport_locked(inproc_transport* t) { - INPROC_LOG(GPR_DEBUG, "close_transport %p %d", t, t->is_closed); + INPROC_LOG(GPR_INFO, "close_transport %p %d", t, t->is_closed); grpc_connectivity_state_set( &t->connectivity, GRPC_CHANNEL_SHUTDOWN, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Closing transport."), @@ -1063,7 +1061,7 @@ static void close_transport_locked(inproc_transport* t) { static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) { inproc_transport* t = reinterpret_cast(gt); - INPROC_LOG(GPR_DEBUG, "perform_transport_op %p %p", t, op); + INPROC_LOG(GPR_INFO, "perform_transport_op %p %p", t, op); gpr_mu_lock(&t->mu->mu); if (op->on_connectivity_state_change) { grpc_connectivity_state_notify_on_state_change( @@ -1096,7 +1094,7 @@ static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) { static void destroy_stream(grpc_transport* gt, grpc_stream* gs, grpc_closure* then_schedule_closure) { - INPROC_LOG(GPR_DEBUG, "destroy_stream %p %p", gs, then_schedule_closure); + INPROC_LOG(GPR_INFO, "destroy_stream %p %p", gs, then_schedule_closure); inproc_stream* s = reinterpret_cast(gs); s->closure_at_destroy = then_schedule_closure; really_destroy_stream(s); @@ -1104,7 +1102,7 @@ static void destroy_stream(grpc_transport* gt, grpc_stream* gs, static void destroy_transport(grpc_transport* gt) { inproc_transport* t = reinterpret_cast(gt); - INPROC_LOG(GPR_DEBUG, "destroy_transport %p", t); + INPROC_LOG(GPR_INFO, "destroy_transport %p", t); gpr_mu_lock(&t->mu->mu); close_transport_locked(t); gpr_mu_unlock(&t->mu->mu); @@ -1165,7 +1163,7 @@ static void inproc_transports_create(grpc_transport** server_transport, const grpc_channel_args* server_args, grpc_transport** client_transport, const grpc_channel_args* client_args) { - INPROC_LOG(GPR_DEBUG, "inproc_transports_create"); + INPROC_LOG(GPR_INFO, "inproc_transports_create"); inproc_transport* st = static_cast(gpr_zalloc(sizeof(*st))); inproc_transport* ct = diff --git a/src/core/lib/channel/handshaker.cc b/src/core/lib/channel/handshaker.cc index 9cd97823d48..2faeb64cb60 100644 --- a/src/core/lib/channel/handshaker.cc +++ b/src/core/lib/channel/handshaker.cc @@ -137,7 +137,7 @@ void grpc_handshake_manager_add(grpc_handshake_manager* mgr, grpc_handshaker* handshaker) { if (grpc_handshaker_trace.enabled()) { gpr_log( - GPR_DEBUG, + GPR_INFO, "handshake_manager %p: adding handshaker %s [%p] at index %" PRIuPTR, mgr, grpc_handshaker_name(handshaker), handshaker, mgr->count); } @@ -208,7 +208,7 @@ static bool call_next_handshaker_locked(grpc_handshake_manager* mgr, grpc_error* error) { if (grpc_handshaker_trace.enabled()) { char* args_str = handshaker_args_string(&mgr->args); - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "handshake_manager %p: error=%s shutdown=%d index=%" PRIuPTR ", args=%s", mgr, grpc_error_string(error), mgr->shutdown, mgr->index, args_str); @@ -221,7 +221,7 @@ static bool call_next_handshaker_locked(grpc_handshake_manager* mgr, if (error != GRPC_ERROR_NONE || mgr->shutdown || mgr->args.exit_early || mgr->index == mgr->count) { if (grpc_handshaker_trace.enabled()) { - gpr_log(GPR_DEBUG, "handshake_manager %p: handshaking complete", mgr); + gpr_log(GPR_INFO, "handshake_manager %p: handshaking complete", mgr); } // Cancel deadline timer, since we're invoking the on_handshake_done // callback now. @@ -231,7 +231,7 @@ static bool call_next_handshaker_locked(grpc_handshake_manager* mgr, } else { if (grpc_handshaker_trace.enabled()) { gpr_log( - GPR_DEBUG, + GPR_INFO, "handshake_manager %p: calling handshaker %s [%p] at index %" PRIuPTR, mgr, grpc_handshaker_name(mgr->handshakers[mgr->index]), mgr->handshakers[mgr->index], mgr->index); diff --git a/src/core/lib/gprpp/orphanable.h b/src/core/lib/gprpp/orphanable.h index b50f8c247ca..73a73995c7f 100644 --- a/src/core/lib/gprpp/orphanable.h +++ b/src/core/lib/gprpp/orphanable.h @@ -159,7 +159,7 @@ class InternallyRefCountedWithTracing : public Orphanable { const char* reason) GRPC_MUST_USE_RESULT { if (location.Log() && trace_flag_ != nullptr && trace_flag_->enabled()) { gpr_atm old_refs = gpr_atm_no_barrier_load(&refs_.count); - gpr_log(GPR_DEBUG, "%s:%p %s:%d ref %" PRIdPTR " -> %" PRIdPTR " %s", + gpr_log(GPR_INFO, "%s:%p %s:%d ref %" PRIdPTR " -> %" PRIdPTR " %s", trace_flag_->name(), this, location.file(), location.line(), old_refs, old_refs + 1, reason); } @@ -180,7 +180,7 @@ class InternallyRefCountedWithTracing : public Orphanable { void Unref(const DebugLocation& location, const char* reason) { if (location.Log() && trace_flag_ != nullptr && trace_flag_->enabled()) { gpr_atm old_refs = gpr_atm_no_barrier_load(&refs_.count); - gpr_log(GPR_DEBUG, "%s:%p %s:%d unref %" PRIdPTR " -> %" PRIdPTR " %s", + gpr_log(GPR_INFO, "%s:%p %s:%d unref %" PRIdPTR " -> %" PRIdPTR " %s", trace_flag_->name(), this, location.file(), location.line(), old_refs, old_refs - 1, reason); } diff --git a/src/core/lib/gprpp/ref_counted.h b/src/core/lib/gprpp/ref_counted.h index bd6874f3db5..c67e3f315ca 100644 --- a/src/core/lib/gprpp/ref_counted.h +++ b/src/core/lib/gprpp/ref_counted.h @@ -100,7 +100,7 @@ class RefCountedWithTracing { const char* reason) GRPC_MUST_USE_RESULT { if (location.Log() && trace_flag_ != nullptr && trace_flag_->enabled()) { gpr_atm old_refs = gpr_atm_no_barrier_load(&refs_.count); - gpr_log(GPR_DEBUG, "%s:%p %s:%d ref %" PRIdPTR " -> %" PRIdPTR " %s", + gpr_log(GPR_INFO, "%s:%p %s:%d ref %" PRIdPTR " -> %" PRIdPTR " %s", trace_flag_->name(), this, location.file(), location.line(), old_refs, old_refs + 1, reason); } @@ -121,7 +121,7 @@ class RefCountedWithTracing { void Unref(const DebugLocation& location, const char* reason) { if (location.Log() && trace_flag_ != nullptr && trace_flag_->enabled()) { gpr_atm old_refs = gpr_atm_no_barrier_load(&refs_.count); - gpr_log(GPR_DEBUG, "%s:%p %s:%d unref %" PRIdPTR " -> %" PRIdPTR " %s", + gpr_log(GPR_INFO, "%s:%p %s:%d unref %" PRIdPTR " -> %" PRIdPTR " %s", trace_flag_->name(), this, location.file(), location.line(), old_refs, old_refs - 1, reason); } diff --git a/src/core/lib/iomgr/call_combiner.cc b/src/core/lib/iomgr/call_combiner.cc index 24e11b687be..00a839b64c6 100644 --- a/src/core/lib/iomgr/call_combiner.cc +++ b/src/core/lib/iomgr/call_combiner.cc @@ -64,7 +64,7 @@ void grpc_call_combiner_start(grpc_call_combiner* call_combiner, const char* reason) { GPR_TIMER_SCOPE("call_combiner_start", 0); if (grpc_call_combiner_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "==> grpc_call_combiner_start() [%p] closure=%p [" DEBUG_FMT_STR "%s] error=%s", call_combiner, closure DEBUG_FMT_ARGS, reason, @@ -73,7 +73,7 @@ void grpc_call_combiner_start(grpc_call_combiner* call_combiner, size_t prev_size = static_cast( gpr_atm_full_fetch_add(&call_combiner->size, (gpr_atm)1)); if (grpc_call_combiner_trace.enabled()) { - gpr_log(GPR_DEBUG, " size: %" PRIdPTR " -> %" PRIdPTR, prev_size, + gpr_log(GPR_INFO, " size: %" PRIdPTR " -> %" PRIdPTR, prev_size, prev_size + 1); } GRPC_STATS_INC_CALL_COMBINER_LOCKS_SCHEDULED_ITEMS(); @@ -82,7 +82,7 @@ void grpc_call_combiner_start(grpc_call_combiner* call_combiner, GPR_TIMER_MARK("call_combiner_initiate", 0); if (grpc_call_combiner_trace.enabled()) { - gpr_log(GPR_DEBUG, " EXECUTING IMMEDIATELY"); + gpr_log(GPR_INFO, " EXECUTING IMMEDIATELY"); } // Queue was empty, so execute this closure immediately. GRPC_CLOSURE_SCHED(closure, error); @@ -101,21 +101,21 @@ void grpc_call_combiner_stop(grpc_call_combiner* call_combiner DEBUG_ARGS, const char* reason) { GPR_TIMER_SCOPE("call_combiner_stop", 0); if (grpc_call_combiner_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "==> grpc_call_combiner_stop() [%p] [" DEBUG_FMT_STR "%s]", call_combiner DEBUG_FMT_ARGS, reason); } size_t prev_size = static_cast( gpr_atm_full_fetch_add(&call_combiner->size, (gpr_atm)-1)); if (grpc_call_combiner_trace.enabled()) { - gpr_log(GPR_DEBUG, " size: %" PRIdPTR " -> %" PRIdPTR, prev_size, + gpr_log(GPR_INFO, " size: %" PRIdPTR " -> %" PRIdPTR, prev_size, prev_size - 1); } GPR_ASSERT(prev_size >= 1); if (prev_size > 1) { while (true) { if (grpc_call_combiner_trace.enabled()) { - gpr_log(GPR_DEBUG, " checking queue"); + gpr_log(GPR_INFO, " checking queue"); } bool empty; grpc_closure* closure = reinterpret_cast( @@ -124,19 +124,19 @@ void grpc_call_combiner_stop(grpc_call_combiner* call_combiner DEBUG_ARGS, // This can happen either due to a race condition within the mpscq // code or because of a race with grpc_call_combiner_start(). if (grpc_call_combiner_trace.enabled()) { - gpr_log(GPR_DEBUG, " queue returned no result; checking again"); + gpr_log(GPR_INFO, " queue returned no result; checking again"); } continue; } if (grpc_call_combiner_trace.enabled()) { - gpr_log(GPR_DEBUG, " EXECUTING FROM QUEUE: closure=%p error=%s", + gpr_log(GPR_INFO, " EXECUTING FROM QUEUE: closure=%p error=%s", closure, grpc_error_string(closure->error_data.error)); } GRPC_CLOSURE_SCHED(closure, closure->error_data.error); break; } } else if (grpc_call_combiner_trace.enabled()) { - gpr_log(GPR_DEBUG, " queue empty"); + gpr_log(GPR_INFO, " queue empty"); } } @@ -151,7 +151,7 @@ void grpc_call_combiner_set_notify_on_cancel(grpc_call_combiner* call_combiner, // Otherwise, store the new closure. if (original_error != GRPC_ERROR_NONE) { if (grpc_call_combiner_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "call_combiner=%p: scheduling notify_on_cancel callback=%p " "for pre-existing cancellation", call_combiner, closure); @@ -162,7 +162,7 @@ void grpc_call_combiner_set_notify_on_cancel(grpc_call_combiner* call_combiner, if (gpr_atm_full_cas(&call_combiner->cancel_state, original_state, (gpr_atm)closure)) { if (grpc_call_combiner_trace.enabled()) { - gpr_log(GPR_DEBUG, "call_combiner=%p: setting notify_on_cancel=%p", + gpr_log(GPR_INFO, "call_combiner=%p: setting notify_on_cancel=%p", call_combiner, closure); } // If we replaced an earlier closure, invoke the original @@ -171,7 +171,7 @@ void grpc_call_combiner_set_notify_on_cancel(grpc_call_combiner* call_combiner, if (original_state != 0) { closure = (grpc_closure*)original_state; if (grpc_call_combiner_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "call_combiner=%p: scheduling old cancel callback=%p", call_combiner, closure); } @@ -199,7 +199,7 @@ void grpc_call_combiner_cancel(grpc_call_combiner* call_combiner, if (original_state != 0) { grpc_closure* notify_on_cancel = (grpc_closure*)original_state; if (grpc_call_combiner_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "call_combiner=%p: scheduling notify_on_cancel callback=%p", call_combiner, notify_on_cancel); } diff --git a/src/core/lib/iomgr/combiner.cc b/src/core/lib/iomgr/combiner.cc index e66df031823..9429842eb85 100644 --- a/src/core/lib/iomgr/combiner.cc +++ b/src/core/lib/iomgr/combiner.cc @@ -83,12 +83,12 @@ grpc_combiner* grpc_combiner_create(void) { grpc_closure_list_init(&lock->final_list); GRPC_CLOSURE_INIT(&lock->offload, offload, lock, grpc_executor_scheduler(GRPC_EXECUTOR_SHORT)); - GRPC_COMBINER_TRACE(gpr_log(GPR_DEBUG, "C:%p create", lock)); + GRPC_COMBINER_TRACE(gpr_log(GPR_INFO, "C:%p create", lock)); return lock; } static void really_destroy(grpc_combiner* lock) { - GRPC_COMBINER_TRACE(gpr_log(GPR_DEBUG, "C:%p really_destroy", 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); @@ -97,7 +97,7 @@ static void really_destroy(grpc_combiner* lock) { static void start_destroy(grpc_combiner* lock) { gpr_atm old_state = gpr_atm_full_fetch_add(&lock->state, -STATE_UNORPHANED); GRPC_COMBINER_TRACE(gpr_log( - GPR_DEBUG, "C:%p really_destroy old_state=%" PRIdPTR, lock, old_state)); + GPR_INFO, "C:%p really_destroy old_state=%" PRIdPTR, lock, old_state)); if (old_state == 1) { really_destroy(lock); } @@ -159,7 +159,7 @@ static void combiner_exec(grpc_closure* cl, grpc_error* error) { GRPC_STATS_INC_COMBINER_LOCKS_SCHEDULED_ITEMS(); grpc_combiner* lock = COMBINER_FROM_CLOSURE_SCHEDULER(cl, scheduler); gpr_atm last = gpr_atm_full_fetch_add(&lock->state, STATE_ELEM_COUNT_LOW_BIT); - GRPC_COMBINER_TRACE(gpr_log(GPR_DEBUG, + GRPC_COMBINER_TRACE(gpr_log(GPR_INFO, "C:%p grpc_combiner_execute c=%p last=%" PRIdPTR, lock, cl, last)); if (last == 1) { @@ -203,7 +203,7 @@ static void offload(void* arg, grpc_error* error) { static void queue_offload(grpc_combiner* lock) { GRPC_STATS_INC_COMBINER_LOCKS_OFFLOADED(); move_next(); - GRPC_COMBINER_TRACE(gpr_log(GPR_DEBUG, "C:%p queue_offload", lock)); + GRPC_COMBINER_TRACE(gpr_log(GPR_INFO, "C:%p queue_offload", lock)); GRPC_CLOSURE_SCHED(&lock->offload, GRPC_ERROR_NONE); } @@ -218,7 +218,7 @@ bool grpc_combiner_continue_exec_ctx() { bool contended = gpr_atm_no_barrier_load(&lock->initiating_exec_ctx_or_null) == 0; - GRPC_COMBINER_TRACE(gpr_log(GPR_DEBUG, + GRPC_COMBINER_TRACE(gpr_log(GPR_INFO, "C:%p grpc_combiner_continue_exec_ctx " "contended=%d " "exec_ctx_ready_to_finish=%d " @@ -242,7 +242,7 @@ bool grpc_combiner_continue_exec_ctx() { (gpr_atm_acq_load(&lock->state) >> 1) > 1) { gpr_mpscq_node* n = gpr_mpscq_pop(&lock->queue); GRPC_COMBINER_TRACE( - gpr_log(GPR_DEBUG, "C:%p maybe_finish_one n=%p", lock, n)); + gpr_log(GPR_INFO, "C:%p maybe_finish_one n=%p", lock, n)); if (n == nullptr) { // queue is in an inconsistent state: use this as a cue that we should // go off and do something else for a while (and come back later) @@ -266,7 +266,7 @@ bool grpc_combiner_continue_exec_ctx() { while (c != nullptr) { GPR_TIMER_SCOPE("combiner.exec_1final", 0); GRPC_COMBINER_TRACE( - gpr_log(GPR_DEBUG, "C:%p execute_final[%d] c=%p", lock, loops, c)); + gpr_log(GPR_INFO, "C:%p execute_final[%d] c=%p", lock, loops, c)); grpc_closure* next = c->next_data.next; grpc_error* error = c->error_data.error; #ifndef NDEBUG @@ -284,7 +284,7 @@ bool grpc_combiner_continue_exec_ctx() { gpr_atm old_state = gpr_atm_full_fetch_add(&lock->state, -STATE_ELEM_COUNT_LOW_BIT); GRPC_COMBINER_TRACE( - gpr_log(GPR_DEBUG, "C:%p finish old_state=%" PRIdPTR, lock, old_state)); + gpr_log(GPR_INFO, "C:%p finish old_state=%" PRIdPTR, lock, old_state)); // Define a macro to ease readability of the following switch statement. #define OLD_STATE_WAS(orphaned, elem_count) \ (((orphaned) ? 0 : STATE_UNORPHANED) | \ @@ -327,8 +327,8 @@ static void combiner_finally_exec(grpc_closure* closure, grpc_error* error) { grpc_combiner* lock = COMBINER_FROM_CLOSURE_SCHEDULER(closure, finally_scheduler); GRPC_COMBINER_TRACE(gpr_log( - GPR_DEBUG, "C:%p grpc_combiner_execute_finally c=%p; ac=%p", lock, - closure, grpc_core::ExecCtx::Get()->combiner_data()->active_combiner)); + GPR_INFO, "C:%p grpc_combiner_execute_finally c=%p; ac=%p", lock, closure, + grpc_core::ExecCtx::Get()->combiner_data()->active_combiner)); if (grpc_core::ExecCtx::Get()->combiner_data()->active_combiner != lock) { GPR_TIMER_MARK("slowpath", 0); GRPC_CLOSURE_SCHED(GRPC_CLOSURE_CREATE(enqueue_finally, closure, diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc index 3ebaf181c1f..e5db1be0e01 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.cc +++ b/src/core/lib/iomgr/ev_epoll1_linux.cc @@ -658,7 +658,7 @@ static grpc_error* do_epoll_wait(grpc_pollset* ps, grpc_millis deadline) { GRPC_STATS_INC_POLL_EVENTS_RETURNED(r); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "ps: %p poll got %d events", ps, r); + gpr_log(GPR_INFO, "ps: %p poll got %d events", ps, r); } gpr_atm_rel_store(&g_epoll_set.num_events, r); @@ -678,7 +678,7 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, pollset->begin_refs++; if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PS:%p BEGIN_STARTS:%p", pollset, worker); + gpr_log(GPR_INFO, "PS:%p BEGIN_STARTS:%p", pollset, worker); } if (pollset->seen_inactive) { @@ -697,7 +697,7 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, gpr_mu_lock(&neighborhood->mu); gpr_mu_lock(&pollset->mu); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PS:%p BEGIN_REORG:%p kick_state=%s is_reassigning=%d", + gpr_log(GPR_INFO, "PS:%p BEGIN_REORG:%p kick_state=%s is_reassigning=%d", pollset, worker, kick_state_string(worker->state), is_reassigning); } @@ -749,7 +749,7 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, gpr_cv_init(&worker->cv); while (worker->state == UNKICKED && !pollset->shutting_down) { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PS:%p BEGIN_WAIT:%p kick_state=%s shutdown=%d", + gpr_log(GPR_INFO, "PS:%p BEGIN_WAIT:%p kick_state=%s shutdown=%d", pollset, worker, kick_state_string(worker->state), pollset->shutting_down); } @@ -766,7 +766,7 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, } if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "PS:%p BEGIN_DONE:%p kick_state=%s shutdown=%d " "kicked_without_poller: %d", pollset, worker, kick_state_string(worker->state), @@ -809,7 +809,7 @@ static bool check_neighborhood_for_available_poller( if (gpr_atm_no_barrier_cas(&g_active_poller, 0, (gpr_atm)inspect_worker)) { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. choose next poller to be %p", + gpr_log(GPR_INFO, " .. choose next poller to be %p", inspect_worker); } SET_KICK_STATE(inspect_worker, DESIGNATED_POLLER); @@ -820,7 +820,7 @@ static bool check_neighborhood_for_available_poller( } } else { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. beaten to choose next poller"); + gpr_log(GPR_INFO, " .. beaten to choose next poller"); } } // even if we didn't win the cas, there's a worker, we can stop @@ -838,7 +838,7 @@ static bool check_neighborhood_for_available_poller( } if (!found_worker) { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. mark pollset %p inactive", inspect); + gpr_log(GPR_INFO, " .. mark pollset %p inactive", inspect); } inspect->seen_inactive = true; if (inspect == neighborhood->active_root) { @@ -858,7 +858,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, grpc_pollset_worker** worker_hdl) { GPR_TIMER_SCOPE("end_worker", 0); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PS:%p END_WORKER:%p", pollset, worker); + gpr_log(GPR_INFO, "PS:%p END_WORKER:%p", pollset, worker); } if (worker_hdl != nullptr) *worker_hdl = nullptr; /* Make sure we appear kicked */ @@ -868,7 +868,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, if (gpr_atm_no_barrier_load(&g_active_poller) == (gpr_atm)worker) { if (worker->next != worker && worker->next->state == UNKICKED) { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. choose next poller to be peer %p", worker); + gpr_log(GPR_INFO, " .. choose next poller to be peer %p", worker); } GPR_ASSERT(worker->next->initialized_cv); gpr_atm_no_barrier_store(&g_active_poller, (gpr_atm)worker->next); @@ -920,7 +920,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, gpr_cv_destroy(&worker->cv); } if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. remove worker"); + gpr_log(GPR_INFO, " .. remove worker"); } if (EMPTIED == worker_remove(pollset, worker)) { pollset_maybe_finish_shutdown(pollset); @@ -1022,7 +1022,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, GRPC_STATS_INC_POLLSET_KICKED_WITHOUT_POLLER(); pollset->kicked_without_poller = true; if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. kicked_without_poller"); + gpr_log(GPR_INFO, " .. kicked_without_poller"); } goto done; } @@ -1030,14 +1030,14 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, if (root_worker->state == KICKED) { GRPC_STATS_INC_POLLSET_KICKED_AGAIN(); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. already kicked %p", root_worker); + gpr_log(GPR_INFO, " .. already kicked %p", root_worker); } SET_KICK_STATE(root_worker, KICKED); goto done; } else if (next_worker->state == KICKED) { GRPC_STATS_INC_POLLSET_KICKED_AGAIN(); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. already kicked %p", next_worker); + gpr_log(GPR_INFO, " .. already kicked %p", next_worker); } SET_KICK_STATE(next_worker, KICKED); goto done; @@ -1048,7 +1048,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, &g_active_poller)) { GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD(); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. kicked %p", root_worker); + gpr_log(GPR_INFO, " .. kicked %p", root_worker); } SET_KICK_STATE(root_worker, KICKED); ret_err = grpc_wakeup_fd_wakeup(&global_wakeup_fd); @@ -1056,7 +1056,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, } else if (next_worker->state == UNKICKED) { GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV(); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. kicked %p", next_worker); + gpr_log(GPR_INFO, " .. kicked %p", next_worker); } GPR_ASSERT(next_worker->initialized_cv); SET_KICK_STATE(next_worker, KICKED); @@ -1066,7 +1066,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, if (root_worker->state != DESIGNATED_POLLER) { if (grpc_polling_trace.enabled()) { gpr_log( - GPR_DEBUG, + GPR_INFO, " .. kicked root non-poller %p (initialized_cv=%d) (poller=%p)", root_worker, root_worker->initialized_cv, next_worker); } @@ -1079,7 +1079,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, } else { GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD(); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. non-root poller %p (root=%p)", next_worker, + gpr_log(GPR_INFO, " .. non-root poller %p (root=%p)", next_worker, root_worker); } SET_KICK_STATE(next_worker, KICKED); @@ -1095,7 +1095,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, } else { GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD(); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. kicked while waking up"); + gpr_log(GPR_INFO, " .. kicked while waking up"); } goto done; } @@ -1105,14 +1105,14 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, if (specific_worker->state == KICKED) { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. specific worker already kicked"); + gpr_log(GPR_INFO, " .. specific worker already kicked"); } goto done; } else if (gpr_tls_get(&g_current_thread_worker) == (intptr_t)specific_worker) { GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD(); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. mark %p kicked", specific_worker); + gpr_log(GPR_INFO, " .. mark %p kicked", specific_worker); } SET_KICK_STATE(specific_worker, KICKED); goto done; @@ -1120,7 +1120,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, (grpc_pollset_worker*)gpr_atm_no_barrier_load(&g_active_poller)) { GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD(); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. kick active poller"); + gpr_log(GPR_INFO, " .. kick active poller"); } SET_KICK_STATE(specific_worker, KICKED); ret_err = grpc_wakeup_fd_wakeup(&global_wakeup_fd); @@ -1128,7 +1128,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, } else if (specific_worker->initialized_cv) { GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV(); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. kick waiting worker"); + gpr_log(GPR_INFO, " .. kick waiting worker"); } SET_KICK_STATE(specific_worker, KICKED); gpr_cv_signal(&specific_worker->cv); @@ -1136,7 +1136,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, } else { GRPC_STATS_INC_POLLSET_KICKED_AGAIN(); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. kick non-waiting worker"); + gpr_log(GPR_INFO, " .. kick non-waiting worker"); } SET_KICK_STATE(specific_worker, KICKED); goto done; diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc index 44d8cf2b1e7..65f1c912af7 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.cc +++ b/src/core/lib/iomgr/ev_epollex_linux.cc @@ -518,7 +518,7 @@ static grpc_error* pollable_add_fd(pollable* p, grpc_fd* fd) { const int epfd = p->epfd; if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "add fd %p (%d) to pollable %p", fd, fd->fd, p); + gpr_log(GPR_INFO, "add fd %p (%d) to pollable %p", fd, fd->fd, p); } struct epoll_event ev_fd; @@ -560,7 +560,7 @@ static void pollset_global_shutdown(void) { /* pollset->mu must be held while calling this function */ static void pollset_maybe_finish_shutdown(grpc_pollset* pollset) { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "PS:%p (pollable:%p) maybe_finish_shutdown sc=%p (target:!NULL) " "rw=%p (target:NULL) cpsc=%d (target:0)", pollset, pollset->active_pollable, pollset->shutdown_closure, @@ -585,14 +585,14 @@ static grpc_error* kick_one_worker(grpc_pollset_worker* specific_worker) { GPR_ASSERT(specific_worker != nullptr); if (specific_worker->kicked) { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PS:%p kicked_specific_but_already_kicked", p); + gpr_log(GPR_INFO, "PS:%p kicked_specific_but_already_kicked", p); } GRPC_STATS_INC_POLLSET_KICKED_AGAIN(); return GRPC_ERROR_NONE; } if (gpr_tls_get(&g_current_thread_worker) == (intptr_t)specific_worker) { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PS:%p kicked_specific_but_awake", p); + gpr_log(GPR_INFO, "PS:%p kicked_specific_but_awake", p); } GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD(); specific_worker->kicked = true; @@ -601,7 +601,7 @@ static grpc_error* kick_one_worker(grpc_pollset_worker* specific_worker) { if (specific_worker == p->root_worker) { GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD(); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PS:%p kicked_specific_via_wakeup_fd", p); + gpr_log(GPR_INFO, "PS:%p kicked_specific_via_wakeup_fd", p); } specific_worker->kicked = true; grpc_error* error = grpc_wakeup_fd_wakeup(&p->wakeup); @@ -610,7 +610,7 @@ static grpc_error* kick_one_worker(grpc_pollset_worker* specific_worker) { if (specific_worker->initialized_cv) { GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV(); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PS:%p kicked_specific_via_cv", p); + gpr_log(GPR_INFO, "PS:%p kicked_specific_via_cv", p); } specific_worker->kicked = true; gpr_cv_signal(&specific_worker->cv); @@ -626,7 +626,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, GPR_TIMER_SCOPE("pollset_kick", 0); GRPC_STATS_INC_POLLSET_KICK(); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "PS:%p kick %p tls_pollset=%p tls_worker=%p pollset.root_worker=%p", pollset, specific_worker, (void*)gpr_tls_get(&g_current_thread_pollset), @@ -636,7 +636,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, if (gpr_tls_get(&g_current_thread_pollset) != (intptr_t)pollset) { if (pollset->root_worker == nullptr) { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PS:%p kicked_any_without_poller", pollset); + gpr_log(GPR_INFO, "PS:%p kicked_any_without_poller", pollset); } GRPC_STATS_INC_POLLSET_KICKED_WITHOUT_POLLER(); pollset->kicked_without_poller = true; @@ -662,7 +662,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset, } } else { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PS:%p kicked_any_but_awake", pollset); + gpr_log(GPR_INFO, "PS:%p kicked_any_but_awake", pollset); } GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD(); return GRPC_ERROR_NONE; @@ -784,7 +784,7 @@ static grpc_error* pollable_process_events(grpc_pollset* pollset, void* data_ptr = ev->data.ptr; if (1 & (intptr_t)data_ptr) { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PS:%p got pollset_wakeup %p", pollset, data_ptr); + gpr_log(GPR_INFO, "PS:%p got pollset_wakeup %p", pollset, data_ptr); } append_error(&error, grpc_wakeup_fd_consume_wakeup( @@ -797,7 +797,7 @@ static grpc_error* pollable_process_events(grpc_pollset* pollset, bool read_ev = (ev->events & (EPOLLIN | EPOLLPRI)) != 0; bool write_ev = (ev->events & EPOLLOUT) != 0; if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "PS:%p got fd %p: cancel=%d read=%d " "write=%d", pollset, fd, cancel, read_ev, write_ev); @@ -827,7 +827,7 @@ static grpc_error* pollable_epoll(pollable* p, grpc_millis deadline) { if (grpc_polling_trace.enabled()) { char* desc = pollable_desc(p); - gpr_log(GPR_DEBUG, "POLLABLE:%p[%s] poll for %dms", p, desc, timeout); + gpr_log(GPR_INFO, "POLLABLE:%p[%s] poll for %dms", p, desc, timeout); gpr_free(desc); } @@ -846,7 +846,7 @@ static grpc_error* pollable_epoll(pollable* p, grpc_millis deadline) { if (r < 0) return GRPC_OS_ERROR(errno, "epoll_wait"); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "POLLABLE:%p got %d events", p, r); + gpr_log(GPR_INFO, "POLLABLE:%p got %d events", p, r); } p->event_cursor = 0; @@ -917,7 +917,7 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, gpr_mu_unlock(&pollset->mu); if (grpc_polling_trace.enabled() && worker->pollable_obj->root_worker != worker) { - gpr_log(GPR_DEBUG, "PS:%p wait %p w=%p for %dms", pollset, + gpr_log(GPR_INFO, "PS:%p wait %p w=%p for %dms", pollset, worker->pollable_obj, worker, poll_deadline_to_millis_timeout(deadline)); } @@ -925,19 +925,19 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, if (gpr_cv_wait(&worker->cv, &worker->pollable_obj->mu, grpc_millis_to_timespec(deadline, GPR_CLOCK_REALTIME))) { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PS:%p timeout_wait %p w=%p", pollset, + gpr_log(GPR_INFO, "PS:%p timeout_wait %p w=%p", pollset, worker->pollable_obj, worker); } do_poll = false; } else if (worker->kicked) { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PS:%p wakeup %p w=%p", pollset, + gpr_log(GPR_INFO, "PS:%p wakeup %p w=%p", pollset, worker->pollable_obj, worker); } do_poll = false; } else if (grpc_polling_trace.enabled() && worker->pollable_obj->root_worker != worker) { - gpr_log(GPR_DEBUG, "PS:%p spurious_wakeup %p w=%p", pollset, + gpr_log(GPR_INFO, "PS:%p spurious_wakeup %p w=%p", pollset, worker->pollable_obj, worker); } } @@ -1009,7 +1009,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset, WORKER_PTR->originator = gettid(); #endif if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "PS:%p work hdl=%p worker=%p now=%" PRIdPTR " deadline=%" PRIdPTR " kwp=%d pollable=%p", pollset, worker_hdl, WORKER_PTR, grpc_core::ExecCtx::Get()->Now(), @@ -1050,7 +1050,7 @@ static grpc_error* pollset_transition_pollable_from_empty_to_fd_locked( static const char* err_desc = "pollset_transition_pollable_from_empty_to_fd"; grpc_error* error = GRPC_ERROR_NONE; if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "PS:%p add fd %p (%d); transition pollable from empty to fd", pollset, fd, fd->fd); } @@ -1067,7 +1067,7 @@ static grpc_error* pollset_transition_pollable_from_fd_to_multi_locked( grpc_error* error = GRPC_ERROR_NONE; if (grpc_polling_trace.enabled()) { gpr_log( - GPR_DEBUG, + GPR_INFO, "PS:%p add fd %p (%d); transition pollable from fd %p to multipoller", pollset, and_add_fd, and_add_fd ? and_add_fd->fd : -1, pollset->active_pollable->owner_fd); @@ -1137,7 +1137,7 @@ static grpc_error* pollset_as_multipollable_locked(grpc_pollset* pollset, /* Any workers currently polling on this pollset must now be woked up so * that they can pick up the new active_pollable */ if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "PS:%p active pollable transition from empty to multi", pollset); } @@ -1224,7 +1224,7 @@ static void pollset_set_unref(grpc_pollset_set* pss) { static void pollset_set_add_fd(grpc_pollset_set* pss, grpc_fd* fd) { GPR_TIMER_SCOPE("pollset_set_add_fd", 0); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PSS:%p: add fd %p (%d)", pss, fd, fd->fd); + gpr_log(GPR_INFO, "PSS:%p: add fd %p (%d)", pss, fd, fd->fd); } grpc_error* error = GRPC_ERROR_NONE; static const char* err_desc = "pollset_set_add_fd"; @@ -1248,7 +1248,7 @@ static void pollset_set_add_fd(grpc_pollset_set* pss, grpc_fd* fd) { static void pollset_set_del_fd(grpc_pollset_set* pss, grpc_fd* fd) { GPR_TIMER_SCOPE("pollset_set_del_fd", 0); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PSS:%p: del fd %p", pss, fd); + gpr_log(GPR_INFO, "PSS:%p: del fd %p", pss, fd); } pss = pss_lock_adam(pss); size_t i; @@ -1269,7 +1269,7 @@ static void pollset_set_del_fd(grpc_pollset_set* pss, grpc_fd* fd) { static void pollset_set_del_pollset(grpc_pollset_set* pss, grpc_pollset* ps) { GPR_TIMER_SCOPE("pollset_set_del_pollset", 0); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PSS:%p: del pollset %p", pss, ps); + gpr_log(GPR_INFO, "PSS:%p: del pollset %p", pss, ps); } pss = pss_lock_adam(pss); size_t i; @@ -1321,7 +1321,7 @@ static grpc_error* add_fds_to_pollsets(grpc_fd** fds, size_t fd_count, static void pollset_set_add_pollset(grpc_pollset_set* pss, grpc_pollset* ps) { GPR_TIMER_SCOPE("pollset_set_add_pollset", 0); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PSS:%p: add pollset %p", pss, ps); + gpr_log(GPR_INFO, "PSS:%p: add pollset %p", pss, ps); } grpc_error* error = GRPC_ERROR_NONE; static const char* err_desc = "pollset_set_add_pollset"; @@ -1358,7 +1358,7 @@ static void pollset_set_add_pollset_set(grpc_pollset_set* a, grpc_pollset_set* b) { GPR_TIMER_SCOPE("pollset_set_add_pollset_set", 0); if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PSS: merge (%p, %p)", a, b); + gpr_log(GPR_INFO, "PSS: merge (%p, %p)", a, b); } grpc_error* error = GRPC_ERROR_NONE; static const char* err_desc = "pollset_set_add_fd"; @@ -1392,7 +1392,7 @@ static void pollset_set_add_pollset_set(grpc_pollset_set* a, GPR_SWAP(grpc_pollset_set*, a, b); } if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "PSS: parent %p to %p", b, a); + gpr_log(GPR_INFO, "PSS: parent %p to %p", b, a); } gpr_ref(&a->refs); b->parent = a; diff --git a/src/core/lib/iomgr/ev_epollsig_linux.cc b/src/core/lib/iomgr/ev_epollsig_linux.cc index 1e30f6637b3..494bc71c1d9 100644 --- a/src/core/lib/iomgr/ev_epollsig_linux.cc +++ b/src/core/lib/iomgr/ev_epollsig_linux.cc @@ -292,7 +292,7 @@ static void pi_add_ref_dbg(polling_island* pi, const char* reason, const char* file, int line) { if (grpc_polling_trace.enabled()) { gpr_atm old_cnt = gpr_atm_acq_load(&pi->ref_count); - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "Add ref pi: %p, old:%" PRIdPTR " -> new:%" PRIdPTR " (%s) - (%s, %d)", pi, old_cnt, old_cnt + 1, reason, file, line); @@ -304,7 +304,7 @@ static void pi_unref_dbg(polling_island* pi, const char* reason, const char* file, int line) { if (grpc_polling_trace.enabled()) { gpr_atm old_cnt = gpr_atm_acq_load(&pi->ref_count); - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "Unref pi: %p, old:%" PRIdPTR " -> new:%" PRIdPTR " (%s) - (%s, %d)", pi, old_cnt, (old_cnt - 1), reason, file, line); diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc index d9aba9b6a3b..504787e659b 100644 --- a/src/core/lib/iomgr/ev_poll_posix.cc +++ b/src/core/lib/iomgr/ev_poll_posix.cc @@ -983,7 +983,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset, GRPC_SCHEDULING_END_BLOCKING_REGION; if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "%p poll=%d", pollset, r); + gpr_log(GPR_INFO, "%p poll=%d", pollset, r); } if (r < 0) { @@ -1007,7 +1007,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset, } else { if (pfds[0].revents & POLLIN_CHECK) { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "%p: got_wakeup", pollset); + gpr_log(GPR_INFO, "%p: got_wakeup", pollset); } work_combine_error( &error, grpc_wakeup_fd_consume_wakeup(&worker.wakeup_fd->fd)); @@ -1017,7 +1017,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset, fd_end_poll(&watchers[i], 0, 0, nullptr); } else { if (grpc_polling_trace.enabled()) { - gpr_log(GPR_DEBUG, "%p got_event: %d r:%d w:%d [%d]", pollset, + gpr_log(GPR_INFO, "%p got_event: %d r:%d w:%d [%d]", pollset, pfds[i].fd, (pfds[i].revents & POLLIN_CHECK) != 0, (pfds[i].revents & POLLOUT_CHECK) != 0, pfds[i].revents); } diff --git a/src/core/lib/iomgr/ev_posix.cc b/src/core/lib/iomgr/ev_posix.cc index 8b800702653..4ea63fc6e8f 100644 --- a/src/core/lib/iomgr/ev_posix.cc +++ b/src/core/lib/iomgr/ev_posix.cc @@ -46,9 +46,9 @@ grpc_core::DebugOnlyTraceFlag grpc_polling_api_trace(false, "polling_api"); #ifndef NDEBUG // Polling API trace only enabled in debug builds -#define GRPC_POLLING_API_TRACE(format, ...) \ - if (grpc_polling_api_trace.enabled()) { \ - gpr_log(GPR_DEBUG, "(polling-api) " format, __VA_ARGS__); \ +#define GRPC_POLLING_API_TRACE(format, ...) \ + if (grpc_polling_api_trace.enabled()) { \ + gpr_log(GPR_INFO, "(polling-api) " format, __VA_ARGS__); \ } #else #define GRPC_POLLING_API_TRACE(...) diff --git a/src/core/lib/iomgr/executor.cc b/src/core/lib/iomgr/executor.cc index b017db53f8a..f19f8cf20d5 100644 --- a/src/core/lib/iomgr/executor.cc +++ b/src/core/lib/iomgr/executor.cc @@ -69,7 +69,7 @@ static size_t run_closures(grpc_closure_list list) { gpr_log(GPR_DEBUG, "EXECUTOR: run %p [created by %s:%d]", c, c->file_created, c->line_created); #else - gpr_log(GPR_DEBUG, "EXECUTOR: run %p", c); + gpr_log(GPR_INFO, "EXECUTOR: run %p", c); #endif } #ifndef NDEBUG @@ -150,7 +150,7 @@ static void executor_thread(void* arg) { size_t subtract_depth = 0; for (;;) { if (executor_trace.enabled()) { - gpr_log(GPR_DEBUG, "EXECUTOR[%d]: step (sub_depth=%" PRIdPTR ")", + gpr_log(GPR_INFO, "EXECUTOR[%d]: step (sub_depth=%" PRIdPTR ")", static_cast(ts - g_thread_state), subtract_depth); } gpr_mu_lock(&ts->mu); @@ -161,7 +161,7 @@ static void executor_thread(void* arg) { } if (ts->shutdown) { if (executor_trace.enabled()) { - gpr_log(GPR_DEBUG, "EXECUTOR[%d]: shutdown", + gpr_log(GPR_INFO, "EXECUTOR[%d]: shutdown", static_cast(ts - g_thread_state)); } gpr_mu_unlock(&ts->mu); @@ -172,7 +172,7 @@ static void executor_thread(void* arg) { ts->elems = GRPC_CLOSURE_LIST_INIT; gpr_mu_unlock(&ts->mu); if (executor_trace.enabled()) { - gpr_log(GPR_DEBUG, "EXECUTOR[%d]: execute", + gpr_log(GPR_INFO, "EXECUTOR[%d]: execute", static_cast(ts - g_thread_state)); } @@ -199,7 +199,7 @@ static void executor_push(grpc_closure* closure, grpc_error* error, gpr_log(GPR_DEBUG, "EXECUTOR: schedule %p (created %s:%d) inline", closure, closure->file_created, closure->line_created); #else - gpr_log(GPR_DEBUG, "EXECUTOR: schedule %p inline", closure); + gpr_log(GPR_INFO, "EXECUTOR: schedule %p inline", closure); #endif } grpc_closure_list_append(grpc_core::ExecCtx::Get()->closure_list(), @@ -225,7 +225,7 @@ static void executor_push(grpc_closure* closure, grpc_error* error, closure, is_short ? "short" : "long", closure->file_created, closure->line_created, static_cast(ts - g_thread_state)); #else - gpr_log(GPR_DEBUG, "EXECUTOR: try to schedule %p (%s) to thread %d", + gpr_log(GPR_INFO, "EXECUTOR: try to schedule %p (%s) to thread %d", closure, is_short ? "short" : "long", (int)(ts - g_thread_state)); #endif diff --git a/src/core/lib/iomgr/resource_quota.cc b/src/core/lib/iomgr/resource_quota.cc index 8c42dd78cf1..8cf4fe99282 100644 --- a/src/core/lib/iomgr/resource_quota.cc +++ b/src/core/lib/iomgr/resource_quota.cc @@ -289,7 +289,7 @@ static bool rq_alloc(grpc_resource_quota* resource_quota) { GRPC_RULIST_AWAITING_ALLOCATION))) { gpr_mu_lock(&resource_user->mu); if (grpc_resource_quota_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "RQ: check allocation for user %p shutdown=%" PRIdPTR " free_pool=%" PRId64, resource_user, gpr_atm_no_barrier_load(&resource_user->shutdown), @@ -315,7 +315,7 @@ static bool rq_alloc(grpc_resource_quota* resource_quota) { resource_quota->free_pool -= amt; rq_update_estimate(resource_quota); if (grpc_resource_quota_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "RQ %s %s: grant alloc %" PRId64 " bytes; rq_free_pool -> %" PRId64, resource_quota->name, resource_user->name, amt, @@ -323,7 +323,7 @@ static bool rq_alloc(grpc_resource_quota* resource_quota) { } } else if (grpc_resource_quota_trace.enabled() && resource_user->free_pool >= 0) { - gpr_log(GPR_DEBUG, "RQ %s %s: discard already satisfied alloc request", + gpr_log(GPR_INFO, "RQ %s %s: discard already satisfied alloc request", resource_quota->name, resource_user->name); } if (resource_user->free_pool >= 0) { @@ -353,7 +353,7 @@ static bool rq_reclaim_from_per_user_free_pool( resource_quota->free_pool += amt; rq_update_estimate(resource_quota); if (grpc_resource_quota_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "RQ %s %s: reclaim_from_per_user_free_pool %" PRId64 " bytes; rq_free_pool -> %" PRId64, resource_quota->name, resource_user->name, amt, @@ -376,9 +376,8 @@ static bool rq_reclaim(grpc_resource_quota* resource_quota, bool destructive) { grpc_resource_user* resource_user = rulist_pop_head(resource_quota, list); if (resource_user == nullptr) return false; if (grpc_resource_quota_trace.enabled()) { - gpr_log(GPR_DEBUG, "RQ %s %s: initiate %s reclamation", - resource_quota->name, resource_user->name, - destructive ? "destructive" : "benign"); + gpr_log(GPR_INFO, "RQ %s %s: initiate %s reclamation", resource_quota->name, + resource_user->name, destructive ? "destructive" : "benign"); } resource_quota->reclaiming = true; grpc_resource_quota_ref_internal(resource_quota); @@ -506,7 +505,7 @@ static void ru_post_destructive_reclaimer(void* ru, grpc_error* error) { static void ru_shutdown(void* ru, grpc_error* error) { if (grpc_resource_quota_trace.enabled()) { - gpr_log(GPR_DEBUG, "RU shutdown %p", ru); + gpr_log(GPR_INFO, "RU shutdown %p", ru); } grpc_resource_user* resource_user = static_cast(ru); gpr_mu_lock(&resource_user->mu); @@ -793,7 +792,7 @@ void grpc_resource_user_alloc(grpc_resource_user* resource_user, size_t size, resource_user->free_pool -= static_cast(size); resource_user->outstanding_allocations += static_cast(size); if (grpc_resource_quota_trace.enabled()) { - gpr_log(GPR_DEBUG, "RQ %s %s: alloc %" PRIdPTR "; free_pool -> %" PRId64, + gpr_log(GPR_INFO, "RQ %s %s: alloc %" PRIdPTR "; free_pool -> %" PRId64, resource_user->resource_quota->name, resource_user->name, size, resource_user->free_pool); } @@ -816,7 +815,7 @@ void grpc_resource_user_free(grpc_resource_user* resource_user, size_t size) { bool was_zero_or_negative = resource_user->free_pool <= 0; resource_user->free_pool += static_cast(size); if (grpc_resource_quota_trace.enabled()) { - gpr_log(GPR_DEBUG, "RQ %s %s: free %" PRIdPTR "; free_pool -> %" PRId64, + gpr_log(GPR_INFO, "RQ %s %s: free %" PRIdPTR "; free_pool -> %" PRId64, resource_user->resource_quota->name, resource_user->name, size, resource_user->free_pool); } @@ -842,7 +841,7 @@ void grpc_resource_user_post_reclaimer(grpc_resource_user* resource_user, void grpc_resource_user_finish_reclamation(grpc_resource_user* resource_user) { if (grpc_resource_quota_trace.enabled()) { - gpr_log(GPR_DEBUG, "RQ %s %s: reclamation complete", + gpr_log(GPR_INFO, "RQ %s %s: reclamation complete", resource_user->resource_quota->name, resource_user->name); } GRPC_CLOSURE_SCHED( diff --git a/src/core/lib/iomgr/tcp_client_custom.cc b/src/core/lib/iomgr/tcp_client_custom.cc index 55632a55a19..932c79ea0b9 100644 --- a/src/core/lib/iomgr/tcp_client_custom.cc +++ b/src/core/lib/iomgr/tcp_client_custom.cc @@ -66,7 +66,7 @@ static void on_alarm(void* acp, grpc_error* error) { grpc_custom_tcp_connect* connect = socket->connector; if (grpc_tcp_trace.enabled()) { const char* str = grpc_error_string(error); - gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: on_alarm: error=%s", + gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_alarm: error=%s", connect->addr_name, str); } if (error == GRPC_ERROR_NONE) { @@ -136,7 +136,7 @@ static void tcp_connect(grpc_closure* closure, grpc_endpoint** ep, connect->refs = 2; if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %p %s: asynchronously connecting", + gpr_log(GPR_INFO, "CLIENT_CONNECT: %p %s: asynchronously connecting", socket, connect->addr_name); } diff --git a/src/core/lib/iomgr/tcp_client_posix.cc b/src/core/lib/iomgr/tcp_client_posix.cc index 9f19b833dab..6144d389f7c 100644 --- a/src/core/lib/iomgr/tcp_client_posix.cc +++ b/src/core/lib/iomgr/tcp_client_posix.cc @@ -104,7 +104,7 @@ static void tc_on_alarm(void* acp, grpc_error* error) { async_connect* ac = static_cast(acp); if (grpc_tcp_trace.enabled()) { const char* str = grpc_error_string(error); - gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: on_alarm: error=%s", ac->addr_str, + gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_alarm: error=%s", ac->addr_str, str); } gpr_mu_lock(&ac->mu); @@ -141,8 +141,8 @@ static void on_writable(void* acp, grpc_error* error) { if (grpc_tcp_trace.enabled()) { const char* str = grpc_error_string(error); - gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: on_writable: error=%s", - ac->addr_str, str); + gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_writable: error=%s", ac->addr_str, + str); } gpr_mu_lock(&ac->mu); @@ -325,7 +325,7 @@ void grpc_tcp_client_create_from_prepared_fd( ac->channel_args = grpc_channel_args_copy(channel_args); if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: asynchronously connecting fd %p", + gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: asynchronously connecting fd %p", ac->addr_str, fdobj); } diff --git a/src/core/lib/iomgr/tcp_custom.cc b/src/core/lib/iomgr/tcp_custom.cc index 2b1fc930285..b3b29340146 100644 --- a/src/core/lib/iomgr/tcp_custom.cc +++ b/src/core/lib/iomgr/tcp_custom.cc @@ -125,16 +125,16 @@ static void tcp_ref(custom_tcp_endpoint* tcp) { gpr_ref(&tcp->refcount); } static void call_read_cb(custom_tcp_endpoint* tcp, grpc_error* error) { grpc_closure* cb = tcp->read_cb; if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP:%p call_cb %p %p:%p", tcp->socket, cb, cb->cb, + gpr_log(GPR_INFO, "TCP:%p call_cb %p %p:%p", tcp->socket, cb, cb->cb, cb->cb_arg); size_t i; const char* str = grpc_error_string(error); - gpr_log(GPR_DEBUG, "read: error=%s", str); + gpr_log(GPR_INFO, "read: error=%s", str); for (i = 0; i < tcp->read_slices->count; i++) { char* dump = grpc_dump_slice(tcp->read_slices->slices[i], GPR_DUMP_HEX | GPR_DUMP_ASCII); - gpr_log(GPR_DEBUG, "READ %p (peer=%s): %s", tcp, tcp->peer_string, dump); + gpr_log(GPR_INFO, "READ %p (peer=%s): %s", tcp, tcp->peer_string, dump); gpr_free(dump); } } @@ -171,7 +171,7 @@ static void custom_read_callback(grpc_custom_socket* socket, size_t nread, static void tcp_read_allocation_done(void* tcpp, grpc_error* error) { custom_tcp_endpoint* tcp = (custom_tcp_endpoint*)tcpp; if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP:%p read_allocation_done: %s", tcp->socket, + gpr_log(GPR_INFO, "TCP:%p read_allocation_done: %s", tcp->socket, grpc_error_string(error)); } if (error == GRPC_ERROR_NONE) { @@ -188,7 +188,7 @@ static void tcp_read_allocation_done(void* tcpp, grpc_error* error) { } if (grpc_tcp_trace.enabled()) { const char* str = grpc_error_string(error); - gpr_log(GPR_DEBUG, "Initiating read on %p: error=%s", tcp->socket, str); + gpr_log(GPR_INFO, "Initiating read on %p: error=%s", tcp->socket, str); } } @@ -214,7 +214,7 @@ static void custom_write_callback(grpc_custom_socket* socket, tcp->write_cb = nullptr; if (grpc_tcp_trace.enabled()) { const char* str = grpc_error_string(error); - gpr_log(GPR_DEBUG, "write complete on %p: error=%s", tcp->socket, str); + gpr_log(GPR_INFO, "write complete on %p: error=%s", tcp->socket, str); } TCP_UNREF(tcp, "write"); GRPC_CLOSURE_SCHED(cb, error); @@ -231,8 +231,8 @@ static void endpoint_write(grpc_endpoint* ep, grpc_slice_buffer* write_slices, for (j = 0; j < write_slices->count; j++) { char* data = grpc_dump_slice(write_slices->slices[j], GPR_DUMP_HEX | GPR_DUMP_ASCII); - gpr_log(GPR_DEBUG, "WRITE %p (peer=%s): %s", tcp->socket, - tcp->peer_string, data); + gpr_log(GPR_INFO, "WRITE %p (peer=%s): %s", tcp->socket, tcp->peer_string, + data); gpr_free(data); } } @@ -283,7 +283,7 @@ static void endpoint_shutdown(grpc_endpoint* ep, grpc_error* why) { if (!tcp->shutting_down) { if (grpc_tcp_trace.enabled()) { const char* str = grpc_error_string(why); - gpr_log(GPR_DEBUG, "TCP %p shutdown why=%s", tcp->socket, str); + gpr_log(GPR_INFO, "TCP %p shutdown why=%s", tcp->socket, str); } tcp->shutting_down = true; // GRPC_CLOSURE_SCHED(tcp->read_cb, GRPC_ERROR_REF(why)); @@ -345,7 +345,7 @@ grpc_endpoint* custom_tcp_endpoint_create(grpc_custom_socket* socket, grpc_core::ExecCtx exec_ctx; if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "Creating TCP endpoint %p", socket); + gpr_log(GPR_INFO, "Creating TCP endpoint %p", socket); } memset(tcp, 0, sizeof(custom_tcp_endpoint)); socket->refs++; diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index 205af225315..fc2b94d693a 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -120,7 +120,7 @@ static void tcp_drop_uncovered_then_handle_write(void* arg /* grpc_tcp */, static void done_poller(void* bp, grpc_error* error_ignored) { backup_poller* p = static_cast(bp); if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "BACKUP_POLLER:%p destroy", p); + gpr_log(GPR_INFO, "BACKUP_POLLER:%p destroy", p); } grpc_pollset_destroy(BACKUP_POLLER_POLLSET(p)); gpr_free(p); @@ -129,7 +129,7 @@ static void done_poller(void* bp, grpc_error* error_ignored) { static void run_poller(void* bp, grpc_error* error_ignored) { backup_poller* p = static_cast(bp); if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "BACKUP_POLLER:%p run", p); + gpr_log(GPR_INFO, "BACKUP_POLLER:%p run", p); } gpr_mu_lock(p->pollset_mu); grpc_millis deadline = grpc_core::ExecCtx::Get()->Now() + 10 * GPR_MS_PER_SEC; @@ -145,18 +145,18 @@ static void run_poller(void* bp, grpc_error* error_ignored) { gpr_mu_lock(p->pollset_mu); bool cas_ok = gpr_atm_full_cas(&g_backup_poller, (gpr_atm)p, 0); if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "BACKUP_POLLER:%p done cas_ok=%d", p, cas_ok); + gpr_log(GPR_INFO, "BACKUP_POLLER:%p done cas_ok=%d", p, cas_ok); } gpr_mu_unlock(p->pollset_mu); if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "BACKUP_POLLER:%p shutdown", p); + gpr_log(GPR_INFO, "BACKUP_POLLER:%p shutdown", p); } grpc_pollset_shutdown(BACKUP_POLLER_POLLSET(p), GRPC_CLOSURE_INIT(&p->run_poller, done_poller, p, grpc_schedule_on_exec_ctx)); } else { if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "BACKUP_POLLER:%p reschedule", p); + gpr_log(GPR_INFO, "BACKUP_POLLER:%p reschedule", p); } GRPC_CLOSURE_SCHED(&p->run_poller, GRPC_ERROR_NONE); } @@ -167,7 +167,7 @@ static void drop_uncovered(grpc_tcp* tcp) { gpr_atm old_count = gpr_atm_no_barrier_fetch_add(&g_uncovered_notifications_pending, -1); if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "BACKUP_POLLER:%p uncover cnt %d->%d", p, + gpr_log(GPR_INFO, "BACKUP_POLLER:%p uncover cnt %d->%d", p, static_cast(old_count), static_cast(old_count) - 1); } GPR_ASSERT(old_count != 1); @@ -178,7 +178,7 @@ static void cover_self(grpc_tcp* tcp) { gpr_atm old_count = gpr_atm_no_barrier_fetch_add(&g_uncovered_notifications_pending, 2); if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "BACKUP_POLLER: cover cnt %d->%d", + gpr_log(GPR_INFO, "BACKUP_POLLER: cover cnt %d->%d", static_cast(old_count), 2 + static_cast(old_count)); } if (old_count == 0) { @@ -186,7 +186,7 @@ static void cover_self(grpc_tcp* tcp) { p = static_cast( gpr_zalloc(sizeof(*p) + grpc_pollset_size())); if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "BACKUP_POLLER:%p create", p); + gpr_log(GPR_INFO, "BACKUP_POLLER:%p create", p); } grpc_pollset_init(BACKUP_POLLER_POLLSET(p), &p->pollset_mu); gpr_atm_rel_store(&g_backup_poller, (gpr_atm)p); @@ -201,7 +201,7 @@ static void cover_self(grpc_tcp* tcp) { } } if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "BACKUP_POLLER:%p add %p", p, tcp); + gpr_log(GPR_INFO, "BACKUP_POLLER:%p add %p", p, tcp); } grpc_pollset_add_fd(BACKUP_POLLER_POLLSET(p), tcp->em_fd); if (old_count != 0) { @@ -211,7 +211,7 @@ static void cover_self(grpc_tcp* tcp) { static void notify_on_read(grpc_tcp* tcp) { if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP:%p notify_on_read", tcp); + gpr_log(GPR_INFO, "TCP:%p notify_on_read", tcp); } GRPC_CLOSURE_INIT(&tcp->read_done_closure, tcp_handle_read, tcp, grpc_schedule_on_exec_ctx); @@ -220,7 +220,7 @@ static void notify_on_read(grpc_tcp* tcp) { static void notify_on_write(grpc_tcp* tcp) { if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP:%p notify_on_write", tcp); + gpr_log(GPR_INFO, "TCP:%p notify_on_write", tcp); } cover_self(tcp); GRPC_CLOSURE_INIT(&tcp->write_done_closure, @@ -231,7 +231,7 @@ static void notify_on_write(grpc_tcp* tcp) { static void tcp_drop_uncovered_then_handle_write(void* arg, grpc_error* error) { if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP:%p got_write: %s", arg, grpc_error_string(error)); + gpr_log(GPR_INFO, "TCP:%p got_write: %s", arg, grpc_error_string(error)); } drop_uncovered(static_cast(arg)); tcp_handle_write(arg, error); @@ -351,15 +351,15 @@ static void call_read_cb(grpc_tcp* tcp, grpc_error* error) { grpc_closure* cb = tcp->read_cb; if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP:%p call_cb %p %p:%p", tcp, cb, cb->cb, cb->cb_arg); + gpr_log(GPR_INFO, "TCP:%p call_cb %p %p:%p", tcp, cb, cb->cb, cb->cb_arg); size_t i; const char* str = grpc_error_string(error); - gpr_log(GPR_DEBUG, "read: error=%s", str); + gpr_log(GPR_INFO, "read: error=%s", str); for (i = 0; i < tcp->incoming_buffer->count; i++) { char* dump = grpc_dump_slice(tcp->incoming_buffer->slices[i], GPR_DUMP_HEX | GPR_DUMP_ASCII); - gpr_log(GPR_DEBUG, "READ %p (peer=%s): %s", tcp, tcp->peer_string, dump); + gpr_log(GPR_INFO, "READ %p (peer=%s): %s", tcp, tcp->peer_string, dump); gpr_free(dump); } } @@ -441,7 +441,7 @@ static void tcp_do_read(grpc_tcp* tcp) { static void tcp_read_allocation_done(void* tcpp, grpc_error* error) { grpc_tcp* tcp = static_cast(tcpp); if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP:%p read_allocation_done: %s", tcp, + gpr_log(GPR_INFO, "TCP:%p read_allocation_done: %s", tcp, grpc_error_string(error)); } if (error != GRPC_ERROR_NONE) { @@ -459,13 +459,13 @@ static void tcp_continue_read(grpc_tcp* tcp) { if (tcp->incoming_buffer->length < target_read_size && tcp->incoming_buffer->count < MAX_READ_IOVEC) { if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP:%p alloc_slices", tcp); + gpr_log(GPR_INFO, "TCP:%p alloc_slices", tcp); } grpc_resource_user_alloc_slices(&tcp->slice_allocator, target_read_size, 1, tcp->incoming_buffer); } else { if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP:%p do_read", tcp); + gpr_log(GPR_INFO, "TCP:%p do_read", tcp); } tcp_do_read(tcp); } @@ -475,7 +475,7 @@ static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error* error) { grpc_tcp* tcp = static_cast(arg); GPR_ASSERT(!tcp->finished_edge); if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP:%p got_read: %s", tcp, grpc_error_string(error)); + gpr_log(GPR_INFO, "TCP:%p got_read: %s", tcp, grpc_error_string(error)); } if (error != GRPC_ERROR_NONE) { @@ -618,7 +618,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error) { if (!tcp_flush(tcp, &error)) { if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "write: delayed"); + gpr_log(GPR_INFO, "write: delayed"); } notify_on_write(tcp); } else { @@ -626,7 +626,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error) { tcp->write_cb = nullptr; if (grpc_tcp_trace.enabled()) { const char* str = grpc_error_string(error); - gpr_log(GPR_DEBUG, "write: %s", str); + gpr_log(GPR_INFO, "write: %s", str); } GRPC_CLOSURE_RUN(cb, error); @@ -646,7 +646,7 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf, for (i = 0; i < buf->count; i++) { char* data = grpc_dump_slice(buf->slices[i], GPR_DUMP_HEX | GPR_DUMP_ASCII); - gpr_log(GPR_DEBUG, "WRITE %p (peer=%s): %s", tcp, tcp->peer_string, data); + gpr_log(GPR_INFO, "WRITE %p (peer=%s): %s", tcp, tcp->peer_string, data); gpr_free(data); } } @@ -668,13 +668,13 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf, TCP_REF(tcp, "write"); tcp->write_cb = cb; if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "write: delayed"); + gpr_log(GPR_INFO, "write: delayed"); } notify_on_write(tcp); } else { if (grpc_tcp_trace.enabled()) { const char* str = grpc_error_string(error); - gpr_log(GPR_DEBUG, "write: %s", str); + gpr_log(GPR_INFO, "write: %s", str); } GRPC_CLOSURE_SCHED(cb, error); } diff --git a/src/core/lib/iomgr/tcp_server_custom.cc b/src/core/lib/iomgr/tcp_server_custom.cc index 79ba5c39eee..019b354473b 100644 --- a/src/core/lib/iomgr/tcp_server_custom.cc +++ b/src/core/lib/iomgr/tcp_server_custom.cc @@ -222,10 +222,10 @@ static void finish_accept(grpc_tcp_listener* sp, grpc_custom_socket* socket) { } if (grpc_tcp_trace.enabled()) { if (peer_name_string) { - gpr_log(GPR_DEBUG, "SERVER_CONNECT: %p accepted connection: %s", + gpr_log(GPR_INFO, "SERVER_CONNECT: %p accepted connection: %s", sp->server, peer_name_string); } else { - gpr_log(GPR_DEBUG, "SERVER_CONNECT: %p accepted connection", sp->server); + gpr_log(GPR_INFO, "SERVER_CONNECT: %p accepted connection", sp->server); } } ep = custom_tcp_endpoint_create(socket, sp->server->resource_quota, @@ -377,10 +377,10 @@ static grpc_error* tcp_server_add_port(grpc_tcp_server* s, grpc_sockaddr_to_string(&port_string, addr, 0); const char* str = grpc_error_string(error); if (port_string) { - gpr_log(GPR_DEBUG, "SERVER %p add_port %s error=%s", s, port_string, str); + gpr_log(GPR_INFO, "SERVER %p add_port %s error=%s", s, port_string, str); gpr_free(port_string); } else { - gpr_log(GPR_DEBUG, "SERVER %p add_port error=%s", s, str); + gpr_log(GPR_INFO, "SERVER %p add_port error=%s", s, str); } } @@ -419,7 +419,7 @@ static void tcp_server_start(grpc_tcp_server* server, grpc_pollset** pollsets, (void)pollset_count; GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD(); if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "SERVER_START %p", server); + gpr_log(GPR_INFO, "SERVER_START %p", server); } GPR_ASSERT(on_accept_cb); GPR_ASSERT(!server->on_accept_cb); diff --git a/src/core/lib/iomgr/tcp_server_posix.cc b/src/core/lib/iomgr/tcp_server_posix.cc index f11b82f7ab1..524beba9ab9 100644 --- a/src/core/lib/iomgr/tcp_server_posix.cc +++ b/src/core/lib/iomgr/tcp_server_posix.cc @@ -228,7 +228,7 @@ static void on_read(void* arg, grpc_error* err) { gpr_asprintf(&name, "tcp-server-connection:%s", addr_str); if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "SERVER_CONNECT: incoming connection: %s", addr_str); + gpr_log(GPR_INFO, "SERVER_CONNECT: incoming connection: %s", addr_str); } grpc_fd* fdobj = grpc_fd_create(fd, name); diff --git a/src/core/lib/iomgr/timer_generic.cc b/src/core/lib/iomgr/timer_generic.cc index 0c6f236f837..de2256f7cb3 100644 --- a/src/core/lib/iomgr/timer_generic.cc +++ b/src/core/lib/iomgr/timer_generic.cc @@ -346,9 +346,9 @@ static void timer_init(grpc_timer* timer, grpc_millis deadline, #endif if (grpc_timer_trace.enabled()) { - gpr_log(GPR_DEBUG, - "TIMER %p: SET %" PRIdPTR " now %" PRIdPTR " call %p[%p]", timer, - deadline, grpc_core::ExecCtx::Get()->Now(), closure, closure->cb); + gpr_log(GPR_INFO, "TIMER %p: SET %" PRIdPTR " now %" PRIdPTR " call %p[%p]", + timer, deadline, grpc_core::ExecCtx::Get()->Now(), closure, + closure->cb); } if (!g_shared_mutables.initialized) { @@ -382,7 +382,7 @@ static void timer_init(grpc_timer* timer, grpc_millis deadline, list_join(&shard->list, timer); } if (grpc_timer_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, " .. add to shard %d with queue_deadline_cap=%" PRIdPTR " => is_first_timer=%s", static_cast(shard - g_shards), shard->queue_deadline_cap, @@ -404,7 +404,7 @@ static void timer_init(grpc_timer* timer, grpc_millis deadline, if (is_first_timer) { gpr_mu_lock(&g_shared_mutables.mu); if (grpc_timer_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. old shard min_deadline=%" PRIdPTR, + gpr_log(GPR_INFO, " .. old shard min_deadline=%" PRIdPTR, shard->min_deadline); } if (deadline < shard->min_deadline) { @@ -434,7 +434,7 @@ static void timer_cancel(grpc_timer* timer) { timer_shard* shard = &g_shards[GPR_HASH_POINTER(timer, g_num_shards)]; gpr_mu_lock(&shard->mu); if (grpc_timer_trace.enabled()) { - gpr_log(GPR_DEBUG, "TIMER %p: CANCEL pending=%s", timer, + gpr_log(GPR_INFO, "TIMER %p: CANCEL pending=%s", timer, timer->pending ? "true" : "false"); } @@ -475,7 +475,7 @@ static int refill_heap(timer_shard* shard, gpr_atm now) { static_cast(deadline_delta * 1000.0)); if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. shard[%d]->queue_deadline_cap --> %" PRIdPTR, + gpr_log(GPR_INFO, " .. shard[%d]->queue_deadline_cap --> %" PRIdPTR, static_cast(shard - g_shards), shard->queue_deadline_cap); } for (timer = shard->list.next; timer != &shard->list; timer = next) { @@ -483,7 +483,7 @@ static int refill_heap(timer_shard* shard, gpr_atm now) { if (timer->deadline < shard->queue_deadline_cap) { if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. add timer with deadline %" PRIdPTR " to heap", + gpr_log(GPR_INFO, " .. add timer with deadline %" PRIdPTR " to heap", timer->deadline); } list_remove(timer); @@ -500,7 +500,7 @@ static grpc_timer* pop_one(timer_shard* shard, gpr_atm now) { grpc_timer* timer; for (;;) { if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. shard[%d]: heap_empty=%s", + gpr_log(GPR_INFO, " .. shard[%d]: heap_empty=%s", static_cast(shard - g_shards), grpc_timer_heap_is_empty(&shard->heap) ? "true" : "false"); } @@ -510,13 +510,13 @@ static grpc_timer* pop_one(timer_shard* shard, gpr_atm now) { } timer = grpc_timer_heap_top(&shard->heap); if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, " .. check top timer deadline=%" PRIdPTR " now=%" PRIdPTR, timer->deadline, now); } if (timer->deadline > now) return nullptr; if (grpc_timer_trace.enabled()) { - gpr_log(GPR_DEBUG, "TIMER %p: FIRE %" PRIdPTR "ms late via %s scheduler", + gpr_log(GPR_INFO, "TIMER %p: FIRE %" PRIdPTR "ms late via %s scheduler", timer, now - timer->deadline, timer->closure->scheduler->vtable->name); } @@ -540,7 +540,7 @@ static size_t pop_timers(timer_shard* shard, gpr_atm now, *new_min_deadline = compute_min_deadline(shard); gpr_mu_unlock(&shard->mu); if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. shard[%d] popped %" PRIdPTR, + gpr_log(GPR_INFO, " .. shard[%d] popped %" PRIdPTR, static_cast(shard - g_shards), n); } return n; @@ -563,7 +563,7 @@ static grpc_timer_check_result run_some_expired_timers(gpr_atm now, result = GRPC_TIMERS_CHECKED_AND_EMPTY; if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, " .. shard[%d]->min_deadline = %" PRIdPTR, + gpr_log(GPR_INFO, " .. shard[%d]->min_deadline = %" PRIdPTR, static_cast(g_shard_queue[0] - g_shards), g_shard_queue[0]->min_deadline); } @@ -580,7 +580,7 @@ static grpc_timer_check_result run_some_expired_timers(gpr_atm now, } if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, " .. result --> %d" ", shard[%d]->min_deadline %" PRIdPTR " --> %" PRIdPTR ", now=%" PRIdPTR, @@ -624,7 +624,7 @@ static grpc_timer_check_result timer_check(grpc_millis* next) { *next = GPR_MIN(*next, min_timer); } if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "TIMER CHECK SKIP: now=%" PRIdPTR " min_timer=%" PRIdPTR, now, min_timer); } @@ -644,7 +644,7 @@ static grpc_timer_check_result timer_check(grpc_millis* next) { } else { gpr_asprintf(&next_str, "%" PRIdPTR, *next); } - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "TIMER CHECK BEGIN: now=%" PRIdPTR " next=%s tls_min=%" PRIdPTR " glob_min=%" PRIdPTR, now, next_str, gpr_tls_get(&g_last_seen_min_timer), @@ -662,7 +662,7 @@ static grpc_timer_check_result timer_check(grpc_millis* next) { } else { gpr_asprintf(&next_str, "%" PRIdPTR, *next); } - gpr_log(GPR_DEBUG, "TIMER CHECK END: r=%d; next=%s", r, next_str); + gpr_log(GPR_INFO, "TIMER CHECK END: r=%d; next=%s", r, next_str); gpr_free(next_str); } return r; diff --git a/src/core/lib/iomgr/timer_manager.cc b/src/core/lib/iomgr/timer_manager.cc index 94f288af276..35e79145687 100644 --- a/src/core/lib/iomgr/timer_manager.cc +++ b/src/core/lib/iomgr/timer_manager.cc @@ -82,7 +82,7 @@ static void start_timer_thread_and_unlock(void) { ++g_thread_count; gpr_mu_unlock(&g_mu); if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, "Spawn timer thread"); + gpr_log(GPR_INFO, "Spawn timer thread"); } completed_thread* ct = static_cast(gpr_malloc(sizeof(*ct))); @@ -108,7 +108,7 @@ static void run_some_timers() { // waiter so that the next deadline is not missed if (!g_has_timed_waiter) { if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, "kick untimed waiter"); + gpr_log(GPR_INFO, "kick untimed waiter"); } gpr_cv_signal(&g_cv_wait); } @@ -116,7 +116,7 @@ static void run_some_timers() { } // without our lock, flush the exec_ctx if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, "flush exec_ctx"); + gpr_log(GPR_INFO, "flush exec_ctx"); } grpc_core::ExecCtx::Get()->Flush(); gpr_mu_lock(&g_mu); @@ -172,8 +172,7 @@ static bool wait_until(grpc_millis next) { if (grpc_timer_check_trace.enabled()) { grpc_millis wait_time = next - grpc_core::ExecCtx::Get()->Now(); - gpr_log(GPR_DEBUG, "sleep for a %" PRIdPTR " milliseconds", - wait_time); + gpr_log(GPR_INFO, "sleep for a %" PRIdPTR " milliseconds", wait_time); } } else { // g_timed_waiter == true && next >= g_timed_waiter_deadline next = GRPC_MILLIS_INF_FUTURE; @@ -181,14 +180,14 @@ static bool wait_until(grpc_millis next) { } if (grpc_timer_check_trace.enabled() && next == GRPC_MILLIS_INF_FUTURE) { - gpr_log(GPR_DEBUG, "sleep until kicked"); + gpr_log(GPR_INFO, "sleep until kicked"); } gpr_cv_wait(&g_cv_wait, &g_mu, grpc_millis_to_timespec(next, GPR_CLOCK_MONOTONIC)); if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, "wait ended: was_timed:%d kicked:%d", + gpr_log(GPR_INFO, "wait ended: was_timed:%d kicked:%d", my_timed_waiter_generation == g_timed_waiter_generation, g_kicked); } @@ -233,7 +232,7 @@ static void timer_main_loop() { Consequently, we can just sleep forever here and be happy at some saved wakeup cycles. */ if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, "timers not checked: expect another thread to"); + gpr_log(GPR_INFO, "timers not checked: expect another thread to"); } next = GRPC_MILLIS_INF_FUTURE; /* fall through */ @@ -259,7 +258,7 @@ static void timer_thread_cleanup(completed_thread* ct) { g_completed_threads = ct; gpr_mu_unlock(&g_mu); if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, "End timer thread"); + gpr_log(GPR_INFO, "End timer thread"); } } @@ -301,18 +300,18 @@ void grpc_timer_manager_init(void) { static void stop_threads(void) { gpr_mu_lock(&g_mu); if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, "stop timer threads: threaded=%d", g_threaded); + gpr_log(GPR_INFO, "stop timer threads: threaded=%d", g_threaded); } if (g_threaded) { g_threaded = false; gpr_cv_broadcast(&g_cv_wait); if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, "num timer threads: %d", g_thread_count); + gpr_log(GPR_INFO, "num timer threads: %d", g_thread_count); } while (g_thread_count > 0) { gpr_cv_wait(&g_cv_shutdown, &g_mu, gpr_inf_future(GPR_CLOCK_MONOTONIC)); if (grpc_timer_check_trace.enabled()) { - gpr_log(GPR_DEBUG, "num timer threads: %d", g_thread_count); + gpr_log(GPR_INFO, "num timer threads: %d", g_thread_count); } gc_completed_threads(); } diff --git a/src/core/lib/security/transport/secure_endpoint.cc b/src/core/lib/security/transport/secure_endpoint.cc index 31b779e3337..840b2e73bcf 100644 --- a/src/core/lib/security/transport/secure_endpoint.cc +++ b/src/core/lib/security/transport/secure_endpoint.cc @@ -133,7 +133,7 @@ static void call_read_cb(secure_endpoint* ep, grpc_error* error) { for (i = 0; i < ep->read_buffer->count; i++) { char* data = grpc_dump_slice(ep->read_buffer->slices[i], GPR_DUMP_HEX | GPR_DUMP_ASCII); - gpr_log(GPR_DEBUG, "READ %p: %s", ep, data); + gpr_log(GPR_INFO, "READ %p: %s", ep, data); gpr_free(data); } } @@ -269,7 +269,7 @@ static void endpoint_write(grpc_endpoint* secure_ep, grpc_slice_buffer* slices, for (i = 0; i < slices->count; i++) { char* data = grpc_dump_slice(slices->slices[i], GPR_DUMP_HEX | GPR_DUMP_ASCII); - gpr_log(GPR_DEBUG, "WRITE %p: %s", ep, data); + gpr_log(GPR_INFO, "WRITE %p: %s", ep, data); gpr_free(data); } } diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index 9a9113643d5..0a732bed838 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -747,10 +747,10 @@ static void get_final_status( status[i] = unpack_received_status(gpr_atm_acq_load(&call->status[i])); } if (grpc_call_error_trace.enabled()) { - gpr_log(GPR_DEBUG, "get_final_status %s", call->is_client ? "CLI" : "SVR"); + gpr_log(GPR_INFO, "get_final_status %s", call->is_client ? "CLI" : "SVR"); for (i = 0; i < STATUS_SOURCE_COUNT; i++) { if (status[i].is_set) { - gpr_log(GPR_DEBUG, " %d: %s", i, grpc_error_string(status[i].error)); + gpr_log(GPR_INFO, " %d: %s", i, grpc_error_string(status[i].error)); } } } diff --git a/src/core/lib/transport/bdp_estimator.cc b/src/core/lib/transport/bdp_estimator.cc index 8130535ddde..8e71f869894 100644 --- a/src/core/lib/transport/bdp_estimator.cc +++ b/src/core/lib/transport/bdp_estimator.cc @@ -47,7 +47,7 @@ grpc_millis BdpEstimator::CompletePing() { double bw = dt > 0 ? (static_cast(accumulator_) / dt) : 0; int start_inter_ping_delay = inter_ping_delay_; if (grpc_bdp_estimator_trace.enabled()) { - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "bdp[%s]:complete acc=%" PRId64 " est=%" PRId64 " dt=%lf bw=%lfMbs bw_est=%lfMbs", name_, accumulator_, estimate_, dt, bw / 125000.0, @@ -58,7 +58,7 @@ grpc_millis BdpEstimator::CompletePing() { estimate_ = GPR_MAX(accumulator_, estimate_ * 2); bw_est_ = bw; if (grpc_bdp_estimator_trace.enabled()) { - gpr_log(GPR_DEBUG, "bdp[%s]: estimate increased to %" PRId64, name_, + gpr_log(GPR_INFO, "bdp[%s]: estimate increased to %" PRId64, name_, estimate_); } inter_ping_delay_ /= 2; // if the ping estimate changes, @@ -75,7 +75,7 @@ grpc_millis BdpEstimator::CompletePing() { if (start_inter_ping_delay != inter_ping_delay_) { stable_estimate_count_ = 0; if (grpc_bdp_estimator_trace.enabled()) { - gpr_log(GPR_DEBUG, "bdp[%s]:update_inter_time to %dms", name_, + gpr_log(GPR_INFO, "bdp[%s]:update_inter_time to %dms", name_, inter_ping_delay_); } } diff --git a/src/core/lib/transport/bdp_estimator.h b/src/core/lib/transport/bdp_estimator.h index e703af121cf..ab13ae4be4c 100644 --- a/src/core/lib/transport/bdp_estimator.h +++ b/src/core/lib/transport/bdp_estimator.h @@ -50,7 +50,7 @@ class BdpEstimator { // transport (but not necessarily started) void SchedulePing() { if (grpc_bdp_estimator_trace.enabled()) { - gpr_log(GPR_DEBUG, "bdp[%s]:sched acc=%" PRId64 " est=%" PRId64, name_, + gpr_log(GPR_INFO, "bdp[%s]:sched acc=%" PRId64 " est=%" PRId64, name_, accumulator_, estimate_); } GPR_ASSERT(ping_state_ == PingState::UNSCHEDULED); @@ -63,7 +63,7 @@ class BdpEstimator { // the ping is on the wire void StartPing() { if (grpc_bdp_estimator_trace.enabled()) { - gpr_log(GPR_DEBUG, "bdp[%s]:start acc=%" PRId64 " est=%" PRId64, name_, + gpr_log(GPR_INFO, "bdp[%s]:start acc=%" PRId64 " est=%" PRId64, name_, accumulator_, estimate_); } GPR_ASSERT(ping_state_ == PingState::SCHEDULED); diff --git a/src/core/lib/transport/connectivity_state.cc b/src/core/lib/transport/connectivity_state.cc index 0122e773ca6..db6b6c04440 100644 --- a/src/core/lib/transport/connectivity_state.cc +++ b/src/core/lib/transport/connectivity_state.cc @@ -78,7 +78,7 @@ grpc_connectivity_state grpc_connectivity_state_check( grpc_connectivity_state cur = static_cast( gpr_atm_no_barrier_load(&tracker->current_state_atm)); if (grpc_connectivity_state_trace.enabled()) { - gpr_log(GPR_DEBUG, "CONWATCH: %p %s: get %s", tracker, tracker->name, + gpr_log(GPR_INFO, "CONWATCH: %p %s: get %s", tracker, tracker->name, grpc_connectivity_state_name(cur)); } return cur; @@ -89,7 +89,7 @@ grpc_connectivity_state grpc_connectivity_state_get( grpc_connectivity_state cur = static_cast( gpr_atm_no_barrier_load(&tracker->current_state_atm)); if (grpc_connectivity_state_trace.enabled()) { - gpr_log(GPR_DEBUG, "CONWATCH: %p %s: get %s", tracker, tracker->name, + gpr_log(GPR_INFO, "CONWATCH: %p %s: get %s", tracker, tracker->name, grpc_connectivity_state_name(cur)); } if (error != nullptr) { @@ -110,10 +110,10 @@ bool grpc_connectivity_state_notify_on_state_change( gpr_atm_no_barrier_load(&tracker->current_state_atm)); if (grpc_connectivity_state_trace.enabled()) { if (current == nullptr) { - gpr_log(GPR_DEBUG, "CONWATCH: %p %s: unsubscribe notify=%p", tracker, + gpr_log(GPR_INFO, "CONWATCH: %p %s: unsubscribe notify=%p", tracker, tracker->name, notify); } else { - gpr_log(GPR_DEBUG, "CONWATCH: %p %s: from %s [cur=%s] notify=%p", tracker, + gpr_log(GPR_INFO, "CONWATCH: %p %s: from %s [cur=%s] notify=%p", tracker, tracker->name, grpc_connectivity_state_name(*current), grpc_connectivity_state_name(cur), notify); } @@ -161,7 +161,7 @@ void grpc_connectivity_state_set(grpc_connectivity_state_tracker* tracker, grpc_connectivity_state_watcher* w; if (grpc_connectivity_state_trace.enabled()) { const char* error_string = grpc_error_string(error); - gpr_log(GPR_DEBUG, "SET: %p %s: %s --> %s [%s] error=%p %s", tracker, + gpr_log(GPR_INFO, "SET: %p %s: %s --> %s [%s] error=%p %s", tracker, tracker->name, grpc_connectivity_state_name(cur), grpc_connectivity_state_name(state), reason, error, error_string); } @@ -187,8 +187,7 @@ void grpc_connectivity_state_set(grpc_connectivity_state_tracker* tracker, *w->current = state; tracker->watchers = w->next; if (grpc_connectivity_state_trace.enabled()) { - gpr_log(GPR_DEBUG, "NOTIFY: %p %s: %p", tracker, tracker->name, - w->notify); + gpr_log(GPR_INFO, "NOTIFY: %p %s: %p", tracker, tracker->name, w->notify); } GRPC_CLOSURE_SCHED(w->notify, GRPC_ERROR_REF(tracker->current_error)); gpr_free(w); From 7e0270bfc86d701fe78e5a9bef2faacfd842fee5 Mon Sep 17 00:00:00 2001 From: Yihua Zhang Date: Wed, 25 Apr 2018 14:08:55 -0700 Subject: [PATCH 089/165] don't call security_handshake_failed_locked --- src/core/lib/security/transport/security_handshaker.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/core/lib/security/transport/security_handshaker.cc b/src/core/lib/security/transport/security_handshaker.cc index daeedf48105..d9ba3483e65 100644 --- a/src/core/lib/security/transport/security_handshaker.cc +++ b/src/core/lib/security/transport/security_handshaker.cc @@ -232,10 +232,8 @@ static grpc_error* on_handshake_next_done_locked( const unsigned char* bytes_to_send, size_t bytes_to_send_size, tsi_handshaker_result* handshaker_result) { grpc_error* error = GRPC_ERROR_NONE; - // Handshaker was shutdown. if (h->shutdown) { - security_handshake_failed_locked(h, GRPC_ERROR_REF(error)); return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Handshaker shutdown"); } // Read more if we need to. From 40ec89ff67ffb6010e2a23b9c6d31d336b23fe80 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 25 Apr 2018 12:00:28 -0700 Subject: [PATCH 090/165] Support microbenchmarks internally --- CMakeLists.txt | 13 ++++ Makefile | 78 +++++++++---------- build.yaml | 13 ++++ test/cpp/microbenchmarks/BUILD | 6 +- test/cpp/microbenchmarks/bm_arena.cc | 16 +++- test/cpp/microbenchmarks/bm_call_create.cc | 14 +++- test/cpp/microbenchmarks/bm_chttp2_hpack.cc | 14 +++- .../microbenchmarks/bm_chttp2_transport.cc | 16 +++- test/cpp/microbenchmarks/bm_closure.cc | 14 +++- test/cpp/microbenchmarks/bm_cq.cc | 14 +++- .../microbenchmarks/bm_cq_multiple_threads.cc | 14 +++- test/cpp/microbenchmarks/bm_error.cc | 14 +++- .../bm_fullstack_streaming_ping_pong.cc | 14 +++- .../bm_fullstack_streaming_pump.cc | 14 +++- .../microbenchmarks/bm_fullstack_trickle.cc | 8 +- .../bm_fullstack_unary_ping_pong.cc | 14 +++- test/cpp/microbenchmarks/bm_metadata.cc | 14 +++- test/cpp/microbenchmarks/bm_pollset.cc | 16 +++- .../generated/sources_and_headers.json | 13 ++++ 19 files changed, 259 insertions(+), 60 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43f5970a412..3e0a93aff6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9702,6 +9702,7 @@ target_link_libraries(bm_arena grpc_unsecure gpr_test_util gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) @@ -9745,6 +9746,7 @@ target_link_libraries(bm_call_create grpc_unsecure gpr_test_util gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) @@ -9788,6 +9790,7 @@ target_link_libraries(bm_chttp2_hpack grpc_unsecure gpr_test_util gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) @@ -9831,6 +9834,7 @@ target_link_libraries(bm_chttp2_transport grpc_unsecure gpr_test_util gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) @@ -9874,6 +9878,7 @@ target_link_libraries(bm_closure grpc_unsecure gpr_test_util gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) @@ -9917,6 +9922,7 @@ target_link_libraries(bm_cq grpc_unsecure gpr_test_util gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) @@ -9960,6 +9966,7 @@ target_link_libraries(bm_cq_multiple_threads grpc_unsecure gpr_test_util gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) @@ -10003,6 +10010,7 @@ target_link_libraries(bm_error grpc_unsecure gpr_test_util gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) @@ -10046,6 +10054,7 @@ target_link_libraries(bm_fullstack_streaming_ping_pong grpc_unsecure gpr_test_util gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) @@ -10089,6 +10098,7 @@ target_link_libraries(bm_fullstack_streaming_pump grpc_unsecure gpr_test_util gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) @@ -10176,6 +10186,7 @@ target_link_libraries(bm_fullstack_unary_ping_pong grpc_unsecure gpr_test_util gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) @@ -10219,6 +10230,7 @@ target_link_libraries(bm_metadata grpc_unsecure gpr_test_util gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) @@ -10262,6 +10274,7 @@ target_link_libraries(bm_pollset grpc_unsecure gpr_test_util gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) diff --git a/Makefile b/Makefile index 8aa53af2215..c6468263398 100644 --- a/Makefile +++ b/Makefile @@ -15411,17 +15411,17 @@ $(BINDIR)/$(CONFIG)/bm_arena: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/bm_arena: $(PROTOBUF_DEP) $(BM_ARENA_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/bm_arena: $(PROTOBUF_DEP) $(BM_ARENA_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_ARENA_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_arena + $(Q) $(LDXX) $(LDFLAGS) $(BM_ARENA_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_arena endif endif $(BM_ARENA_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_arena.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_arena.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a deps_bm_arena: $(BM_ARENA_OBJS:.o=.dep) @@ -15455,17 +15455,17 @@ $(BINDIR)/$(CONFIG)/bm_call_create: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/bm_call_create: $(PROTOBUF_DEP) $(BM_CALL_CREATE_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/bm_call_create: $(PROTOBUF_DEP) $(BM_CALL_CREATE_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_CALL_CREATE_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_call_create + $(Q) $(LDXX) $(LDFLAGS) $(BM_CALL_CREATE_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_call_create endif endif $(BM_CALL_CREATE_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_call_create.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_call_create.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a deps_bm_call_create: $(BM_CALL_CREATE_OBJS:.o=.dep) @@ -15499,17 +15499,17 @@ $(BINDIR)/$(CONFIG)/bm_chttp2_hpack: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/bm_chttp2_hpack: $(PROTOBUF_DEP) $(BM_CHTTP2_HPACK_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/bm_chttp2_hpack: $(PROTOBUF_DEP) $(BM_CHTTP2_HPACK_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_CHTTP2_HPACK_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_chttp2_hpack + $(Q) $(LDXX) $(LDFLAGS) $(BM_CHTTP2_HPACK_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_chttp2_hpack endif endif $(BM_CHTTP2_HPACK_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_chttp2_hpack.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_chttp2_hpack.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a deps_bm_chttp2_hpack: $(BM_CHTTP2_HPACK_OBJS:.o=.dep) @@ -15543,17 +15543,17 @@ $(BINDIR)/$(CONFIG)/bm_chttp2_transport: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/bm_chttp2_transport: $(PROTOBUF_DEP) $(BM_CHTTP2_TRANSPORT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/bm_chttp2_transport: $(PROTOBUF_DEP) $(BM_CHTTP2_TRANSPORT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_CHTTP2_TRANSPORT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_chttp2_transport + $(Q) $(LDXX) $(LDFLAGS) $(BM_CHTTP2_TRANSPORT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_chttp2_transport endif endif $(BM_CHTTP2_TRANSPORT_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_chttp2_transport.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_chttp2_transport.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a deps_bm_chttp2_transport: $(BM_CHTTP2_TRANSPORT_OBJS:.o=.dep) @@ -15587,17 +15587,17 @@ $(BINDIR)/$(CONFIG)/bm_closure: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/bm_closure: $(PROTOBUF_DEP) $(BM_CLOSURE_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/bm_closure: $(PROTOBUF_DEP) $(BM_CLOSURE_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_CLOSURE_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_closure + $(Q) $(LDXX) $(LDFLAGS) $(BM_CLOSURE_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_closure endif endif $(BM_CLOSURE_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_closure.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_closure.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a deps_bm_closure: $(BM_CLOSURE_OBJS:.o=.dep) @@ -15631,17 +15631,17 @@ $(BINDIR)/$(CONFIG)/bm_cq: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/bm_cq: $(PROTOBUF_DEP) $(BM_CQ_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/bm_cq: $(PROTOBUF_DEP) $(BM_CQ_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_CQ_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_cq + $(Q) $(LDXX) $(LDFLAGS) $(BM_CQ_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_cq endif endif $(BM_CQ_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_cq.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_cq.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a deps_bm_cq: $(BM_CQ_OBJS:.o=.dep) @@ -15675,17 +15675,17 @@ $(BINDIR)/$(CONFIG)/bm_cq_multiple_threads: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/bm_cq_multiple_threads: $(PROTOBUF_DEP) $(BM_CQ_MULTIPLE_THREADS_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/bm_cq_multiple_threads: $(PROTOBUF_DEP) $(BM_CQ_MULTIPLE_THREADS_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_CQ_MULTIPLE_THREADS_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_cq_multiple_threads + $(Q) $(LDXX) $(LDFLAGS) $(BM_CQ_MULTIPLE_THREADS_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_cq_multiple_threads endif endif $(BM_CQ_MULTIPLE_THREADS_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_cq_multiple_threads.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_cq_multiple_threads.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a deps_bm_cq_multiple_threads: $(BM_CQ_MULTIPLE_THREADS_OBJS:.o=.dep) @@ -15719,17 +15719,17 @@ $(BINDIR)/$(CONFIG)/bm_error: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/bm_error: $(PROTOBUF_DEP) $(BM_ERROR_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/bm_error: $(PROTOBUF_DEP) $(BM_ERROR_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_ERROR_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_error + $(Q) $(LDXX) $(LDFLAGS) $(BM_ERROR_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_error endif endif $(BM_ERROR_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_error.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_error.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a deps_bm_error: $(BM_ERROR_OBJS:.o=.dep) @@ -15763,17 +15763,17 @@ $(BINDIR)/$(CONFIG)/bm_fullstack_streaming_ping_pong: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/bm_fullstack_streaming_ping_pong: $(PROTOBUF_DEP) $(BM_FULLSTACK_STREAMING_PING_PONG_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/bm_fullstack_streaming_ping_pong: $(PROTOBUF_DEP) $(BM_FULLSTACK_STREAMING_PING_PONG_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_FULLSTACK_STREAMING_PING_PONG_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_fullstack_streaming_ping_pong + $(Q) $(LDXX) $(LDFLAGS) $(BM_FULLSTACK_STREAMING_PING_PONG_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_fullstack_streaming_ping_pong endif endif $(BM_FULLSTACK_STREAMING_PING_PONG_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a deps_bm_fullstack_streaming_ping_pong: $(BM_FULLSTACK_STREAMING_PING_PONG_OBJS:.o=.dep) @@ -15807,17 +15807,17 @@ $(BINDIR)/$(CONFIG)/bm_fullstack_streaming_pump: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/bm_fullstack_streaming_pump: $(PROTOBUF_DEP) $(BM_FULLSTACK_STREAMING_PUMP_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/bm_fullstack_streaming_pump: $(PROTOBUF_DEP) $(BM_FULLSTACK_STREAMING_PUMP_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_FULLSTACK_STREAMING_PUMP_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_fullstack_streaming_pump + $(Q) $(LDXX) $(LDFLAGS) $(BM_FULLSTACK_STREAMING_PUMP_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_fullstack_streaming_pump endif endif $(BM_FULLSTACK_STREAMING_PUMP_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a deps_bm_fullstack_streaming_pump: $(BM_FULLSTACK_STREAMING_PUMP_OBJS:.o=.dep) @@ -15895,17 +15895,17 @@ $(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong: $(PROTOBUF_DEP) $(BM_FULLSTACK_UNARY_PING_PONG_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong: $(PROTOBUF_DEP) $(BM_FULLSTACK_UNARY_PING_PONG_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_FULLSTACK_UNARY_PING_PONG_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong + $(Q) $(LDXX) $(LDFLAGS) $(BM_FULLSTACK_UNARY_PING_PONG_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong endif endif $(BM_FULLSTACK_UNARY_PING_PONG_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a deps_bm_fullstack_unary_ping_pong: $(BM_FULLSTACK_UNARY_PING_PONG_OBJS:.o=.dep) @@ -15939,17 +15939,17 @@ $(BINDIR)/$(CONFIG)/bm_metadata: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/bm_metadata: $(PROTOBUF_DEP) $(BM_METADATA_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/bm_metadata: $(PROTOBUF_DEP) $(BM_METADATA_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_METADATA_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_metadata + $(Q) $(LDXX) $(LDFLAGS) $(BM_METADATA_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_metadata endif endif $(BM_METADATA_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_metadata.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_metadata.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a deps_bm_metadata: $(BM_METADATA_OBJS:.o=.dep) @@ -15983,17 +15983,17 @@ $(BINDIR)/$(CONFIG)/bm_pollset: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/bm_pollset: $(PROTOBUF_DEP) $(BM_POLLSET_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/bm_pollset: $(PROTOBUF_DEP) $(BM_POLLSET_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(BM_POLLSET_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_pollset + $(Q) $(LDXX) $(LDFLAGS) $(BM_POLLSET_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_pollset endif endif $(BM_POLLSET_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX -$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_pollset.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_pollset.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a deps_bm_pollset: $(BM_POLLSET_OBJS:.o=.dep) diff --git a/build.yaml b/build.yaml index e9ad25d7114..374d5a03247 100644 --- a/build.yaml +++ b/build.yaml @@ -3812,6 +3812,7 @@ targets: - grpc_unsecure - gpr_test_util - gpr + - grpc++_test_config benchmark: true defaults: benchmark platforms: @@ -3833,6 +3834,7 @@ targets: - grpc_unsecure - gpr_test_util - gpr + - grpc++_test_config benchmark: true defaults: benchmark platforms: @@ -3854,6 +3856,7 @@ targets: - grpc_unsecure - gpr_test_util - gpr + - grpc++_test_config benchmark: true defaults: benchmark platforms: @@ -3875,6 +3878,7 @@ targets: - grpc_unsecure - gpr_test_util - gpr + - grpc++_test_config benchmark: true defaults: benchmark platforms: @@ -3895,6 +3899,7 @@ targets: - grpc_unsecure - gpr_test_util - gpr + - grpc++_test_config benchmark: true defaults: benchmark platforms: @@ -3915,6 +3920,7 @@ targets: - grpc_unsecure - gpr_test_util - gpr + - grpc++_test_config benchmark: true defaults: benchmark platforms: @@ -3935,6 +3941,7 @@ targets: - grpc_unsecure - gpr_test_util - gpr + - grpc++_test_config benchmark: true defaults: benchmark platforms: @@ -3955,6 +3962,7 @@ targets: - grpc_unsecure - gpr_test_util - gpr + - grpc++_test_config benchmark: true defaults: benchmark platforms: @@ -3978,6 +3986,7 @@ targets: - grpc_unsecure - gpr_test_util - gpr + - grpc++_test_config benchmark: true defaults: benchmark excluded_poll_engines: @@ -4004,6 +4013,7 @@ targets: - grpc_unsecure - gpr_test_util - gpr + - grpc++_test_config benchmark: true defaults: benchmark excluded_poll_engines: @@ -4057,6 +4067,7 @@ targets: - grpc_unsecure - gpr_test_util - gpr + - grpc++_test_config benchmark: true defaults: benchmark excluded_poll_engines: @@ -4081,6 +4092,7 @@ targets: - grpc_unsecure - gpr_test_util - gpr + - grpc++_test_config benchmark: true defaults: benchmark platforms: @@ -4102,6 +4114,7 @@ targets: - grpc_unsecure - gpr_test_util - gpr + - grpc++_test_config benchmark: true defaults: benchmark platforms: diff --git a/test/cpp/microbenchmarks/BUILD b/test/cpp/microbenchmarks/BUILD index 67f7e440b03..5dcfd94ed34 100644 --- a/test/cpp/microbenchmarks/BUILD +++ b/test/cpp/microbenchmarks/BUILD @@ -42,6 +42,7 @@ grpc_cc_library( "//:grpc++_unsecure", "//src/proto/grpc/testing:echo_proto", "//test/core/util:grpc_test_util_unsecure", + "//test/cpp/util:test_config", ], ) @@ -113,10 +114,7 @@ grpc_cc_binary( name = "bm_fullstack_trickle", testonly = 1, srcs = ["bm_fullstack_trickle.cc"], - deps = [ - ":helpers", - "//test/cpp/util:test_config", - ], + deps = [":helpers"], ) grpc_cc_library( diff --git a/test/cpp/microbenchmarks/bm_arena.cc b/test/cpp/microbenchmarks/bm_arena.cc index 69c8c1c0299..b97c954fae8 100644 --- a/test/cpp/microbenchmarks/bm_arena.cc +++ b/test/cpp/microbenchmarks/bm_arena.cc @@ -18,9 +18,10 @@ /* Benchmark arenas */ +#include #include "src/core/lib/gpr/arena.h" #include "test/cpp/microbenchmarks/helpers.h" -#include "third_party/benchmark/include/benchmark/benchmark.h" +#include "test/cpp/util/test_config.h" static void BM_Arena_NoOp(benchmark::State& state) { while (state.KeepRunning()) { @@ -56,4 +57,15 @@ static void BM_Arena_Batch(benchmark::State& state) { } BENCHMARK(BM_Arena_Batch)->Ranges({{1, 64 * 1024}, {1, 64}, {1, 1024}}); -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc index 85a9f5e137a..831b29c506c 100644 --- a/test/cpp/microbenchmarks/bm_call_create.cc +++ b/test/cpp/microbenchmarks/bm_call_create.cc @@ -46,6 +46,7 @@ #include "src/cpp/client/create_channel_internal.h" #include "src/proto/grpc/testing/echo.grpc.pb.h" #include "test/cpp/microbenchmarks/helpers.h" +#include "test/cpp/util/test_config.h" auto& force_library_initialization = Library::get(); @@ -813,4 +814,15 @@ static void BM_IsolatedCall_StreamingSend(benchmark::State& state) { } BENCHMARK(BM_IsolatedCall_StreamingSend); -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc index d0f3ec8e8ba..823c76f7555 100644 --- a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc +++ b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc @@ -33,6 +33,7 @@ #include "src/core/lib/transport/timeout_encoding.h" #include "test/cpp/microbenchmarks/helpers.h" +#include "test/cpp/util/test_config.h" auto& force_library_initialization = Library::get(); @@ -855,4 +856,15 @@ BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, SameDeadline, OnHeaderNew); } // namespace hpack_parser_fixtures -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/test/cpp/microbenchmarks/bm_chttp2_transport.cc b/test/cpp/microbenchmarks/bm_chttp2_transport.cc index d00c79b610c..1e9bd273aaf 100644 --- a/test/cpp/microbenchmarks/bm_chttp2_transport.cc +++ b/test/cpp/microbenchmarks/bm_chttp2_transport.cc @@ -18,6 +18,7 @@ /* Microbenchmarks around CHTTP2 transport operations */ +#include #include #include #include @@ -33,7 +34,7 @@ #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/transport/static_metadata.h" #include "test/cpp/microbenchmarks/helpers.h" -#include "third_party/benchmark/include/benchmark/benchmark.h" +#include "test/cpp/util/test_config.h" auto& force_library_initialization = Library::get(); @@ -638,4 +639,15 @@ static void BM_TransportStreamRecv(benchmark::State& state) { } BENCHMARK(BM_TransportStreamRecv)->Range(0, 128 * 1024 * 1024); -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/test/cpp/microbenchmarks/bm_closure.cc b/test/cpp/microbenchmarks/bm_closure.cc index 6d88faecc09..8bdc3b9385c 100644 --- a/test/cpp/microbenchmarks/bm_closure.cc +++ b/test/cpp/microbenchmarks/bm_closure.cc @@ -28,6 +28,7 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "test/cpp/microbenchmarks/helpers.h" +#include "test/cpp/util/test_config.h" auto& force_library_initialization = Library::get(); @@ -415,4 +416,15 @@ static void BM_ClosureReschedOnCombinerFinally(benchmark::State& state) { } BENCHMARK(BM_ClosureReschedOnCombinerFinally); -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/test/cpp/microbenchmarks/bm_cq.cc b/test/cpp/microbenchmarks/bm_cq.cc index 342a95ed108..a7cb939265f 100644 --- a/test/cpp/microbenchmarks/bm_cq.cc +++ b/test/cpp/microbenchmarks/bm_cq.cc @@ -25,6 +25,7 @@ #include #include #include "test/cpp/microbenchmarks/helpers.h" +#include "test/cpp/util/test_config.h" #include "src/core/lib/surface/completion_queue.h" @@ -148,4 +149,15 @@ BENCHMARK(BM_EmptyCore); } // namespace testing } // namespace grpc -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc index ec79b95cd81..da095c3e68b 100644 --- a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc +++ b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc @@ -24,6 +24,7 @@ #include #include #include "test/cpp/microbenchmarks/helpers.h" +#include "test/cpp/util/test_config.h" #include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/port.h" @@ -164,4 +165,15 @@ BENCHMARK(BM_Cq_Throughput)->ThreadRange(1, 16)->UseRealTime(); } // namespace testing } // namespace grpc -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/test/cpp/microbenchmarks/bm_error.cc b/test/cpp/microbenchmarks/bm_error.cc index d12f475a493..ae557a580aa 100644 --- a/test/cpp/microbenchmarks/bm_error.cc +++ b/test/cpp/microbenchmarks/bm_error.cc @@ -25,6 +25,7 @@ #include "src/core/lib/transport/error_utils.h" #include "test/cpp/microbenchmarks/helpers.h" +#include "test/cpp/util/test_config.h" auto& force_library_initialization = Library::get(); @@ -310,4 +311,15 @@ BENCHMARK_SUITE(ErrorWithGrpcStatus); BENCHMARK_SUITE(ErrorWithHttpError); BENCHMARK_SUITE(ErrorWithNestedGrpcStatus); -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc b/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc index 655e032faf6..34df77aca3c 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc @@ -19,6 +19,7 @@ /* Benchmark gRPC end2end in various configurations */ #include "test/cpp/microbenchmarks/fullstack_streaming_ping_pong.h" +#include "test/cpp/util/test_config.h" namespace grpc { namespace testing { @@ -114,4 +115,15 @@ BENCHMARK_TEMPLATE(BM_StreamingPingPongWithCoalescingApi, MinInProcess, } // namespace testing } // namespace grpc -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc b/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc index c7ceacd320b..da98f3cbcd4 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc @@ -19,6 +19,7 @@ /* Benchmark gRPC end2end in various configurations */ #include "test/cpp/microbenchmarks/fullstack_streaming_pump.h" +#include "test/cpp/util/test_config.h" namespace grpc { namespace testing { @@ -64,4 +65,15 @@ BENCHMARK_TEMPLATE(BM_PumpStreamServerToClient, MinInProcessCHTTP2)->Arg(0); } // namespace testing } // namespace grpc -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc index 3b21c4c2787..1af92d2c80c 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc @@ -458,10 +458,16 @@ BENCHMARK(BM_PumpUnbalancedUnary_Trickle)->Apply(UnaryTrickleArgs); extern gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + int main(int argc, char** argv) { ::benchmark::Initialize(&argc, argv); ::grpc::testing::InitTest(&argc, &argv, false); grpc_timer_manager_set_threading(false); gpr_now_impl = ::grpc::testing::fake_now; - ::benchmark::RunSpecifiedBenchmarks(); + benchmark::RunTheBenchmarksNamespaced(); } diff --git a/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc b/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc index fa41d114c00..5a7a8d5bafe 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc @@ -19,6 +19,7 @@ /* Benchmark gRPC end2end in various configurations */ #include "test/cpp/microbenchmarks/fullstack_unary_ping_pong.h" +#include "test/cpp/util/test_config.h" namespace grpc { namespace testing { @@ -164,4 +165,15 @@ BENCHMARK_TEMPLATE(BM_UnaryPingPong, InProcess, NoOpMutator, } // namespace testing } // namespace grpc -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/test/cpp/microbenchmarks/bm_metadata.cc b/test/cpp/microbenchmarks/bm_metadata.cc index f1e7890fc03..553b33c4028 100644 --- a/test/cpp/microbenchmarks/bm_metadata.cc +++ b/test/cpp/microbenchmarks/bm_metadata.cc @@ -25,6 +25,7 @@ #include "src/core/lib/transport/static_metadata.h" #include "test/cpp/microbenchmarks/helpers.h" +#include "test/cpp/util/test_config.h" auto& force_library_initialization = Library::get(); @@ -290,4 +291,15 @@ static void BM_MetadataRefUnrefStatic(benchmark::State& state) { } BENCHMARK(BM_MetadataRefUnrefStatic); -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/test/cpp/microbenchmarks/bm_pollset.cc b/test/cpp/microbenchmarks/bm_pollset.cc index f49f6671ae5..bcb68ff229d 100644 --- a/test/cpp/microbenchmarks/bm_pollset.cc +++ b/test/cpp/microbenchmarks/bm_pollset.cc @@ -18,6 +18,7 @@ /* Test out pollset latencies */ +#include #include #include #include @@ -29,7 +30,7 @@ #include "src/core/lib/iomgr/wakeup_fd_posix.h" #include "test/cpp/microbenchmarks/helpers.h" -#include "third_party/benchmark/include/benchmark/benchmark.h" +#include "test/cpp/util/test_config.h" #include @@ -256,4 +257,15 @@ static void BM_SingleThreadPollOneFd(benchmark::State& state) { } BENCHMARK(BM_SingleThreadPollOneFd); -BENCHMARK_MAIN(); +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char** argv) { + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 74b370720e9..41722e063d5 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -2669,6 +2669,7 @@ "benchmark", "gpr", "gpr_test_util", + "grpc++_test_config", "grpc++_test_util_unsecure", "grpc++_unsecure", "grpc_benchmark", @@ -2690,6 +2691,7 @@ "benchmark", "gpr", "gpr_test_util", + "grpc++_test_config", "grpc++_test_util_unsecure", "grpc++_unsecure", "grpc_benchmark", @@ -2711,6 +2713,7 @@ "benchmark", "gpr", "gpr_test_util", + "grpc++_test_config", "grpc++_test_util_unsecure", "grpc++_unsecure", "grpc_benchmark", @@ -2732,6 +2735,7 @@ "benchmark", "gpr", "gpr_test_util", + "grpc++_test_config", "grpc++_test_util_unsecure", "grpc++_unsecure", "grpc_benchmark", @@ -2753,6 +2757,7 @@ "benchmark", "gpr", "gpr_test_util", + "grpc++_test_config", "grpc++_test_util_unsecure", "grpc++_unsecure", "grpc_benchmark", @@ -2774,6 +2779,7 @@ "benchmark", "gpr", "gpr_test_util", + "grpc++_test_config", "grpc++_test_util_unsecure", "grpc++_unsecure", "grpc_benchmark", @@ -2795,6 +2801,7 @@ "benchmark", "gpr", "gpr_test_util", + "grpc++_test_config", "grpc++_test_util_unsecure", "grpc++_unsecure", "grpc_benchmark", @@ -2816,6 +2823,7 @@ "benchmark", "gpr", "gpr_test_util", + "grpc++_test_config", "grpc++_test_util_unsecure", "grpc++_unsecure", "grpc_benchmark", @@ -2837,6 +2845,7 @@ "benchmark", "gpr", "gpr_test_util", + "grpc++_test_config", "grpc++_test_util_unsecure", "grpc++_unsecure", "grpc_benchmark", @@ -2861,6 +2870,7 @@ "benchmark", "gpr", "gpr_test_util", + "grpc++_test_config", "grpc++_test_util_unsecure", "grpc++_unsecure", "grpc_benchmark", @@ -2907,6 +2917,7 @@ "benchmark", "gpr", "gpr_test_util", + "grpc++_test_config", "grpc++_test_util_unsecure", "grpc++_unsecure", "grpc_benchmark", @@ -2931,6 +2942,7 @@ "benchmark", "gpr", "gpr_test_util", + "grpc++_test_config", "grpc++_test_util_unsecure", "grpc++_unsecure", "grpc_benchmark", @@ -2952,6 +2964,7 @@ "benchmark", "gpr", "gpr_test_util", + "grpc++_test_config", "grpc++_test_util_unsecure", "grpc++_unsecure", "grpc_benchmark", From bf0b8798d6de1023f7a9b7a5539fefa58f4d47bb Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 25 Apr 2018 18:16:21 -0700 Subject: [PATCH 091/165] Provide protocol for generics --- src/compiler/objective_c_generator.cc | 2 +- src/objective-c/ProtoRPC/ProtoService.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc index 39f68cb9565..7d4d4d1f5a4 100644 --- a/src/compiler/objective_c_generator.cc +++ b/src/compiler/objective_c_generator.cc @@ -248,7 +248,7 @@ void PrintMethodImplementations(Printer* printer, " */\n"); printer.Print(vars, "@interface $service_class$ :" - " GRPCProtoService<$service_class$>\n"); + " GRPCProtoService<$service_class$, GRPCProtoServiceInit>\n"); printer.Print( "- (instancetype)initWithHost:(NSString *)host" " NS_DESIGNATED_INITIALIZER;\n"); diff --git a/src/objective-c/ProtoRPC/ProtoService.h b/src/objective-c/ProtoRPC/ProtoService.h index 29c4e9be360..c411bed60f0 100644 --- a/src/objective-c/ProtoRPC/ProtoService.h +++ b/src/objective-c/ProtoRPC/ProtoService.h @@ -22,6 +22,12 @@ @protocol GRXWriteable; @class GRXWriter; +@protocol GRPCProtoServiceInit + +- (instancetype)initWithHost:(NSString *)host; + +@end + __attribute__((deprecated("Please use GRPCProtoService."))) @interface ProtoService : NSObject - (instancetype)initWithHost : (NSString *)host packageName From bed721cbf7e79fae20729635677f05933ee59674 Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Fri, 13 Apr 2018 10:39:31 -0700 Subject: [PATCH 092/165] Remove VIP in cloud-to-prod interop tests. --- .../internal_ci/linux/grpc_interop_toprod.cfg | 2 +- .../pull_request/grpc_interop_toprod.cfg | 2 +- tools/run_tests/run_interop_tests.py | 48 +++++++------------ 3 files changed, 18 insertions(+), 34 deletions(-) diff --git a/tools/internal_ci/linux/grpc_interop_toprod.cfg b/tools/internal_ci/linux/grpc_interop_toprod.cfg index ff7a98f44e6..8d025c4f60d 100644 --- a/tools/internal_ci/linux/grpc_interop_toprod.cfg +++ b/tools/internal_ci/linux/grpc_interop_toprod.cfg @@ -26,5 +26,5 @@ action { env_vars { key: "RUN_TESTS_FLAGS" - value: "-l all --cloud_to_prod --cloud_to_prod_auth --prod_servers default gateway_v4 cloud_gateway cloud_gateway_v4 --use_docker --internal_ci -t -j 12 --bq_result_table interop_results" + value: "-l all --cloud_to_prod --cloud_to_prod_auth --prod_servers default gateway_v4 --use_docker --internal_ci -t -j 12 --bq_result_table interop_results" } diff --git a/tools/internal_ci/linux/pull_request/grpc_interop_toprod.cfg b/tools/internal_ci/linux/pull_request/grpc_interop_toprod.cfg index e141d9f6486..d14c79a1f6d 100644 --- a/tools/internal_ci/linux/pull_request/grpc_interop_toprod.cfg +++ b/tools/internal_ci/linux/pull_request/grpc_interop_toprod.cfg @@ -26,5 +26,5 @@ action { env_vars { key: "RUN_TESTS_FLAGS" - value: "-l all --allow_flakes --cloud_to_prod --cloud_to_prod_auth --prod_servers default gateway_v4 --use_docker --internal_ci -t -j 12" + value: "-l all --cloud_to_prod --cloud_to_prod_auth --prod_servers default gateway_v4 --use_docker --internal_ci -t -j 12" } diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 56aee6419ea..8c566655f4b 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -758,8 +758,8 @@ def _job_kill_handler(job): def cloud_to_prod_jobspec(language, test_case, - server_host_name, - server_host_detail, + server_host_nickname, + server_host, docker_image=None, auth=False, manual_cmd_log=None, @@ -767,9 +767,9 @@ def cloud_to_prod_jobspec(language, """Creates jobspec for cloud-to-prod interop test""" container_name = None cmdargs = [ - '--server_host=%s' % server_host_detail[0], - '--server_host_override=%s' % server_host_detail[1], - '--server_port=443', '--use_tls=true', + '--server_host=%s' % server_host, + '--server_host_override=%s' % server_host, '--server_port=443', + '--use_tls=true', '--test_case=%s' % test_case ] environ = dict(language.cloud_to_prod_env(), **language.global_env()) @@ -804,7 +804,7 @@ def cloud_to_prod_jobspec(language, cmdline=cmdline, cwd=cwd, environ=environ, - shortname='%s:%s:%s:%s' % (suite_name, language, server_host_name, + shortname='%s:%s:%s:%s' % (suite_name, language, server_host_nickname, test_case), timeout_seconds=_TEST_TIMEOUT, flake_retries=4 if args.allow_flakes else 0, @@ -1023,19 +1023,9 @@ def aggregate_http2_results(stdout): # A dictionary of prod servers to test. -# Format: server_name: (server_host, server_host_override, errors_allowed) -# TODO(adelez): implement logic for errors_allowed where if the indicated tests -# fail, they don't impact the overall test result. prod_servers = { - 'default': ('216.239.32.254', 'grpc-test.sandbox.googleapis.com', False), - 'gateway_v2': ('216.239.32.254', 'grpc-test2.sandbox.googleapis.com', True), - 'cloud_gateway': ('216.239.32.255', 'grpc-test.sandbox.googleapis.com', - False), - 'cloud_gateway_v2': ('216.239.32.255', 'grpc-test2.sandbox.googleapis.com', - True), - 'gateway_v4': ('216.239.32.254', 'grpc-test4.sandbox.googleapis.com', True), - 'cloud_gateway_v4': ('216.239.32.255', 'grpc-test4.sandbox.googleapis.com', - True), + 'default': 'grpc-test.sandbox.googleapis.com', + 'gateway_v4': 'grpc-test4.sandbox.googleapis.com', } argp = argparse.ArgumentParser(description='Run interop tests.') @@ -1297,7 +1287,7 @@ try: if args.cloud_to_prod: if args.transport_security != 'tls': print('TLS is always enabled for cloud_to_prod scenarios.') - for server_host_name in args.prod_servers: + for server_host_nickname in args.prod_servers: for language in languages: for test_case in _TEST_CASES: if not test_case in language.unimplemented_test_cases(): @@ -1305,8 +1295,8 @@ try: test_job = cloud_to_prod_jobspec( language, test_case, - server_host_name, - prod_servers[server_host_name], + server_host_nickname, + prod_servers[server_host_nickname], docker_image=docker_images.get(str(language)), manual_cmd_log=client_manual_cmd_log, service_account_key_file=args. @@ -1318,8 +1308,8 @@ try: test_job = cloud_to_prod_jobspec( http2Interop, test_case, - server_host_name, - prod_servers[server_host_name], + server_host_nickname, + prod_servers[server_host_nickname], docker_image=docker_images.get(str(http2Interop)), manual_cmd_log=client_manual_cmd_log, service_account_key_file=args.service_account_key_file) @@ -1328,7 +1318,7 @@ try: if args.cloud_to_prod_auth: if args.transport_security != 'tls': print('TLS is always enabled for cloud_to_prod scenarios.') - for server_host_name in args.prod_servers: + for server_host_nickname in args.prod_servers: for language in languages: for test_case in _AUTH_TEST_CASES: if (not args.skip_compute_engine_creds or @@ -1338,8 +1328,8 @@ try: test_job = cloud_to_prod_jobspec( language, test_case, - server_host_name, - prod_servers[server_host_name], + server_host_nickname, + prod_servers[server_host_nickname], docker_image=docker_images.get(str(language)), auth=True, manual_cmd_log=client_manual_cmd_log, @@ -1477,12 +1467,6 @@ try: http2_server_test_cases = (_HTTP2_SERVER_TEST_CASES if args.http2_server_interop else []) - report_utils.render_interop_html_report( - set([str(l) for l in languages]), servers, _TEST_CASES, - _AUTH_TEST_CASES, _HTTP2_TEST_CASES, http2_server_test_cases, resultset, - num_failures, args.cloud_to_prod_auth or args.cloud_to_prod, - args.prod_servers, args.http2_interop) - if num_failures: sys.exit(1) else: From dff7ba6cfb5bfce4b62129685d277c682bc4c263 Mon Sep 17 00:00:00 2001 From: ZhouyihaiDing Date: Tue, 24 Apr 2018 12:14:14 -0700 Subject: [PATCH 093/165] PHP: remove channel observation and clean method used for tests --- src/php/ext/grpc/channel.c | 59 --------- src/php/ext/grpc/channel.h | 1 - .../tests/unit_tests/CallCredentials2Test.php | 3 - .../tests/unit_tests/CallCredentialsTest.php | 3 - src/php/tests/unit_tests/CallTest.php | 3 - src/php/tests/unit_tests/ChannelTest.php | 8 -- src/php/tests/unit_tests/EndToEndTest.php | 3 - .../unit_tests/PersistentChannelTest.php | 115 ------------------ .../tests/unit_tests/SecureEndToEndTest.php | 3 - src/php/tests/unit_tests/ServerTest.php | 3 - src/php/tests/unit_tests/TimevalTest.php | 3 - 11 files changed, 204 deletions(-) delete mode 100644 src/php/tests/unit_tests/PersistentChannelTest.php diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index f3a03ace093..35adf6b3425 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -193,7 +193,6 @@ void create_and_add_channel_to_persistent_list( create_channel(channel, target, args, creds); le->channel = channel->wrapper; - le->ref_count = 1; new_rsrc.ptr = le; gpr_mu_lock(&global_persistent_list_mu); PHP_GRPC_PERSISTENT_LIST_UPDATE(&grpc_persistent_list, key, key_len, @@ -342,7 +341,6 @@ PHP_METHOD(Channel, __construct) { free(channel->wrapper->target); free(channel->wrapper->args_hashstr); free(channel->wrapper); - le->ref_count += 1; channel->wrapper = le->channel; channel->wrapper->ref_count += 1; } @@ -534,53 +532,6 @@ static void php_grpc_channel_plink_dtor(php_grpc_zend_resource *rsrc } } -/** - * Clean all channels in the persistent. - * @return void - */ -PHP_METHOD(Channel, cleanPersistentList) { - zend_hash_clean(&grpc_persistent_list); -} - -/** - * Return an array of persistent list. - * @return array - */ -PHP_METHOD(Channel, getPersistentList) { - array_init(return_value); - zval *data; - PHP_GRPC_HASH_FOREACH_VAL_START(&grpc_persistent_list, data) - php_grpc_zend_resource *rsrc = - (php_grpc_zend_resource*) PHP_GRPC_HASH_VALPTR_TO_VAL(data) - if (rsrc == NULL) { - break; - } - channel_persistent_le_t* le = rsrc->ptr; - zval* ret_arr; - PHP_GRPC_MAKE_STD_ZVAL(ret_arr); - array_init(ret_arr); - // Info about the target - PHP_GRPC_ADD_STRING_TO_ARRAY(ret_arr, "target", - sizeof("target"), le->channel->target, true); - // Info about key - PHP_GRPC_ADD_STRING_TO_ARRAY(ret_arr, "key", - sizeof("key"), le->channel->key, true); - // Info about persistent channel ref_count - PHP_GRPC_ADD_LONG_TO_ARRAY(ret_arr, "ref_count", - sizeof("ref_count"), le->ref_count); - // Info about connectivity status - int state = - grpc_channel_check_connectivity_state(le->channel->wrapped, (int)0); - // It should be set to 'true' in PHP 5.6.33 - PHP_GRPC_ADD_LONG_TO_ARRAY(ret_arr, "connectivity_status", - sizeof("connectivity_status"), state); - // Info about the channel is closed or not - PHP_GRPC_ADD_BOOL_TO_ARRAY(ret_arr, "is_valid", - sizeof("is_valid"), le->channel->is_valid); - add_assoc_zval(return_value, le->channel->target, ret_arr); - PHP_GRPC_HASH_FOREACH_END() -} - ZEND_BEGIN_ARG_INFO_EX(arginfo_construct, 0, 0, 2) ZEND_ARG_INFO(0, target) ZEND_ARG_INFO(0, args) @@ -601,12 +552,6 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_close, 0, 0, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_cleanPersistentList, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_getPersistentList, 0, 0, 0) -ZEND_END_ARG_INFO() - static zend_function_entry channel_methods[] = { PHP_ME(Channel, __construct, arginfo_construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) @@ -618,10 +563,6 @@ static zend_function_entry channel_methods[] = { ZEND_ACC_PUBLIC) PHP_ME(Channel, close, arginfo_close, ZEND_ACC_PUBLIC) - PHP_ME(Channel, cleanPersistentList, arginfo_cleanPersistentList, - ZEND_ACC_PUBLIC) - PHP_ME(Channel, getPersistentList, arginfo_getPersistentList, - ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php/ext/grpc/channel.h b/src/php/ext/grpc/channel.h index 807880534e5..86bfdea51a2 100644 --- a/src/php/ext/grpc/channel.h +++ b/src/php/ext/grpc/channel.h @@ -84,7 +84,6 @@ void php_grpc_delete_persistent_list_entry(char *key, php_grpc_int key_len typedef struct _channel_persistent_le { grpc_channel_wrapper *channel; - size_t ref_count; } channel_persistent_le_t; diff --git a/src/php/tests/unit_tests/CallCredentials2Test.php b/src/php/tests/unit_tests/CallCredentials2Test.php index a462bfff562..1c7e0c0ff6f 100644 --- a/src/php/tests/unit_tests/CallCredentials2Test.php +++ b/src/php/tests/unit_tests/CallCredentials2Test.php @@ -46,9 +46,6 @@ class CallCredentials2Test extends PHPUnit_Framework_TestCase { unset($this->channel); unset($this->server); - $channel_clean_persistent = - new Grpc\Channel('localhost:50010', []); - $channel_clean_persistent->cleanPersistentList(); } public function callbackFunc($context) diff --git a/src/php/tests/unit_tests/CallCredentialsTest.php b/src/php/tests/unit_tests/CallCredentialsTest.php index 31046e63957..4b5721d76ac 100644 --- a/src/php/tests/unit_tests/CallCredentialsTest.php +++ b/src/php/tests/unit_tests/CallCredentialsTest.php @@ -52,9 +52,6 @@ class CallCredentialsTest extends PHPUnit_Framework_TestCase { unset($this->channel); unset($this->server); - $channel_clean_persistent = - new Grpc\Channel('localhost:50010', []); - $channel_clean_persistent->cleanPersistentList(); } public function callbackFunc($context) diff --git a/src/php/tests/unit_tests/CallTest.php b/src/php/tests/unit_tests/CallTest.php index 38c36ed19a9..c5e1890a98b 100644 --- a/src/php/tests/unit_tests/CallTest.php +++ b/src/php/tests/unit_tests/CallTest.php @@ -38,9 +38,6 @@ class CallTest extends PHPUnit_Framework_TestCase public function tearDown() { $this->channel->close(); - $channel_clean_persistent = - new Grpc\Channel('localhost:50010', []); - $channel_clean_persistent->cleanPersistentList(); } public function testConstructor() diff --git a/src/php/tests/unit_tests/ChannelTest.php b/src/php/tests/unit_tests/ChannelTest.php index 63d4193a8be..5baff1fbd93 100644 --- a/src/php/tests/unit_tests/ChannelTest.php +++ b/src/php/tests/unit_tests/ChannelTest.php @@ -28,9 +28,6 @@ class ChannelTest extends PHPUnit_Framework_TestCase if (!empty($this->channel)) { $this->channel->close(); } - $channel_clean_persistent = - new Grpc\Channel('localhost:50010', []); - $channel_clean_persistent->cleanPersistentList(); } public function testInsecureCredentials() @@ -383,11 +380,6 @@ class ChannelTest extends PHPUnit_Framework_TestCase // close channel1 $this->channel1->close(); - // channel2 is now in SHUTDOWN state - $state = $this->channel2->getConnectivityState(); - $this->assertEquals(GRPC\CHANNEL_FATAL_FAILURE, $state); - - // calling it again will result in an exception because the // channel is already closed $state = $this->channel2->getConnectivityState(); } diff --git a/src/php/tests/unit_tests/EndToEndTest.php b/src/php/tests/unit_tests/EndToEndTest.php index 71a56d2b6eb..b54f1d87c9f 100644 --- a/src/php/tests/unit_tests/EndToEndTest.php +++ b/src/php/tests/unit_tests/EndToEndTest.php @@ -29,9 +29,6 @@ class EndToEndTest extends PHPUnit_Framework_TestCase public function tearDown() { $this->channel->close(); - $channel_clean_persistent = - new Grpc\Channel('localhost:50010', []); - $channel_clean_persistent->cleanPersistentList(); } public function testSimpleRequestBody() diff --git a/src/php/tests/unit_tests/PersistentChannelTest.php b/src/php/tests/unit_tests/PersistentChannelTest.php deleted file mode 100644 index 171780a137a..00000000000 --- a/src/php/tests/unit_tests/PersistentChannelTest.php +++ /dev/null @@ -1,115 +0,0 @@ -cleanPersistentList(); - } - - public function waitUntilNotIdle($channel) { - for ($i = 0; $i < 10; $i++) { - $now = Grpc\Timeval::now(); - $deadline = $now->add(new Grpc\Timeval(1000)); - if ($channel->watchConnectivityState(GRPC\CHANNEL_IDLE, - $deadline)) { - return true; - } - } - $this->assertTrue(false); - } - - public function assertConnecting($state) { - $this->assertTrue($state == GRPC\CHANNEL_CONNECTING || - $state == GRPC\CHANNEL_TRANSIENT_FAILURE); - } - - public function testPersistentChennelCreateOneChannel() - { - $this->channel1 = new Grpc\Channel('localhost:1', []); - $plist = $this->channel1->getPersistentList(); - $this->assertEquals($plist['localhost:1']['target'], 'localhost:1'); - $this->assertArrayHasKey('localhost:1', $plist); - $this->assertEquals($plist['localhost:1']['ref_count'], 1); - $this->assertEquals($plist['localhost:1']['connectivity_status'], - GRPC\CHANNEL_IDLE); - $this->assertEquals($plist['localhost:1']['is_valid'], 1); - $this->channel1->close(); - } - - public function testPersistentChennelStatusChange() - { - $this->channel1 = new Grpc\Channel('localhost:1', []); - $plist = $this->channel1->getPersistentList(); - $this->assertEquals($plist['localhost:1']['connectivity_status'], - GRPC\CHANNEL_IDLE); - $this->assertEquals($plist['localhost:1']['is_valid'], 1); - $state = $this->channel1->getConnectivityState(true); - - $this->waitUntilNotIdle($this->channel1); - $plist = $this->channel1->getPersistentList(); - $this->assertConnecting($plist['localhost:1']['connectivity_status']); - $this->assertEquals($plist['localhost:1']['is_valid'], 1); - - $this->channel1->close(); - } - - public function testPersistentChennelCloseChannel() - { - $this->channel1 = new Grpc\Channel('localhost:1', []); - $plist = $this->channel1->getPersistentList(); - $this->assertEquals($plist['localhost:1']['ref_count'], 1); - $this->channel1->close(); - $plist = $this->channel1->getPersistentList(); - $this->assertArrayNotHasKey('localhost:1', $plist); - } - - public function testPersistentChannelSameHost() - { - $this->channel1 = new Grpc\Channel('localhost:1', []); - $this->channel2 = new Grpc\Channel('localhost:1', []); - //ref_count should be 2 - $plist = $this->channel1->getPersistentList(); - $this->assertArrayHasKey('localhost:1', $plist); - $this->assertEquals($plist['localhost:1']['ref_count'], 2); - $this->channel1->close(); - $this->channel2->close(); - } - - public function testPersistentChannelDifferentHost() - { - $this->channel1 = new Grpc\Channel('localhost:1', []); - $this->channel2 = new Grpc\Channel('localhost:2', []); - $plist = $this->channel1->getPersistentList(); - $this->assertArrayHasKey('localhost:1', $plist); - $this->assertArrayHasKey('localhost:2', $plist); - $this->assertEquals($plist['localhost:1']['ref_count'], 1); - $this->assertEquals($plist['localhost:2']['ref_count'], 1); - $this->channel1->close(); - $this->channel2->close(); - } - -} diff --git a/src/php/tests/unit_tests/SecureEndToEndTest.php b/src/php/tests/unit_tests/SecureEndToEndTest.php index e358abe2d28..dff4e878ea1 100644 --- a/src/php/tests/unit_tests/SecureEndToEndTest.php +++ b/src/php/tests/unit_tests/SecureEndToEndTest.php @@ -44,9 +44,6 @@ class SecureEndToEndTest extends PHPUnit_Framework_TestCase public function tearDown() { $this->channel->close(); - $channel_clean_persistent = - new Grpc\Channel('localhost:50010', []); - $channel_clean_persistent->cleanPersistentList(); } public function testSimpleRequestBody() diff --git a/src/php/tests/unit_tests/ServerTest.php b/src/php/tests/unit_tests/ServerTest.php index d18feecefec..fee9f1e6448 100644 --- a/src/php/tests/unit_tests/ServerTest.php +++ b/src/php/tests/unit_tests/ServerTest.php @@ -27,9 +27,6 @@ class ServerTest extends PHPUnit_Framework_TestCase public function tearDown() { unset($this->server); - $channel_clean_persistent = - new Grpc\Channel('localhost:50010', []); - $channel_clean_persistent->cleanPersistentList(); } public function testConstructorWithNull() diff --git a/src/php/tests/unit_tests/TimevalTest.php b/src/php/tests/unit_tests/TimevalTest.php index be023adace6..bc307ef7f1e 100644 --- a/src/php/tests/unit_tests/TimevalTest.php +++ b/src/php/tests/unit_tests/TimevalTest.php @@ -25,9 +25,6 @@ class TimevalTest extends PHPUnit_Framework_TestCase public function tearDown() { unset($this->time); - $channel_clean_persistent = - new Grpc\Channel('localhost:50010', []); - $channel_clean_persistent->cleanPersistentList(); } public function testConstructorWithInt() From d90415965a775d02635fe3508443cbbf3e0670cc Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 26 Apr 2018 08:26:14 +0200 Subject: [PATCH 094/165] Further improvements to README.md --- src/csharp/README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/csharp/README.md b/src/csharp/README.md index e96b944a8be..e117e66afd6 100644 --- a/src/csharp/README.md +++ b/src/csharp/README.md @@ -16,16 +16,17 @@ PREREQUISITES When using gRPC C# under .NET Core you only need to [install .NET Core](https://www.microsoft.com/net/core). -- Windows: .NET Framework 4.5+, Visual Studio 2013, 2015, 2017 -- Linux: Mono 4+, MonoDevelop 5.9+ (with NuGet add-in installed) -- Mac OS X: Xamarin Studio 5.9+ +In addition to that, you can also use gRPC C# with these runtimes / IDEs +- Windows: .NET Framework 4.5+, Visual Studio 2013, 2015, 2017, Visual Studio Code +- Linux: Mono 4+, Visual Studio Code, MonoDevelop 5.9+ +- Mac OS X: Mono 4+, Visual Studio Code, Xamarin Studio 5.9+ HOW TO USE -------------- **Windows, Linux, Mac OS X** -- Open Visual Studio / MonoDevelop / Xamarin Studio and start a new project/solution. +- Open Visual Studio / MonoDevelop / Xamarin Studio and start a new project/solution (alternatively, you can create a new project from command line with `dotnet` SDK) - Add the [Grpc](https://www.nuget.org/packages/Grpc/) NuGet package as a dependency (Project options -> Manage NuGet Packages). @@ -37,10 +38,17 @@ BUILD FROM SOURCE You only need to go through these steps if you are planning to develop gRPC C#. If you are a user of gRPC C#, go to Usage section above. +**Prerequisites for contributors** + +- [dotnet SDK](https://www.microsoft.com/net/core) +- [Mono 4+](https://www.mono-project.com/) (only needed for Linux and MacOS) +- Prerequisites mentioned in [INSTALL.md](../../INSTALL.md#pre-requisites) + to be able to compile the native code. + **Windows, Linux or Mac OS X** - The easiest way to build is using the `run_tests.py` script that will take care of building the `grpc_csharp_ext` native library. - You might first need to install the prerequisites mentioned in [INSTALL.md](../../INSTALL.md#pre-requisites). + ``` # NOTE: make sure all necessary git submodules with dependencies # are available by running "git submodule update --init" From 3e74a1866816779335fdad890a3c927a59df8dad Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 26 Apr 2018 08:33:27 -0700 Subject: [PATCH 095/165] Minor cleanups. --- .../lb_policy/pick_first/pick_first.cc | 3 +-- .../lb_policy/subchannel_list.h | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 0883a4ed6c3..be00e871b8e 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -294,7 +294,7 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { return; } const grpc_lb_addresses* addresses = - (const grpc_lb_addresses*)arg->value.pointer.p; + static_cast(arg->value.pointer.p); if (grpc_lb_pick_first_trace.enabled()) { gpr_log(GPR_INFO, "Pick First %p received update with %" PRIuPTR " addresses", this, @@ -344,7 +344,6 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { subchannel_list->num_subchannels()); } if (selected_->connected_subchannel() != nullptr) { -// FIXME: restructure to work more like RR? sd->SetConnectedSubchannelFromLocked(selected_); } selected_ = sd; diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index 8b843b16c00..6d9c382c64b 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -94,13 +94,14 @@ class SubchannelData { return curr_connectivity_state_; } -// FIXME: remove - // An alternative to SetConnectedSubchannelFromSubchannelLocked() for - // cases where we are retaining a connected subchannel from a previous - // subchannel list. This is slightly more efficient than getting the - // connected subchannel from the subchannel, because that approach - // requires the use of a mutex, whereas this one only mutates a - // refcount. + // Used to set the connected subchannel in cases where we are retaining a + // subchannel from a previous subchannel list. This is slightly more + // efficient than getting the connected subchannel from the subchannel, + // because that approach requires the use of a mutex, whereas this one + // only mutates a refcount. + // TODO(roth): This method is a bit of a hack and is used only in + // pick_first. When we have time, find a way to remove this, possibly + // by making pick_first work more like round_robin. void SetConnectedSubchannelFromLocked(SubchannelData* other) { GPR_ASSERT(subchannel_ == other->subchannel_); connected_subchannel_ = other->connected_subchannel_; // Adds ref. @@ -164,11 +165,12 @@ class SubchannelData { // Implementations can use connectivity_state() to get the new // connectivity state. // Implementations must invoke either StopConnectivityWatch() or again - // call StartConnectivityWatch() before returning. + // call StartOrRenewConnectivityWatch() before returning. virtual void ProcessConnectivityChangeLocked(grpc_error* error) GRPC_ABSTRACT; private: -// FIXME: document + // Updates connected_subchannel_ based on pending_connectivity_state_unsafe_. + // Returns true if the connectivity state should be reported. bool UpdateConnectedSubchannelLocked(); static void OnConnectivityChangedLocked(void* arg, grpc_error* error); From 116fd29a36b1b5af454de11bda6d100f9565be91 Mon Sep 17 00:00:00 2001 From: David Cowden Date: Thu, 8 Feb 2018 22:58:53 -0800 Subject: [PATCH 096/165] gRPC core: strip zone-id from IPv6 hosts before TLS verification When initiating a connection to an IPv6 peer using an address that is not globally scoped, there may be ambiguity regarding which zone the destination address applies to when multiple links of the same scope are present. The scoped address architecture and zone-id syntax are described in rfc4007 and rfc 6874, respectively: * https://tools.ietf.org/html/rfc4007#section-6 * https://tools.ietf.org/html/rfc6874 This patch allows host name verification performed during TLS session establishment, and on a per-call basis, to work correctly when the peer presents a certificate with a non-global IPv6 address listed as one of its alternate names. Whether arbitrary certificate authorities choose issue certificates of this nature, or not, is outside the scope of gRPC. The zone-id is separated from the address using a percent (%) character. It is considered a system implementation detail and guidance suggests it be stripped from any paths or addresses egressing a host because it is irrelevant and meaningless otherwise. It would not make sense for a server to present a certificate containing non-global IPv6 addresses with zone-ids present nor would it work unless two hosts happened to be using the same zone-id. ssl_host_matches_name is prefixed with grpc_ because it has been promoted to the global namespace for testing. Resolves #14371 --- .../security_connector/security_connector.cc | 23 +++++++++++-------- .../security_connector/security_connector.h | 1 + test/core/security/security_connector_test.cc | 21 +++++++++++++++++ 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/core/lib/security/security_connector/security_connector.cc b/src/core/lib/security/security_connector/security_connector.cc index 3551061aa45..b6c8d1e497c 100644 --- a/src/core/lib/security/security_connector/security_connector.cc +++ b/src/core/lib/security/security_connector/security_connector.cc @@ -786,17 +786,20 @@ static void ssl_server_add_handshakers(grpc_server_security_connector* sc, tsi_create_adapter_handshaker(tsi_hs), &sc->base)); } -static int ssl_host_matches_name(const tsi_peer* peer, const char* peer_name) { +int grpc_ssl_host_matches_name(const tsi_peer* peer, const char* peer_name) { char* allocated_name = nullptr; int r; - if (strchr(peer_name, ':') != nullptr) { - char* ignored_port; - gpr_split_host_port(peer_name, &allocated_name, &ignored_port); - gpr_free(ignored_port); - peer_name = allocated_name; - if (!peer_name) return 0; - } + char* ignored_port; + gpr_split_host_port(peer_name, &allocated_name, &ignored_port); + gpr_free(ignored_port); + peer_name = allocated_name; + if (!peer_name) return 0; + + // IPv6 zone-id should not be included in comparisons. + char* const zone_id = strchr(allocated_name, '%'); + if (zone_id != nullptr) *zone_id = '\0'; + r = tsi_ssl_peer_matches_name(peer, peer_name); gpr_free(allocated_name); return r; @@ -859,7 +862,7 @@ static grpc_error* ssl_check_peer(grpc_security_connector* sc, } /* Check the peer name if specified. */ - if (peer_name != nullptr && !ssl_host_matches_name(peer, peer_name)) { + if (peer_name != nullptr && !grpc_ssl_host_matches_name(peer, peer_name)) { char* msg; gpr_asprintf(&msg, "Peer name %s is not in peer certificate", peer_name); grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg); @@ -968,7 +971,7 @@ static bool ssl_channel_check_call_host(grpc_channel_security_connector* sc, reinterpret_cast(sc); grpc_security_status status = GRPC_SECURITY_ERROR; tsi_peer peer = tsi_shallow_peer_from_ssl_auth_context(auth_context); - if (ssl_host_matches_name(&peer, host)) status = GRPC_SECURITY_OK; + if (grpc_ssl_host_matches_name(&peer, host)) status = GRPC_SECURITY_OK; /* If the target name was overridden, then the original target_name was 'checked' transitively during the previous peer check at the end of the handshake. */ diff --git a/src/core/lib/security/security_connector/security_connector.h b/src/core/lib/security/security_connector/security_connector.h index c4cc19db817..f2d94d6f1c3 100644 --- a/src/core/lib/security/security_connector/security_connector.h +++ b/src/core/lib/security/security_connector/security_connector.h @@ -243,6 +243,7 @@ grpc_auth_context* tsi_ssl_peer_to_auth_context(const tsi_peer* peer); tsi_peer tsi_shallow_peer_from_ssl_auth_context( const grpc_auth_context* auth_context); void tsi_shallow_peer_destruct(tsi_peer* peer); +int grpc_ssl_host_matches_name(const tsi_peer* peer, const char* peer_name); /* --- Default SSL Root Store. --- */ namespace grpc_core { diff --git a/test/core/security/security_connector_test.cc b/test/core/security/security_connector_test.cc index f03f4ccdbda..c78d2ae41f7 100644 --- a/test/core/security/security_connector_test.cc +++ b/test/core/security/security_connector_test.cc @@ -340,6 +340,26 @@ static grpc_ssl_roots_override_result override_roots_permanent_failure( return GRPC_SSL_ROOTS_OVERRIDE_FAIL_PERMANENTLY; } +static void test_ipv6_address_san(void) { + const char* addresses[] = { + "2001:db8::1", "fe80::abcd:ef65:4321%em0", "fd11:feed:beef:0:cafe::4", + "128.10.0.1:8888", "[2001:db8::1]:8080", "[2001:db8::1%em1]:8080", + }; + const char* san_ips[] = { + "2001:db8::1", "fe80::abcd:ef65:4321", "fd11:feed:beef:0:cafe::4", + "128.10.0.1", "2001:db8::1", "2001:db8::1", + }; + tsi_peer peer; + GPR_ASSERT(tsi_construct_peer(1, &peer) == TSI_OK); + for (size_t i = 0; i < GPR_ARRAY_SIZE(addresses); i++) { + GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( + TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, san_ips[i], + &peer.properties[0]) == TSI_OK); + GPR_ASSERT(grpc_ssl_host_matches_name(&peer, addresses[i])); + tsi_peer_property_destruct(&peer.properties[0]); + } + tsi_peer_destruct(&peer); +} namespace grpc_core { namespace { @@ -416,6 +436,7 @@ int main(int argc, char** argv) { test_cn_and_one_san_ssl_peer_to_auth_context(); test_cn_and_multiple_sans_ssl_peer_to_auth_context(); test_cn_and_multiple_sans_and_others_ssl_peer_to_auth_context(); + test_ipv6_address_san(); test_default_ssl_roots(); grpc_shutdown(); From 88832144f44d73ff797d0028ab54b2973c217b9f Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 26 Apr 2018 13:02:14 -0700 Subject: [PATCH 097/165] Added trace logging. --- .../lb_policy/subchannel_list.h | 36 ++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index 6d9c382c64b..8746678041f 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -358,8 +358,7 @@ void SubchannelData:: template bool SubchannelData:: UpdateConnectedSubchannelLocked() { -// FIXME: add trace logging - // If the subchannel is READY, get a ref to the connected subchannel. + // If the subchannel is READY, take a ref to the connected subchannel. if (pending_connectivity_state_unsafe_ == GRPC_CHANNEL_READY) { connected_subchannel_ = grpc_subchannel_get_connected_subchannel(subchannel_); @@ -375,14 +374,20 @@ bool SubchannelData:: // is READY again (e.g., if the subchannel has transitioned back to // READY before the next watch gets requested). if (connected_subchannel_ == nullptr) { + if (subchannel_list_->tracer()->enabled()) { + gpr_log(GPR_INFO, + "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR + " (subchannel %p): state is READY but connected subchannel is " + "null; moving to state IDLE", + subchannel_list_->tracer()->name(), + subchannel_list_->policy(), subchannel_list_, Index(), + subchannel_list_->num_subchannels(), subchannel_); + } pending_connectivity_state_unsafe_ = GRPC_CHANNEL_IDLE; return false; } - } -// FIXME: do this for any other state? - // If we get TRANSIENT_FAILURE, unref the connected subchannel. - else if (pending_connectivity_state_unsafe_ == - GRPC_CHANNEL_TRANSIENT_FAILURE) { + } else { + // For any state other than READY, unref the connected subchannel. connected_subchannel_.reset(); } return true; @@ -392,12 +397,25 @@ template void SubchannelData:: OnConnectivityChangedLocked(void* arg, grpc_error* error) { SubchannelData* sd = static_cast(arg); -// FIXME: add trace logging - if (sd->subchannel_list()->shutting_down() || error == GRPC_ERROR_CANCELLED) { + if (sd->subchannel_list_->tracer()->enabled()) { + gpr_log(GPR_INFO, + "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR + " (subchannel %p): connectivity changed: state=%s, error=%s, " + "shutting_down=%d", + sd->subchannel_list_->tracer()->name(), + sd->subchannel_list_->policy(), sd->subchannel_list_, sd->Index(), + sd->subchannel_list_->num_subchannels(), sd->subchannel_, + grpc_connectivity_state_name( + sd->pending_connectivity_state_unsafe_), + grpc_error_string(error), sd->subchannel_list_->shutting_down()); + } + // If shutting down, unref subchannel and stop watching. + if (sd->subchannel_list_->shutting_down() || error == GRPC_ERROR_CANCELLED) { sd->UnrefSubchannelLocked("connectivity_shutdown"); sd->StopConnectivityWatchLocked(); return; } + // Get or release ref to connected subchannel. if (!sd->UpdateConnectedSubchannelLocked()) { // We don't want to report this connectivity state, so renew the watch. sd->StartOrRenewConnectivityWatchLocked(); From 757cd4105504b5ba8b23acc199907cf27c5233a5 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 26 Apr 2018 13:58:39 -0700 Subject: [PATCH 098/165] Make SubchannelList internally ref counted. --- .../lb_policy/pick_first/pick_first.cc | 44 +++++-------------- .../lb_policy/round_robin/round_robin.cc | 30 ++++--------- .../lb_policy/subchannel_list.h | 43 ++++++++++-------- 3 files changed, 44 insertions(+), 73 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index be00e871b8e..6506dc99d61 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -98,9 +98,9 @@ class PickFirst : public LoadBalancingPolicy { void DestroyUnselectedSubchannelsLocked(); // All our subchannels. - RefCountedPtr subchannel_list_; + OrphanablePtr subchannel_list_; // Latest pending subchannel list. - RefCountedPtr latest_pending_subchannel_list_; + OrphanablePtr latest_pending_subchannel_list_; // Selected subchannel in \a subchannel_list_. PickFirstSubchannelData* selected_ = nullptr; // Have we started picking? @@ -160,14 +160,8 @@ void PickFirst::ShutdownLocked() { } grpc_connectivity_state_set(&state_tracker_, GRPC_CHANNEL_SHUTDOWN, GRPC_ERROR_REF(error), "shutdown"); - if (subchannel_list_ != nullptr) { - subchannel_list_->ShutdownLocked("pf_shutdown"); - subchannel_list_.reset(); - } - if (latest_pending_subchannel_list_ != nullptr) { - latest_pending_subchannel_list_->ShutdownLocked("pf_shutdown"); - latest_pending_subchannel_list_.reset(); - } + subchannel_list_.reset(); + latest_pending_subchannel_list_.reset(); TryReresolutionLocked(&grpc_lb_pick_first_trace, GRPC_ERROR_CANCELLED); GRPC_ERROR_UNREF(error); } @@ -300,7 +294,7 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { "Pick First %p received update with %" PRIuPTR " addresses", this, addresses->num_addresses); } - auto subchannel_list = MakeRefCounted( + auto subchannel_list = MakeOrphanable( this, &grpc_lb_pick_first_trace, addresses, combiner(), client_channel_factory(), args); if (subchannel_list->num_subchannels() == 0) { @@ -310,9 +304,6 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { &state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"), "pf_update_empty"); - if (subchannel_list_ != nullptr) { - subchannel_list_->ShutdownLocked("sl_shutdown_empty_update"); - } subchannel_list_ = std::move(subchannel_list); // Empty list. selected_ = nullptr; return; @@ -320,9 +311,6 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { if (selected_ == nullptr) { // We don't yet have a selected subchannel, so replace the current // subchannel list immediately. - if (subchannel_list_ != nullptr) { - subchannel_list_->ShutdownLocked("pf_update_before_selected"); - } subchannel_list_ = std::move(subchannel_list); // If we've started picking, start trying to connect to the first // subchannel in the new list. @@ -347,20 +335,13 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { sd->SetConnectedSubchannelFromLocked(selected_); } selected_ = sd; - if (subchannel_list_ != nullptr) { - subchannel_list_->ShutdownLocked("pf_update_includes_selected"); - } subchannel_list_ = std::move(subchannel_list); DestroyUnselectedSubchannelsLocked(); sd->StartOrRenewConnectivityWatchLocked(); // If there was a previously pending update (which may or may // not have contained the currently selected subchannel), drop // it, so that it doesn't override what we've done here. - if (latest_pending_subchannel_list_ != nullptr) { - latest_pending_subchannel_list_->ShutdownLocked( - "pf_update_includes_selected+outdated"); - latest_pending_subchannel_list_.reset(); - } + latest_pending_subchannel_list_.reset(); return; } } @@ -376,7 +357,6 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { this, latest_pending_subchannel_list_.get(), subchannel_list.get()); } - latest_pending_subchannel_list_->ShutdownLocked("sl_outdated_dont_smash"); } latest_pending_subchannel_list_ = std::move(subchannel_list); // If we've started picking, start trying to connect to the first @@ -404,8 +384,8 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( } // The notification must be for a subchannel in either the current or // latest pending subchannel lists. - GPR_ASSERT(p->subchannel_list_ == subchannel_list() || - p->latest_pending_subchannel_list_ == subchannel_list()); + GPR_ASSERT(subchannel_list() == p->subchannel_list_.get() || + subchannel_list() == p->latest_pending_subchannel_list_.get()); // Handle updates for the currently selected subchannel. if (p->selected_ == this) { // If the new state is anything other than READY and there is a @@ -414,7 +394,6 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( p->latest_pending_subchannel_list_ != nullptr) { p->selected_ = nullptr; StopConnectivityWatchLocked(); - subchannel_list()->ShutdownLocked("selected_not_ready+switch_to_update"); p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); grpc_connectivity_state_set( &p->state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, @@ -460,9 +439,8 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( case GRPC_CHANNEL_READY: { // Case 2. Promote p->latest_pending_subchannel_list_ to // p->subchannel_list_. - if (p->latest_pending_subchannel_list_ == subchannel_list()) { + if (subchannel_list() == p->latest_pending_subchannel_list_.get()) { GPR_ASSERT(p->subchannel_list_ != nullptr); - p->subchannel_list_->ShutdownLocked("finish_update"); p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); } // Cases 1 and 2. @@ -502,7 +480,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( } while (sd->subchannel() == nullptr); // Case 1: Only set state to TRANSIENT_FAILURE if we've tried // all subchannels. - if (sd->Index() == 0 && p->subchannel_list_ == subchannel_list()) { + if (sd->Index() == 0 && subchannel_list() == p->subchannel_list_.get()) { grpc_connectivity_state_set( &p->state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, GRPC_ERROR_REF(error), "connecting_transient_failure"); @@ -513,7 +491,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( case GRPC_CHANNEL_CONNECTING: case GRPC_CHANNEL_IDLE: { // Only update connectivity state in case 1. - if (p->subchannel_list_ == subchannel_list()) { + if (subchannel_list() == p->subchannel_list_.get()) { grpc_connectivity_state_set(&p->state_tracker_, GRPC_CHANNEL_CONNECTING, GRPC_ERROR_REF(error), "connecting_changed"); diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 2b2c0e51327..a4bf3e7398d 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -174,13 +174,13 @@ class RoundRobin : public LoadBalancingPolicy { void UpdateLastReadySubchannelIndexLocked(size_t last_ready_index); /** list of subchannels */ - RefCountedPtr subchannel_list_; + OrphanablePtr subchannel_list_; /** Latest version of the subchannel list. * Subchannel connectivity callbacks will only promote updated subchannel * lists if they equal \a latest_pending_subchannel_list. In other words, * racing callbacks that reference outdated subchannel lists won't perform any * update. */ - RefCountedPtr latest_pending_subchannel_list_; + OrphanablePtr latest_pending_subchannel_list_; /** have we started picking? */ bool started_picking_ = false; /** are we shutting down? */ @@ -303,14 +303,8 @@ void RoundRobin::ShutdownLocked() { } grpc_connectivity_state_set(&state_tracker_, GRPC_CHANNEL_SHUTDOWN, GRPC_ERROR_REF(error), "rr_shutdown"); - if (subchannel_list_ != nullptr) { - subchannel_list_->ShutdownLocked("rr_shutdown"); - subchannel_list_.reset(); - } - if (latest_pending_subchannel_list_ != nullptr) { - latest_pending_subchannel_list_->ShutdownLocked("rr_shutdown"); - latest_pending_subchannel_list_.reset(); - } + subchannel_list_.reset(); + latest_pending_subchannel_list_.reset(); TryReresolutionLocked(&grpc_lb_round_robin_trace, GRPC_ERROR_CANCELLED); GRPC_ERROR_UNREF(error); } @@ -487,7 +481,7 @@ void RoundRobin::RoundRobinSubchannelList:: MaybeUpdateRoundRobinConnectivityStateLocked() { RoundRobin* p = static_cast(policy()); // Only set connectivity state if this is the current subchannel list. - if (p->subchannel_list_ != this) return; + if (p->subchannel_list_.get() != this) return; /* In priority order. The first rule to match terminates the search (ie, if we * are on rule n, all previous rules were unfulfilled). * @@ -523,12 +517,12 @@ void RoundRobin::RoundRobinSubchannelList:: UpdateRoundRobinStateFromSubchannelStateCountsLocked() { RoundRobin* p = static_cast(policy()); if (num_ready_ > 0) { - if (p->subchannel_list_ != this) { + if (p->subchannel_list_.get() != this) { // Promote this list to p->subchannel_list_. // This list must be p->latest_pending_subchannel_list_, because // any previous update would have been shut down already and // therefore weeded out in ProcessConnectivityChangeLocked(). - GPR_ASSERT(p->latest_pending_subchannel_list_ == this); + GPR_ASSERT(p->latest_pending_subchannel_list_.get() == this); GPR_ASSERT(!shutting_down()); if (grpc_lb_round_robin_trace.enabled()) { const size_t old_num_subchannels = @@ -541,10 +535,6 @@ void RoundRobin::RoundRobinSubchannelList:: p, p->subchannel_list_.get(), old_num_subchannels, this, num_subchannels()); } - if (p->subchannel_list_ != nullptr) { - // Dispose of the current subchannel_list. - p->subchannel_list_->ShutdownLocked("sl_phase_out_shutdown"); - } p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); p->last_ready_subchannel_index_ = -1; } @@ -652,9 +642,8 @@ void RoundRobin::UpdateLocked(const grpc_channel_args& args) { "[RR %p] Shutting down previous pending subchannel list %p", this, latest_pending_subchannel_list_.get()); } - latest_pending_subchannel_list_->ShutdownLocked("sl_outdated"); } - latest_pending_subchannel_list_ = MakeRefCounted( + latest_pending_subchannel_list_ = MakeOrphanable( this, &grpc_lb_round_robin_trace, addresses, combiner(), client_channel_factory(), args); // If we haven't started picking yet or the new list is empty, @@ -667,9 +656,6 @@ void RoundRobin::UpdateLocked(const grpc_channel_args& args) { GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"), "rr_update_empty"); } - if (subchannel_list_ != nullptr) { - subchannel_list_->ShutdownLocked("sl_shutdown_replace_on_update"); - } subchannel_list_ = std::move(latest_pending_subchannel_list_); last_ready_subchannel_index_ = -1; } else { diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index 8746678041f..5fb92e22f4e 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -31,6 +31,7 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/abstract.h" #include "src/core/lib/gprpp/inlined_vector.h" +#include "src/core/lib/gprpp/orphanable.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" @@ -118,6 +119,7 @@ class SubchannelData { pending_connectivity_state_unsafe_ = grpc_subchannel_check_connectivity(subchannel(), &error); UpdateConnectedSubchannelLocked(); +// FIXME: move the rest of this into RR if (pending_connectivity_state_unsafe_ != curr_connectivity_state_) { curr_connectivity_state_ = pending_connectivity_state_unsafe_; ProcessConnectivityChangeLocked(error); @@ -148,7 +150,7 @@ class SubchannelData { void CancelConnectivityWatchLocked(const char* reason); // Cancels any pending connectivity watch and unrefs the subchannel. - void ShutdownLocked(const char* reason); + void ShutdownLocked(); GRPC_ABSTRACT_BASE_CLASS @@ -199,11 +201,9 @@ class SubchannelData { }; // A list of subchannels. -// FIXME: make this InternallyRefCounted, and have Orphan() do -// ShutdownLocked()? -// (also, maybe we don't need to take a ref to the LB policy anymore?) template -class SubchannelList : public RefCountedWithTracing { +class SubchannelList + : public InternallyRefCountedWithTracing { public: typedef InlinedVector SubchannelVector; @@ -213,9 +213,6 @@ class SubchannelList : public RefCountedWithTracing { // The data for the subchannel at a particular index. SubchannelDataType* subchannel(size_t index) { return &subchannels_[index]; } - // Marks the subchannel_list as discarded. Unsubscribes all its subchannels. - void ShutdownLocked(const char* reason); - // Returns true if the subchannel list is shutting down. bool shutting_down() const { return shutting_down_; } @@ -223,6 +220,13 @@ class SubchannelList : public RefCountedWithTracing { LoadBalancingPolicy* policy() const { return policy_; } TraceFlag* tracer() const { return tracer_; } + // Note: Caller must ensure that this is invoked inside of the combiner. + void Orphan() override { + ShutdownLocked(); + InternallyRefCountedWithTracing::Unref(DEBUG_LOCATION, + "shutdown"); + } + GRPC_ABSTRACT_BASE_CLASS protected: @@ -238,6 +242,11 @@ class SubchannelList : public RefCountedWithTracing { template friend T* New(Args&&... args); + // For accessing Ref() and Unref(). + friend class SubchannelData; + + void ShutdownLocked(); + // Backpointer to owning policy. LoadBalancingPolicy* policy_; @@ -430,15 +439,14 @@ void SubchannelData:: } template -void SubchannelData::ShutdownLocked( - const char* reason) { +void SubchannelData::ShutdownLocked() { // If there's a pending notification for this subchannel, cancel it; // the callback is responsible for unreffing the subchannel. // Otherwise, unref the subchannel directly. if (connectivity_notification_pending_) { - CancelConnectivityWatchLocked(reason); + CancelConnectivityWatchLocked("shutdown"); } else if (subchannel_ != nullptr) { - UnrefSubchannelLocked(reason); + UnrefSubchannelLocked("shutdown"); } } @@ -452,7 +460,7 @@ SubchannelList::SubchannelList( const grpc_lb_addresses* addresses, grpc_combiner* combiner, grpc_client_channel_factory* client_channel_factory, const grpc_channel_args& args) - : RefCountedWithTracing(tracer), + : InternallyRefCountedWithTracing(tracer), policy_(policy), tracer_(tracer) { if (tracer_->enabled()) { @@ -518,17 +526,16 @@ SubchannelList::~SubchannelList() { } template -void SubchannelList::ShutdownLocked( - const char* reason) { +void SubchannelList::ShutdownLocked() { if (tracer_->enabled()) { - gpr_log(GPR_DEBUG, "[%s %p] Shutting down subchannel_list %p (%s)", - tracer_->name(), policy_, this, reason); + gpr_log(GPR_DEBUG, "[%s %p] Shutting down subchannel_list %p", + tracer_->name(), policy_, this); } GPR_ASSERT(!shutting_down_); shutting_down_ = true; for (size_t i = 0; i < subchannels_.size(); i++) { SubchannelDataType* sd = &subchannels_[i]; - sd->ShutdownLocked(reason); + sd->ShutdownLocked(); } } From 6d21c8bdc402cf3eada383129b537150911a9b0a Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 26 Apr 2018 14:28:04 -0700 Subject: [PATCH 099/165] Split StartOrRenewConnectivityWatchLocked() into two methods. --- .../lb_policy/pick_first/pick_first.cc | 16 ++--- .../lb_policy/round_robin/round_robin.cc | 4 +- .../lb_policy/subchannel_list.h | 63 ++++++++++++++----- 3 files changed, 56 insertions(+), 27 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 6506dc99d61..e80e473f338 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -211,7 +211,7 @@ void PickFirst::StartPickingLocked() { if (subchannel_list_ != nullptr) { for (size_t i = 0; i < subchannel_list_->num_subchannels(); ++i) { if (subchannel_list_->subchannel(i)->subchannel() != nullptr) { - subchannel_list_->subchannel(i)->StartOrRenewConnectivityWatchLocked(); + subchannel_list_->subchannel(i)->StartConnectivityWatchLocked(); break; } } @@ -315,7 +315,7 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { // If we've started picking, start trying to connect to the first // subchannel in the new list. if (started_picking_) { - subchannel_list_->subchannel(0)->StartOrRenewConnectivityWatchLocked(); + subchannel_list_->subchannel(0)->StartConnectivityWatchLocked(); } } else { // We do have a selected subchannel. @@ -337,7 +337,7 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { selected_ = sd; subchannel_list_ = std::move(subchannel_list); DestroyUnselectedSubchannelsLocked(); - sd->StartOrRenewConnectivityWatchLocked(); + sd->StartConnectivityWatchLocked(); // If there was a previously pending update (which may or may // not have contained the currently selected subchannel), drop // it, so that it doesn't override what we've done here. @@ -363,7 +363,7 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { // subchannel in the new list. if (started_picking_) { latest_pending_subchannel_list_->subchannel(0) - ->StartOrRenewConnectivityWatchLocked(); + ->StartConnectivityWatchLocked(); } } } @@ -420,7 +420,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( grpc_connectivity_state_set(&p->state_tracker_, connectivity_state(), GRPC_ERROR_REF(error), "selected_changed"); // Renew notification. - StartOrRenewConnectivityWatchLocked(); + RenewConnectivityWatchLocked(); } } GRPC_ERROR_UNREF(error); @@ -467,7 +467,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( GRPC_CLOSURE_SCHED(pick->on_complete, GRPC_ERROR_NONE); } // Renew notification. - StartOrRenewConnectivityWatchLocked(); + RenewConnectivityWatchLocked(); break; } case GRPC_CHANNEL_TRANSIENT_FAILURE: { @@ -485,7 +485,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( &p->state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, GRPC_ERROR_REF(error), "connecting_transient_failure"); } - sd->StartOrRenewConnectivityWatchLocked(); + sd->StartConnectivityWatchLocked(); break; } case GRPC_CHANNEL_CONNECTING: @@ -497,7 +497,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( "connecting_changed"); } // Renew notification. - StartOrRenewConnectivityWatchLocked(); + RenewConnectivityWatchLocked(); break; } case GRPC_CHANNEL_SHUTDOWN: diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index a4bf3e7398d..a84e29bb071 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -444,7 +444,7 @@ void RoundRobin::RoundRobinSubchannelList::StartWatchingLocked() { // Start connectivity watch for each subchannel. for (size_t i = 0; i < num_subchannels(); i++) { if (subchannel(i)->subchannel() != nullptr) { - subchannel(i)->StartOrRenewConnectivityWatchLocked(); + subchannel(i)->StartConnectivityWatchLocked(); } } } @@ -584,7 +584,7 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( // If we've started watching, update overall state and renew notification. if (subchannel_list()->started_watching()) { subchannel_list()->UpdateRoundRobinStateFromSubchannelStateCountsLocked(); - StartOrRenewConnectivityWatchLocked(); + RenewConnectivityWatchLocked(); } GRPC_ERROR_UNREF(error); } diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index 5fb92e22f4e..f5799b7c611 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -111,8 +111,9 @@ class SubchannelData { // Synchronously checks the subchannel's connectivity state. Calls // ProcessConnectivityChangeLocked() if the state has changed. // Must not be called while there is a connectivity notification - // pending (i.e., between calling StartOrRenewConnectivityWatchLocked() - // and the resulting invocation of ProcessConnectivityChangeLocked()). + // pending (i.e., between calling StartConnectivityWatchLocked() or + // RenewConnectivityWatchLocked() and the resulting invocation of + // ProcessConnectivityChangeLocked()). void CheckConnectivityStateLocked() { GPR_ASSERT(!connectivity_notification_pending_); grpc_error* error = GRPC_ERROR_NONE; @@ -133,18 +134,22 @@ class SubchannelData { // being unreffed. virtual void UnrefSubchannelLocked(const char* reason); - // Starts or renewes watching the connectivity state of the subchannel. + // Starts watching the connectivity state of the subchannel. // ProcessConnectivityChangeLocked() will be called when the // connectivity state changes. - void StartOrRenewConnectivityWatchLocked(); + void StartConnectivityWatchLocked(); + + // Renews watching the connectivity state of the subchannel. + void RenewConnectivityWatchLocked(); // Stops watching the connectivity state of the subchannel. void StopConnectivityWatchLocked(); // Cancels watching the connectivity state of the subchannel. // Must be called only while there is a connectivity notification - // pending (i.e., between calling StartOrRenewConnectivityWatchLocked() - // and the resulting invocation of ProcessConnectivityChangeLocked()). + // pending (i.e., between calling StartConnectivityWatchLocked() or + // RenewConnectivityWatchLocked() and the resulting invocation of + // ProcessConnectivityChangeLocked()). // From within ProcessConnectivityChangeLocked(), use // StopConnectivityWatchLocked() instead. void CancelConnectivityWatchLocked(const char* reason); @@ -162,12 +167,13 @@ class SubchannelData { virtual ~SubchannelData(); - // After StartOrRenewConnectivityWatchLocked() is called, this method - // will be invoked when the subchannel's connectivity state changes. + // After StartConnectivityWatchLocked() or RenewConnectivityWatchLocked() + // is called, this method will be invoked when the subchannel's connectivity + // state changes. // Implementations can use connectivity_state() to get the new // connectivity state. - // Implementations must invoke either StopConnectivityWatch() or again - // call StartOrRenewConnectivityWatch() before returning. + // Implementations must invoke either RenewConnectivityWatchLocked() or + // StopConnectivityWatchLocked() before returning. virtual void ProcessConnectivityChangeLocked(grpc_error* error) GRPC_ABSTRACT; private: @@ -252,6 +258,8 @@ class SubchannelList TraceFlag* tracer_; + grpc_combiner* combiner_; + // The list of subchannels. SubchannelVector subchannels_; @@ -313,21 +321,39 @@ void SubchannelData:: template void SubchannelData::StartOrRenewConnectivityWatchLocked() { + SubchannelDataType>::StartConnectivityWatchLocked() { if (subchannel_list_->tracer()->enabled()) { gpr_log(GPR_DEBUG, "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR - " (subchannel %p): requesting connectivity change " + " (subchannel %p): starting watch: requesting connectivity change " "notification (from %s)", subchannel_list_->tracer()->name(), subchannel_list_->policy(), subchannel_list_, Index(), subchannel_list_->num_subchannels(), subchannel_, grpc_connectivity_state_name(pending_connectivity_state_unsafe_)); } - if (!connectivity_notification_pending_) { - subchannel_list()->Ref(DEBUG_LOCATION, "connectivity_watch").release(); - connectivity_notification_pending_ = true; + GPR_ASSERT(!connectivity_notification_pending_); + connectivity_notification_pending_ = true; + subchannel_list()->Ref(DEBUG_LOCATION, "connectivity_watch").release(); + grpc_subchannel_notify_on_state_change( + subchannel_, subchannel_list_->policy()->interested_parties(), + &pending_connectivity_state_unsafe_, &connectivity_changed_closure_); +} + +template +void SubchannelData::RenewConnectivityWatchLocked() { + if (subchannel_list_->tracer()->enabled()) { + gpr_log(GPR_DEBUG, + "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR + " (subchannel %p): renewing watch: requesting connectivity change " + "notification (from %s)", + subchannel_list_->tracer()->name(), subchannel_list_->policy(), + subchannel_list_, Index(), subchannel_list_->num_subchannels(), + subchannel_, + grpc_connectivity_state_name(pending_connectivity_state_unsafe_)); } + GPR_ASSERT(connectivity_notification_pending_); grpc_subchannel_notify_on_state_change( subchannel_, subchannel_list_->policy()->interested_parties(), &pending_connectivity_state_unsafe_, &connectivity_changed_closure_); @@ -360,6 +386,7 @@ void SubchannelData:: subchannel_list_, Index(), subchannel_list_->num_subchannels(), subchannel_, reason); } + GPR_ASSERT(connectivity_notification_pending_); grpc_subchannel_notify_on_state_change(subchannel_, nullptr, nullptr, &connectivity_changed_closure_); } @@ -427,7 +454,7 @@ void SubchannelData:: // Get or release ref to connected subchannel. if (!sd->UpdateConnectedSubchannelLocked()) { // We don't want to report this connectivity state, so renew the watch. - sd->StartOrRenewConnectivityWatchLocked(); + sd->RenewConnectivityWatchLocked(); return; } // Now that we're inside the combiner, copy the pending connectivity @@ -462,7 +489,8 @@ SubchannelList::SubchannelList( const grpc_channel_args& args) : InternallyRefCountedWithTracing(tracer), policy_(policy), - tracer_(tracer) { + tracer_(tracer), + combiner_(GRPC_COMBINER_REF(combiner, "subchannel_list")) { if (tracer_->enabled()) { gpr_log(GPR_DEBUG, "[%s %p] Creating subchannel list %p for %" PRIuPTR " subchannels", @@ -523,6 +551,7 @@ SubchannelList::~SubchannelList() { gpr_log(GPR_DEBUG, "[%s %p] Destroying subchannel_list %p", tracer_->name(), policy_, this); } + GRPC_COMBINER_UNREF(combiner_, "subchannel_list"); } template From f5f5ee31a25e37d6a19939f837f0089431f9951c Mon Sep 17 00:00:00 2001 From: Ara Ayvazyan Date: Thu, 26 Apr 2018 16:23:06 -0700 Subject: [PATCH 100/165] Enable SIO_LOOPBACK_FAST_PATH on Windows --- src/core/lib/iomgr/tcp_windows.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/core/lib/iomgr/tcp_windows.cc b/src/core/lib/iomgr/tcp_windows.cc index 04e6f11eeeb..5d316d477b7 100644 --- a/src/core/lib/iomgr/tcp_windows.cc +++ b/src/core/lib/iomgr/tcp_windows.cc @@ -74,12 +74,28 @@ static grpc_error* set_dualstack(SOCKET sock) { : GRPC_WSA_ERROR(WSAGetLastError(), "setsockopt(IPV6_V6ONLY)"); } +static grpc_error* enable_loopback_fast_path(SOCKET sock) { + int status; + uint32_t param = 1; + DWORD ret; + status = WSAIoctl(sock, /*SIO_LOOPBACK_FAST_PATH==*/_WSAIOW(IOC_VENDOR, 16), + ¶m, sizeof(param), NULL, 0, &ret, 0, 0); + if (status == SOCKET_ERROR) { + status = WSAGetLastError(); + } + return status == 0 || status == WSAEOPNOTSUPP + ? GRPC_ERROR_NONE + : GRPC_WSA_ERROR(status, "WSAIoctl(SIO_LOOPBACK_FAST_PATH)"); +} + grpc_error* grpc_tcp_prepare_socket(SOCKET sock) { grpc_error* err; err = set_non_block(sock); if (err != GRPC_ERROR_NONE) return err; err = set_dualstack(sock); if (err != GRPC_ERROR_NONE) return err; + err = enable_loopback_fast_path(sock); + if (err != GRPC_ERROR_NONE) return err; return GRPC_ERROR_NONE; } From a3ba733a84888297d4cff7bc88bb46c88064f1ae Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Thu, 26 Apr 2018 16:33:51 -0700 Subject: [PATCH 101/165] Add GPR_DEBUG_ASSERT --- include/grpc/support/log.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/grpc/support/log.h b/include/grpc/support/log.h index b6fbbde23cc..1837d4bd221 100644 --- a/include/grpc/support/log.h +++ b/include/grpc/support/log.h @@ -99,6 +99,12 @@ GPRAPI void gpr_set_log_function(gpr_log_func func); } \ } while (0) +#ifndef NDEBUG +#define GPR_DEBUG_ASSERT(x) GPR_ASSERT(x) +#else +#define GPR_DEBUG_ASSERT(x) +#endif + #ifdef __cplusplus } #endif From 9d56762f0431bf63b5d7656a6c3c9a83c86ec543 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Thu, 26 Apr 2018 16:44:46 -0700 Subject: [PATCH 102/165] replace assert in closures with GPR_ASSERT and move within DEBUG block --- src/core/lib/iomgr/closure.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/lib/iomgr/closure.h b/src/core/lib/iomgr/closure.h index 64527d6bb1c..34a494485d9 100644 --- a/src/core/lib/iomgr/closure.h +++ b/src/core/lib/iomgr/closure.h @@ -253,8 +253,8 @@ inline void grpc_closure_run(grpc_closure* c, grpc_error* error) { c->file_initiated = file; c->line_initiated = line; c->run = true; + GPR_ASSERT(c->cb != nullptr); #endif - assert(c->cb); c->scheduler->vtable->run(c, error); } else { GRPC_ERROR_UNREF(error); @@ -292,8 +292,8 @@ inline void grpc_closure_sched(grpc_closure* c, grpc_error* error) { c->file_initiated = file; c->line_initiated = line; c->run = false; + GPR_ASSERT(c->cb != nullptr); #endif - assert(c->cb); c->scheduler->vtable->sched(c, error); } else { GRPC_ERROR_UNREF(error); @@ -330,8 +330,8 @@ inline void grpc_closure_list_sched(grpc_closure_list* list) { c->file_initiated = file; c->line_initiated = line; c->run = false; + GPR_ASSERT(c->cb != nullptr); #endif - assert(c->cb); c->scheduler->vtable->sched(c, c->error_data.error); c = next; } From 0d98c8d9f0bee1c4f2b9a58955b1659ecc0a2bdb Mon Sep 17 00:00:00 2001 From: Alexander Polcyn Date: Thu, 26 Apr 2018 20:51:50 -0700 Subject: [PATCH 103/165] Fix a bug in an address sorting comparison --- test/cpp/naming/address_sorting_test.cc | 23 +++++++++++++++++++ third_party/address_sorting/address_sorting.c | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/test/cpp/naming/address_sorting_test.cc b/test/cpp/naming/address_sorting_test.cc index a423733cafa..a92e9e3b3e3 100644 --- a/test/cpp/naming/address_sorting_test.cc +++ b/test/cpp/naming/address_sorting_test.cc @@ -298,6 +298,29 @@ TEST(AddressSortingTest, TestUsesLabelFromDefaultTable) { }); } +/* Flip the input on the test above to reorder the sort function's + * comparator's inputs. */ +TEST(AddressSortingTest, TestUsesLabelFromDefaultTableInputFlipped) { + bool ipv4_supported = true; + bool ipv6_supported = true; + OverrideAddressSortingSourceAddrFactory( + ipv4_supported, ipv6_supported, + { + {"[2002::5001]:443", {"[2001::5002]:0", AF_INET6}}, + {"[2001::5001]:443", + {"[2001::5002]:0", AF_INET6}}, // matching labels + }); + grpc_lb_addresses* lb_addrs = BuildLbAddrInputs({ + {"[2001::5001]:443", AF_INET6}, + {"[2002::5001]:443", AF_INET6}, + }); + grpc_cares_wrapper_test_only_address_sorting_sort(lb_addrs); + VerifyLbAddrOutputs(lb_addrs, { + "[2001::5001]:443", + "[2002::5001]:443", + }); +} + /* Tests for rule 6 */ TEST(AddressSortingTest, diff --git a/third_party/address_sorting/address_sorting.c b/third_party/address_sorting/address_sorting.c index d62aca34246..6aa1f994e38 100644 --- a/third_party/address_sorting/address_sorting.c +++ b/third_party/address_sorting/address_sorting.c @@ -255,7 +255,7 @@ static int compare_source_dest_labels_match( second_label_matches = 1; } if (first_label_matches != second_label_matches) { - return first_label_matches ? 1 : 1; + return first_label_matches ? -1 : 1; } return 0; } From bb6d51adaadabdebcbbf439837d053fc411d0a95 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 25 Apr 2018 10:55:43 -0700 Subject: [PATCH 104/165] Add Dockerfiles for Python source distribtests --- .../python_dev_arch_x64/Dockerfile | 22 +++++++++++++++ .../python_dev_centos7_x64/Dockerfile | 22 +++++++++++++++ .../python_dev_fedora22_x64/Dockerfile | 23 ++++++++++++++++ .../python_dev_fedora23_x64/Dockerfile | 23 ++++++++++++++++ .../python_dev_jessie_x64/Dockerfile | 21 +++++++++++++++ .../python_dev_jessie_x86/Dockerfile | 27 +++++++++++++++++++ .../python_dev_ubuntu1404_x64/Dockerfile | 22 +++++++++++++++ .../python_dev_ubuntu1604_x64/Dockerfile | 22 +++++++++++++++ 8 files changed, 182 insertions(+) create mode 100644 tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile create mode 100644 tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile create mode 100644 tools/dockerfile/distribtest/python_dev_fedora22_x64/Dockerfile create mode 100644 tools/dockerfile/distribtest/python_dev_fedora23_x64/Dockerfile create mode 100644 tools/dockerfile/distribtest/python_dev_jessie_x64/Dockerfile create mode 100644 tools/dockerfile/distribtest/python_dev_jessie_x86/Dockerfile create mode 100644 tools/dockerfile/distribtest/python_dev_ubuntu1404_x64/Dockerfile create mode 100644 tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile diff --git a/tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile new file mode 100644 index 00000000000..7f09fd64234 --- /dev/null +++ b/tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile @@ -0,0 +1,22 @@ +# Copyright 2015 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. + +FROM base/archlinux + +RUN pacman --noconfirm -Syy +RUN pacman --noconfirm -S openssl +RUN pacman --noconfirm -S python2 +RUN pacman --noconfirm -S python2-pip +RUN pip2 install virtualenv +RUN pacman --noconfirm -S base-devel diff --git a/tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile new file mode 100644 index 00000000000..954146c5e91 --- /dev/null +++ b/tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile @@ -0,0 +1,22 @@ +# Copyright 2015 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. + +FROM centos:7 + +RUN yum install -y python +RUN yum install -y epel-release +RUN yum install -y python-pip +RUN pip install virtualenv +RUN yum groupinstall -y 'Development Tools' +RUN yum install -y python-devel diff --git a/tools/dockerfile/distribtest/python_dev_fedora22_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_fedora22_x64/Dockerfile new file mode 100644 index 00000000000..d86ad378c33 --- /dev/null +++ b/tools/dockerfile/distribtest/python_dev_fedora22_x64/Dockerfile @@ -0,0 +1,23 @@ +# Copyright 2015 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. + +FROM fedora:22 + +RUN yum clean all && yum update -y && yum install -y python python-pip +RUN pip install virtualenv + +RUN yum groupinstall -y "Development Tools" +RUN yum install -y redhat-rpm-config +RUN yum install -y gcc-c++ +RUN yum install -y python2-devel diff --git a/tools/dockerfile/distribtest/python_dev_fedora23_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_fedora23_x64/Dockerfile new file mode 100644 index 00000000000..0dbf5e4c21a --- /dev/null +++ b/tools/dockerfile/distribtest/python_dev_fedora23_x64/Dockerfile @@ -0,0 +1,23 @@ +# Copyright 2015 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. + +FROM fedora:23 + +RUN yum clean all && yum update -y && yum install -y python python-pip +RUN pip install virtualenv + +RUN yum groupinstall -y "Development Tools" +RUN yum install -y redhat-rpm-config +RUN yum install -y gcc-c++ +RUN yum install -y python2-devel diff --git a/tools/dockerfile/distribtest/python_dev_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_jessie_x64/Dockerfile new file mode 100644 index 00000000000..c2228989cdc --- /dev/null +++ b/tools/dockerfile/distribtest/python_dev_jessie_x64/Dockerfile @@ -0,0 +1,21 @@ +# Copyright 2015 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. + +FROM debian:jessie + +RUN apt-get update && apt-get install -y python python-pip +RUN pip install virtualenv + +RUN apt-get install -y build-essential +RUN apt-get install -y python-dev diff --git a/tools/dockerfile/distribtest/python_dev_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/python_dev_jessie_x86/Dockerfile new file mode 100644 index 00000000000..5e0b8efe756 --- /dev/null +++ b/tools/dockerfile/distribtest/python_dev_jessie_x86/Dockerfile @@ -0,0 +1,27 @@ +# Copyright 2015 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. + +FROM 32bit/debian:jessie + +RUN apt-get update && apt-get install -y python python-pip + +RUN pip install virtualenv + +RUN apt-get install -y build-essential +RUN apt-get install -y python-dev + +# docker is running on a 64-bit machine, so we need to +# override "uname -m" to report i686 instead of x86_64, otherwise +# python will choose a wrong binary package to install. +ENTRYPOINT ["linux32"] diff --git a/tools/dockerfile/distribtest/python_dev_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_ubuntu1404_x64/Dockerfile new file mode 100644 index 00000000000..6c842aeba00 --- /dev/null +++ b/tools/dockerfile/distribtest/python_dev_ubuntu1404_x64/Dockerfile @@ -0,0 +1,22 @@ +# Copyright 2015 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. + +FROM ubuntu:14.04 + +RUN apt-get update -y && apt-get install -y python python-pip + +RUN apt-get install -y build-essential +RUN apt-get install -y python-dev + +RUN pip install virtualenv diff --git a/tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile new file mode 100644 index 00000000000..1ff1e0a1d61 --- /dev/null +++ b/tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile @@ -0,0 +1,22 @@ +# Copyright 2015 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. + +FROM ubuntu:16.04 + +RUN apt-get update -y && apt-get install -y python python-pip + +RUN apt-get install -y build-essential +RUN apt-get install -y python-dev + +RUN pip install virtualenv From 97904d46e06085bb1fa3d3318933d570d0b4468b Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Thu, 26 Apr 2018 15:00:51 -0700 Subject: [PATCH 105/165] Add Python source distribtest targets --- .../artifacts/distribtest_targets.py | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index 9087841c4bd..bfb0a9e57fd 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -146,8 +146,12 @@ class CSharpDistribTest(object): class PythonDistribTest(object): """Tests Python package""" - def __init__(self, platform, arch, docker_suffix): - self.name = 'python_%s_%s_%s' % (platform, arch, docker_suffix) + def __init__(self, platform, arch, docker_suffix, source=False): + self.source = source + if source: + self.name = 'python_dev_%s_%s_%s' % (platform, arch, docker_suffix) + else: + self.name = 'python_%s_%s_%s' % (platform, arch, docker_suffix) self.platform = platform self.arch = arch self.docker_suffix = docker_suffix @@ -160,12 +164,20 @@ class PythonDistribTest(object): if not self.platform == 'linux': raise Exception("Not supported yet.") - return create_docker_jobspec( - self.name, - 'tools/dockerfile/distribtest/python_%s_%s' % (self.docker_suffix, - self.arch), - 'test/distrib/python/run_binary_distrib_test.sh', - copy_rel_path='test/distrib') + if self.source: + return create_docker_jobspec( + self.name, + 'tools/dockerfile/distribtest/python_dev_%s_%s' % ( + self.docker_suffix, self.arch), + 'test/distrib/python/run_source_distrib_test.sh', + copy_rel_path='test/distrib') + else: + return create_docker_jobspec( + self.name, + 'tools/dockerfile/distribtest/python_%s_%s' % ( + self.docker_suffix, self.arch), + 'test/distrib/python/run_binary_distrib_test.sh', + copy_rel_path='test/distrib') def __str__(self): return self.name @@ -315,6 +327,14 @@ def targets(): PythonDistribTest('linux', 'x64', 'ubuntu1204'), PythonDistribTest('linux', 'x64', 'ubuntu1404'), PythonDistribTest('linux', 'x64', 'ubuntu1604'), + PythonDistribTest('linux', 'x64', 'jessie', source=True), + PythonDistribTest('linux', 'x86', 'jessie', source=True), + PythonDistribTest('linux', 'x64', 'centos7', source=True), + PythonDistribTest('linux', 'x64', 'fedora22', source=True), + PythonDistribTest('linux', 'x64', 'fedora23', source=True), + PythonDistribTest('linux', 'x64', 'arch', source=True), + PythonDistribTest('linux', 'x64', 'ubuntu1404', source=True), + PythonDistribTest('linux', 'x64', 'ubuntu1604', source=True), RubyDistribTest('linux', 'x64', 'wheezy'), RubyDistribTest('linux', 'x64', 'jessie'), RubyDistribTest('linux', 'x86', 'jessie'), From 3b0966069477e917ee071d1fa3ba5fc126a114d2 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 27 Apr 2018 12:31:10 +0200 Subject: [PATCH 106/165] Update ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 24587a55e1c..5b2ac80df6a 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,12 +1,12 @@ -Please answer these questions before submitting your issue. - -### Should this be an issue in the gRPC issue tracker? - -Create new issues for bugs and feature requests. An issue needs to be actionable. General gRPC discussions and usage questions belong to: -- [grpc.io mailing list](https://groups.google.com/forum/#!forum/grpc-io) -- [StackOverflow, with `grpc` tag](http://stackoverflow.com/questions/tagged/grpc) - -*Please don't double post your questions in more locations; we are monitoring both channels, and the time spent de-duplicating questions is better spent answering more user questions.* + ### What version of gRPC and what language are you using? From f4bea02a725bd3743a1a93dcf9adfefc76a9a58b Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Fri, 27 Apr 2018 00:12:13 -0700 Subject: [PATCH 107/165] Fix the Python source distribtest script --- test/distrib/python/test_packages.sh | 18 ++++++++++++++---- .../run_tests/artifacts/distribtest_targets.py | 8 ++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/test/distrib/python/test_packages.sh b/test/distrib/python/test_packages.sh index e16eddd5779..6bf49d45b99 100755 --- a/test/distrib/python/test_packages.sh +++ b/test/distrib/python/test_packages.sh @@ -22,12 +22,14 @@ shopt -s nullglob if [[ "$1" == "binary" ]] then echo "Testing Python binary distribution" - ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-*.whl) - TOOLS_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio_tools-*.whl) + ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-[0-9]*.whl) + TOOLS_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio_tools-[0-9]*.whl) else echo "Testing Python source distribution" - ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-*.tar.gz) - TOOLS_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio_tools-*.tar.gz) + ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-[0-9]*.tar.gz) + TOOLS_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-tools-[0-9]*.tar.gz) + HEALTH_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-health-checking-[0-9]*.tar.gz) + REFLECTION_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-reflection-[0-9]*.tar.gz) fi VIRTUAL_ENV=$(mktemp -d) @@ -52,6 +54,14 @@ function at_least_one_installs() { at_least_one_installs "${ARCHIVES[@]}" at_least_one_installs "${TOOLS_ARCHIVES[@]}" +if [[ "$1" == "source" ]] +then + echo "Testing Python health and reflection packages" + at_least_one_installs "${HEALTH_ARCHIVES[@]}" + at_least_one_installs "${REFLECTION_ARCHIVES[@]}" +fi + + # # Test our distributions # diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index bfb0a9e57fd..80adc201841 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -167,15 +167,15 @@ class PythonDistribTest(object): if self.source: return create_docker_jobspec( self.name, - 'tools/dockerfile/distribtest/python_dev_%s_%s' % ( - self.docker_suffix, self.arch), + 'tools/dockerfile/distribtest/python_dev_%s_%s' % + (self.docker_suffix, self.arch), 'test/distrib/python/run_source_distrib_test.sh', copy_rel_path='test/distrib') else: return create_docker_jobspec( self.name, - 'tools/dockerfile/distribtest/python_%s_%s' % ( - self.docker_suffix, self.arch), + 'tools/dockerfile/distribtest/python_%s_%s' % + (self.docker_suffix, self.arch), 'test/distrib/python/run_binary_distrib_test.sh', copy_rel_path='test/distrib') From 700d050500defd84161ddb32a883759a5b205d60 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Fri, 27 Apr 2018 07:01:00 -0700 Subject: [PATCH 108/165] Bump pip in yapf_virtual_environment --- tools/distrib/yapf_code.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/distrib/yapf_code.sh b/tools/distrib/yapf_code.sh index 919e9c13d54..27c5e3129dd 100755 --- a/tools/distrib/yapf_code.sh +++ b/tools/distrib/yapf_code.sh @@ -30,11 +30,11 @@ EXCLUSIONS=( VIRTUALENV=yapf_virtual_environment -virtualenv $VIRTUALENV -PYTHON=$(realpath "${VIRTUALENV}/bin/python") -$PYTHON -m pip install --upgrade pip==9.0.2 -$PYTHON -m pip install --upgrade futures -$PYTHON -m pip install yapf==0.20.0 +python -m virtualenv $VIRTUALENV +PYTHON=${VIRTUALENV}/bin/python +"$PYTHON" -m pip install --upgrade pip==10.0.1 +"$PYTHON" -m pip install --upgrade futures +"$PYTHON" -m pip install yapf==0.20.0 yapf() { local exclusion exclusion_args=() From 4ea4727ac5d7aec4e8c60f19b05196316c737ef3 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 27 Apr 2018 17:01:00 +0200 Subject: [PATCH 109/165] Allow creating instances of ServerCallContext in tests --- .../TestServerCallContext.cs | 58 +++++++++++++++++++ src/csharp/Grpc.Core/ServerCallContext.cs | 34 +++++++++-- 2 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 src/csharp/Grpc.Core.Testing/TestServerCallContext.cs diff --git a/src/csharp/Grpc.Core.Testing/TestServerCallContext.cs b/src/csharp/Grpc.Core.Testing/TestServerCallContext.cs new file mode 100644 index 00000000000..5418417d7ed --- /dev/null +++ b/src/csharp/Grpc.Core.Testing/TestServerCallContext.cs @@ -0,0 +1,58 @@ +#region Copyright notice and license + +// Copyright 2015 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. + +#endregion + +using System; +using System.Threading; +using System.Threading.Tasks; +using Grpc.Core; + +namespace Grpc.Core.Testing +{ + /// + /// Creates test doubles for ServerCallContext. + /// + public static class TestServerCallContext + { + /// + /// Creates a test double for ServerCallContext. Only for testing. + /// Note: experimental API that can change or be removed without any prior notice. + /// + public static ServerCallContext Create(string method, string host, DateTime deadline, Metadata requestHeaders, CancellationToken cancellationToken, + string peer, AuthContext authContext, ContextPropagationToken contextPropagationToken, + Func writeHeadersFunc, Func writeOptionsGetter, Action writeOptionsSetter) + { + return new ServerCallContext(null, method, host, deadline, requestHeaders, cancellationToken, + writeHeadersFunc, new WriteOptionsHolder(writeOptionsGetter, writeOptionsSetter), + () => peer, () => authContext, () => contextPropagationToken); + } + + private class WriteOptionsHolder : IHasWriteOptions + { + Func writeOptionsGetter; + Action writeOptionsSetter; + + public WriteOptionsHolder(Func writeOptionsGetter, Action writeOptionsSetter) + { + this.writeOptionsGetter = writeOptionsGetter; + this.writeOptionsSetter = writeOptionsSetter; + } + + public WriteOptions WriteOptions { get => writeOptionsGetter(); set => writeOptionsSetter(value); } + } + } +} diff --git a/src/csharp/Grpc.Core/ServerCallContext.cs b/src/csharp/Grpc.Core/ServerCallContext.cs index c63a4c45db1..74a7deabea0 100644 --- a/src/csharp/Grpc.Core/ServerCallContext.cs +++ b/src/csharp/Grpc.Core/ServerCallContext.cs @@ -36,14 +36,25 @@ namespace Grpc.Core private readonly Metadata requestHeaders; private readonly CancellationToken cancellationToken; private readonly Metadata responseTrailers = new Metadata(); + private readonly Func writeHeadersFunc; + private readonly IHasWriteOptions writeOptionsHolder; + private readonly Lazy authContext; + private readonly Func testingOnlyPeerGetter; + private readonly Func testingOnlyAuthContextGetter; + private readonly Func testingOnlyContextPropagationTokenFactory; private Status status = Status.DefaultSuccess; - private Func writeHeadersFunc; - private IHasWriteOptions writeOptionsHolder; - private Lazy authContext; internal ServerCallContext(CallSafeHandle callHandle, string method, string host, DateTime deadline, Metadata requestHeaders, CancellationToken cancellationToken, Func writeHeadersFunc, IHasWriteOptions writeOptionsHolder) + : this(callHandle, method, host, deadline, requestHeaders, cancellationToken, writeHeadersFunc, writeOptionsHolder, null, null, null) + { + } + + // Additional constructor params should be used for testing only + internal ServerCallContext(CallSafeHandle callHandle, string method, string host, DateTime deadline, Metadata requestHeaders, CancellationToken cancellationToken, + Func writeHeadersFunc, IHasWriteOptions writeOptionsHolder, + Func testingOnlyPeerGetter, Func testingOnlyAuthContextGetter, Func testingOnlyContextPropagationTokenFactory) { this.callHandle = callHandle; this.method = method; @@ -54,6 +65,9 @@ namespace Grpc.Core this.writeHeadersFunc = writeHeadersFunc; this.writeOptionsHolder = writeOptionsHolder; this.authContext = new Lazy(GetAuthContextEager); + this.testingOnlyPeerGetter = testingOnlyPeerGetter; + this.testingOnlyAuthContextGetter = testingOnlyAuthContextGetter; + this.testingOnlyContextPropagationTokenFactory = testingOnlyContextPropagationTokenFactory; } /// @@ -73,6 +87,10 @@ namespace Grpc.Core /// public ContextPropagationToken CreatePropagationToken(ContextPropagationOptions options = null) { + if (testingOnlyContextPropagationTokenFactory != null) + { + return testingOnlyContextPropagationTokenFactory(); + } return new ContextPropagationToken(callHandle, deadline, cancellationToken, options); } @@ -99,6 +117,10 @@ namespace Grpc.Core { get { + if (testingOnlyPeerGetter != null) + { + return testingOnlyPeerGetter(); + } // Getting the peer lazily is fine as the native call is guaranteed // not to be disposed before user-supplied server side handler returns. // Most users won't need to read this field anyway. @@ -182,6 +204,10 @@ namespace Grpc.Core { get { + if (testingOnlyAuthContextGetter != null) + { + return testingOnlyAuthContextGetter(); + } return authContext.Value; } } @@ -198,7 +224,7 @@ namespace Grpc.Core /// /// Allows sharing write options between ServerCallContext and other objects. /// - public interface IHasWriteOptions + internal interface IHasWriteOptions { /// /// Gets or sets the write options. From 717c100c8c5be62c76d9edbcd8b4036b3fb98bfe Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 27 Apr 2018 08:24:30 -0700 Subject: [PATCH 110/165] Clean up connectivity state tracking. --- .../lb_policy/pick_first/pick_first.cc | 17 +++-- .../lb_policy/round_robin/round_robin.cc | 74 +++++++++---------- .../lb_policy/subchannel_list.h | 51 ++++--------- 3 files changed, 56 insertions(+), 86 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index dc98a921788..1fecdebccf2 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -76,7 +76,8 @@ class PickFirst : public LoadBalancingPolicy { : SubchannelData(subchannel_list, user_data_vtable, address, subchannel, combiner) {} - void ProcessConnectivityChangeLocked(grpc_error* error) override; + void ProcessConnectivityChangeLocked( + grpc_connectivity_state connectivity_state, grpc_error* error) override; }; class PickFirstSubchannelList @@ -369,7 +370,7 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { } void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( - grpc_error* error) { + grpc_connectivity_state connectivity_state, grpc_error* error) { PickFirst* p = static_cast(subchannel_list()->policy()); if (grpc_lb_pick_first_trace.enabled()) { gpr_log(GPR_INFO, @@ -379,7 +380,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( "sd->subchannel_list->shutting_down=%d error=%s", p, subchannel(), Index(), subchannel_list()->num_subchannels(), subchannel_list(), - grpc_connectivity_state_name(connectivity_state()), p->shutdown_, + grpc_connectivity_state_name(connectivity_state), p->shutdown_, subchannel_list()->shutting_down(), grpc_error_string(error)); } // The notification must be for a subchannel in either the current or @@ -390,7 +391,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( if (p->selected_ == this) { // If the new state is anything other than READY and there is a // pending update, switch to the pending update. - if (connectivity_state() != GRPC_CHANNEL_READY && + if (connectivity_state != GRPC_CHANNEL_READY && p->latest_pending_subchannel_list_ != nullptr) { p->selected_ = nullptr; StopConnectivityWatchLocked(); @@ -404,8 +405,8 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( // re-resolution is introduced. But we need to investigate whether we // really want to take any action instead of waiting for the selected // subchannel reconnecting. - GPR_ASSERT(connectivity_state() != GRPC_CHANNEL_SHUTDOWN); - if (connectivity_state() == GRPC_CHANNEL_TRANSIENT_FAILURE) { + GPR_ASSERT(connectivity_state != GRPC_CHANNEL_SHUTDOWN); + if (connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { // If the selected channel goes bad, request a re-resolution. grpc_connectivity_state_set(&p->state_tracker_, GRPC_CHANNEL_IDLE, GRPC_ERROR_NONE, @@ -417,7 +418,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( UnrefSubchannelLocked("pf_selected_shutdown"); StopConnectivityWatchLocked(); } else { - grpc_connectivity_state_set(&p->state_tracker_, connectivity_state(), + grpc_connectivity_state_set(&p->state_tracker_, connectivity_state, GRPC_ERROR_REF(error), "selected_changed"); // Renew notification. RenewConnectivityWatchLocked(); @@ -435,7 +436,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( // for a subchannel in p->latest_pending_subchannel_list_. The // goal here is to find a subchannel from the update that we can // select in place of the current one. - switch (connectivity_state()) { + switch (connectivity_state) { case GRPC_CHANNEL_READY: { // Case 2. Promote p->latest_pending_subchannel_list_ to // p->subchannel_list_. diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index d6a738ffc98..764d2c8ad76 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -109,12 +109,20 @@ class RoundRobin : public LoadBalancingPolicy { void* user_data() const { return user_data_; } + grpc_connectivity_state connectivity_state() const { + return last_connectivity_state_; + } + + void UpdateConnectivityStateLocked( + grpc_connectivity_state connectivity_state, grpc_error* error); + private: - void ProcessConnectivityChangeLocked(grpc_error* error) override; + void ProcessConnectivityChangeLocked( + grpc_connectivity_state connectivity_state, grpc_error* error) override; const grpc_lb_user_data_vtable* user_data_vtable_; void* user_data_ = nullptr; - grpc_connectivity_state prev_connectivity_state_ = GRPC_CHANNEL_IDLE; + grpc_connectivity_state last_connectivity_state_ = GRPC_CHANNEL_IDLE; }; // A list of subchannels. @@ -137,9 +145,6 @@ class RoundRobin : public LoadBalancingPolicy { // Starts watching the subchannels in this list. void StartWatchingLocked(); - // Returns true if we have started watching. - bool started_watching() const { return started_watching_; } - // Updates the counters of subchannels in each state when a // subchannel transitions from old_state to new_state. // transient_failure_error is the error that is reported when @@ -158,7 +163,6 @@ class RoundRobin : public LoadBalancingPolicy { void UpdateRoundRobinStateFromSubchannelStateCountsLocked(); private: - bool started_watching_ = false; size_t num_ready_ = 0; size_t num_connecting_ = 0; size_t num_transient_failure_ = 0; @@ -416,29 +420,16 @@ void RoundRobin::RoundRobinSubchannelList::StartWatchingLocked() { if (num_subchannels() == 0) return; // Check current state of each subchannel synchronously, since any // subchannel already used by some other channel may have a non-IDLE - // state. This will invoke ProcessConnectivityChangeLocked() for each - // subchannel whose state is not IDLE. However, because started_watching_ - // is still false, the code there will do two special things: - // - // - It will skip re-resolution for any subchannel in state - // TRANSIENT_FAILURE, since doing this at start-watching-time would - // cause us to enter an endless loop of re-resolution (i.e., - // re-resolution would cause a new update, and the new update would - // immediately trigger a new re-resolution). - // - // - It will not call UpdateRoundRobinStateFromSubchannelStateCountsLocked(); - // instead, we call that here after all subchannels have been checked. - // This allows us to act more intelligently based on the state of all - // subchannels, rather than just acting on the first one. For example, - // if there is more than one pending pick, this allows us to spread the - // picks across all READY subchannels rather than sending them all to - // the first subchannel that reports READY. + // state. for (size_t i = 0; i < num_subchannels(); ++i) { - subchannel(i)->CheckConnectivityStateLocked(); + grpc_error* error = GRPC_ERROR_NONE; + grpc_connectivity_state state = + subchannel(i)->CheckConnectivityStateLocked(&error); + if (state != GRPC_CHANNEL_IDLE) { + subchannel(i)->UpdateConnectivityStateLocked(state, error); + } } - // Now set started_watching_ to true and call - // UpdateRoundRobinStateFromSubchannelStateCountsLocked(). - started_watching_ = true; + // Now set the LB policy's state based on the subchannels' states. UpdateRoundRobinStateFromSubchannelStateCountsLocked(); // Start connectivity watch for each subchannel. for (size_t i = 0; i < num_subchannels(); i++) { @@ -544,8 +535,15 @@ void RoundRobin::RoundRobinSubchannelList:: MaybeUpdateRoundRobinConnectivityStateLocked(); } +void RoundRobin::RoundRobinSubchannelData::UpdateConnectivityStateLocked( + grpc_connectivity_state connectivity_state, grpc_error* error) { + subchannel_list()->UpdateStateCountersLocked( + last_connectivity_state_, connectivity_state, GRPC_ERROR_REF(error)); + last_connectivity_state_ = connectivity_state; +} + void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( - grpc_error* error) { + grpc_connectivity_state connectivity_state, grpc_error* error) { RoundRobin* p = static_cast(subchannel_list()->policy()); if (grpc_lb_round_robin_trace.enabled()) { gpr_log( @@ -556,8 +554,8 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( "p->shutdown=%d sd->subchannel_list->shutting_down=%d error=%s", p, subchannel(), subchannel_list(), Index(), subchannel_list()->num_subchannels(), - grpc_connectivity_state_name(prev_connectivity_state_), - grpc_connectivity_state_name(connectivity_state()), p->shutdown_, + grpc_connectivity_state_name(last_connectivity_state_), + grpc_connectivity_state_name(connectivity_state), p->shutdown_, subchannel_list()->shutting_down(), grpc_error_string(error)); } GPR_ASSERT(subchannel() != nullptr); @@ -566,8 +564,7 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( // Otherwise, if the subchannel was already in state TRANSIENT_FAILURE // when the subchannel list was created, we'd wind up in a constant // loop of re-resolution. - if (connectivity_state() == GRPC_CHANNEL_TRANSIENT_FAILURE && - subchannel_list()->started_watching()) { + if (connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_INFO, "[RR %p] Subchannel %p has gone into TRANSIENT_FAILURE. " @@ -577,15 +574,10 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( p->TryReresolutionLocked(&grpc_lb_round_robin_trace, GRPC_ERROR_NONE); } // Update state counters. - subchannel_list()->UpdateStateCountersLocked( - prev_connectivity_state_, connectivity_state(), GRPC_ERROR_REF(error)); - prev_connectivity_state_ = connectivity_state(); - // If we've started watching, update overall state and renew notification. - if (subchannel_list()->started_watching()) { - subchannel_list()->UpdateRoundRobinStateFromSubchannelStateCountsLocked(); - RenewConnectivityWatchLocked(); - } - GRPC_ERROR_UNREF(error); + UpdateConnectivityStateLocked(connectivity_state, error); + // Update overall state and renew notification. + subchannel_list()->UpdateRoundRobinStateFromSubchannelStateCountsLocked(); + RenewConnectivityWatchLocked(); } grpc_connectivity_state RoundRobin::CheckConnectivityLocked( diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index bae3f0ba71d..bad50c461cc 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -49,7 +49,8 @@ class MySubchannelList; // Forward declaration. class MySubchannelData : public SubchannelData { public: - void ProcessConnectivityChangeLocked(grpc_error* error) override { + void ProcessConnectivityChangeLocked( + grpc_connectivity_state connectivity_state, grpc_error* error) override { // ...code to handle connectivity changes... } }; @@ -88,13 +89,7 @@ class SubchannelData { return connected_subchannel_.get(); } - // The current connectivity state. - // May be called from ProcessConnectivityChangeLocked() to determine - // the state that the subchannel has transitioned into. - grpc_connectivity_state connectivity_state() const { - return curr_connectivity_state_; - } - +// FIXME: remove // Used to set the connected subchannel in cases where we are retaining a // subchannel from a previous subchannel list. This is slightly more // efficient than getting the connected subchannel from the subchannel, @@ -108,25 +103,17 @@ class SubchannelData { connected_subchannel_ = other->connected_subchannel_; // Adds ref. } - // Synchronously checks the subchannel's connectivity state. Calls - // ProcessConnectivityChangeLocked() if the state has changed. + // Synchronously checks the subchannel's connectivity state. // Must not be called while there is a connectivity notification // pending (i.e., between calling StartConnectivityWatchLocked() or // RenewConnectivityWatchLocked() and the resulting invocation of // ProcessConnectivityChangeLocked()). - void CheckConnectivityStateLocked() { + grpc_connectivity_state CheckConnectivityStateLocked(grpc_error** error) { GPR_ASSERT(!connectivity_notification_pending_); - grpc_error* error = GRPC_ERROR_NONE; pending_connectivity_state_unsafe_ = - grpc_subchannel_check_connectivity(subchannel(), &error); + grpc_subchannel_check_connectivity(subchannel(), error); UpdateConnectedSubchannelLocked(); -// FIXME: move the rest of this into RR - if (pending_connectivity_state_unsafe_ != curr_connectivity_state_) { - curr_connectivity_state_ = pending_connectivity_state_unsafe_; - ProcessConnectivityChangeLocked(error); - } else { - GRPC_ERROR_UNREF(error); - } + return pending_connectivity_state_unsafe_; } // Unrefs the subchannel. May be used if an individual subchannel is @@ -170,11 +157,11 @@ class SubchannelData { // After StartConnectivityWatchLocked() or RenewConnectivityWatchLocked() // is called, this method will be invoked when the subchannel's connectivity // state changes. - // Implementations can use connectivity_state() to get the new - // connectivity state. // Implementations must invoke either RenewConnectivityWatchLocked() or // StopConnectivityWatchLocked() before returning. - virtual void ProcessConnectivityChangeLocked(grpc_error* error) GRPC_ABSTRACT; + virtual void ProcessConnectivityChangeLocked( + grpc_connectivity_state connectivity_state, + grpc_error* error) GRPC_ABSTRACT; private: // Updates connected_subchannel_ based on pending_connectivity_state_unsafe_. @@ -196,14 +183,8 @@ class SubchannelData { bool connectivity_notification_pending_ = false; // Connectivity state to be updated by // grpc_subchannel_notify_on_state_change(), not guarded by - // the combiner. Will be copied to curr_connectivity_state_ by - // OnConnectivityChangedLocked(). + // the combiner. grpc_connectivity_state pending_connectivity_state_unsafe_; - // Current connectivity state. -// FIXME: move this into RR, not needed in PF because connectivity_state -// is only used in ProcessConnectivityChangeLocked() -// (maybe pass it as a param and eliminate the accessor method?) - grpc_connectivity_state curr_connectivity_state_; }; // A list of subchannels. @@ -287,8 +268,7 @@ SubchannelData::SubchannelData( subchannel_(subchannel), // We assume that the current state is IDLE. If not, we'll get a // callback telling us that. - pending_connectivity_state_unsafe_(GRPC_CHANNEL_IDLE), - curr_connectivity_state_(GRPC_CHANNEL_IDLE) { + pending_connectivity_state_unsafe_(GRPC_CHANNEL_IDLE) { GRPC_CLOSURE_INIT( &connectivity_changed_closure_, (&SubchannelData:: sd->RenewConnectivityWatchLocked(); return; } - // Now that we're inside the combiner, copy the pending connectivity - // state (which was set by the connectivity state watcher) to - // curr_connectivity_state_, which is what we use inside of the combiner. - sd->curr_connectivity_state_ = sd->pending_connectivity_state_unsafe_; // Call the subclass's ProcessConnectivityChangeLocked() method. - sd->ProcessConnectivityChangeLocked(GRPC_ERROR_REF(error)); + sd->ProcessConnectivityChangeLocked(sd->pending_connectivity_state_unsafe_, + GRPC_ERROR_REF(error)); } template From 171044c4d422a460a21393d8584875e70be1fa85 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 27 Apr 2018 17:31:23 +0200 Subject: [PATCH 111/165] Fix bad variable name in route_guide_server.js --- examples/node/dynamic_codegen/route_guide/route_guide_server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/node/dynamic_codegen/route_guide/route_guide_server.js b/examples/node/dynamic_codegen/route_guide/route_guide_server.js index f9028e860d9..3819c092eb5 100644 --- a/examples/node/dynamic_codegen/route_guide/route_guide_server.js +++ b/examples/node/dynamic_codegen/route_guide/route_guide_server.js @@ -122,7 +122,7 @@ function getDistance(start, end) { var deltalon = lon2-lon1; var a = Math.sin(deltalat/2) * Math.sin(deltalat/2) + Math.cos(lat1) * Math.cos(lat2) * - Math.sin(dlon/2) * Math.sin(dlon/2); + Math.sin(deltalon/2) * Math.sin(deltalon/2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); return R * c; } From 8d51cabcb9e67928739650ac2e78a748d8e5be9d Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 27 Apr 2018 08:35:11 -0700 Subject: [PATCH 112/165] Track last ready subchannel index in RoundRobinSubchannelList. --- .../lb_policy/round_robin/round_robin.cc | 138 +++++++++--------- 1 file changed, 66 insertions(+), 72 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 764d2c8ad76..1b17cbdd985 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -162,11 +162,15 @@ class RoundRobin : public LoadBalancingPolicy { // subchannels in each state. void UpdateRoundRobinStateFromSubchannelStateCountsLocked(); + size_t GetNextReadySubchannelIndexLocked(); + void UpdateLastReadySubchannelIndexLocked(size_t last_ready_index); + private: size_t num_ready_ = 0; size_t num_connecting_ = 0; size_t num_transient_failure_ = 0; grpc_error* last_transient_failure_error_ = GRPC_ERROR_NONE; + size_t last_ready_index_ = -1; // Index into list of last pick. }; void ShutdownLocked() override; @@ -174,8 +178,6 @@ class RoundRobin : public LoadBalancingPolicy { void StartPickingLocked(); bool DoPickLocked(PickState* pick); void DrainPendingPicksLocked(); - size_t GetNextReadySubchannelIndexLocked(); - void UpdateLastReadySubchannelIndexLocked(size_t last_ready_index); /** list of subchannels */ OrphanablePtr subchannel_list_; @@ -193,8 +195,6 @@ class RoundRobin : public LoadBalancingPolicy { PickState* pending_picks_ = nullptr; /** our connectivity state tracker */ grpc_connectivity_state_tracker state_tracker_; - /** Index into subchannel_list_ for last pick. */ - size_t last_ready_subchannel_index_ = -1; }; RoundRobin::RoundRobin(const Args& args) : LoadBalancingPolicy(args) { @@ -220,68 +220,6 @@ RoundRobin::~RoundRobin() { grpc_subchannel_index_unref(); } -/** Returns the index into p->subchannel_list->subchannels of the next - * subchannel in READY state, or p->subchannel_list->num_subchannels if no - * subchannel is READY. - * - * Note that this function does *not* update p->last_ready_subchannel_index. - * The caller must do that if it returns a pick. */ -size_t RoundRobin::GetNextReadySubchannelIndexLocked() { - GPR_ASSERT(subchannel_list_ != nullptr); - if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_INFO, - "[RR %p] getting next ready subchannel (out of %" PRIuPTR - "), " - "last_ready_subchannel_index=%" PRIuPTR, - this, subchannel_list_->num_subchannels(), - last_ready_subchannel_index_); - } - for (size_t i = 0; i < subchannel_list_->num_subchannels(); ++i) { - const size_t index = (i + last_ready_subchannel_index_ + 1) % - subchannel_list_->num_subchannels(); - if (grpc_lb_round_robin_trace.enabled()) { - gpr_log( - GPR_INFO, - "[RR %p] checking subchannel %p, subchannel_list %p, index %" PRIuPTR - ": state=%s", - this, subchannel_list_->subchannel(index)->subchannel(), - subchannel_list_.get(), index, - grpc_connectivity_state_name( - subchannel_list_->subchannel(index)->connectivity_state())); - } - if (subchannel_list_->subchannel(index)->connectivity_state() == - GRPC_CHANNEL_READY) { - if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_INFO, - "[RR %p] found next ready subchannel (%p) at index %" PRIuPTR - " of subchannel_list %p", - this, subchannel_list_->subchannel(index)->subchannel(), index, - subchannel_list_.get()); - } - return index; - } - } - if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_INFO, "[RR %p] no subchannels in ready state", this); - } - return subchannel_list_->num_subchannels(); -} - -// Sets last_ready_subchannel_index_ to last_ready_index. -void RoundRobin::UpdateLastReadySubchannelIndexLocked(size_t last_ready_index) { - GPR_ASSERT(last_ready_index < subchannel_list_->num_subchannels()); - last_ready_subchannel_index_ = last_ready_index; - if (grpc_lb_round_robin_trace.enabled()) { - gpr_log(GPR_INFO, - "[RR %p] setting last_ready_subchannel_index=%" PRIuPTR - " (SC %p, CSC %p)", - this, last_ready_index, - subchannel_list_->subchannel(last_ready_index)->subchannel(), - subchannel_list_->subchannel(last_ready_index) - ->connected_subchannel()); - } -} - void RoundRobin::HandOffPendingPicksLocked(LoadBalancingPolicy* new_policy) { PickState* pick; while ((pick = pending_picks_) != nullptr) { @@ -366,7 +304,8 @@ void RoundRobin::ExitIdleLocked() { } bool RoundRobin::DoPickLocked(PickState* pick) { - const size_t next_ready_index = GetNextReadySubchannelIndexLocked(); + const size_t next_ready_index = + subchannel_list_->GetNextReadySubchannelIndexLocked(); if (next_ready_index < subchannel_list_->num_subchannels()) { /* readily available, report right away */ RoundRobinSubchannelData* sd = @@ -384,7 +323,7 @@ bool RoundRobin::DoPickLocked(PickState* pick) { sd->subchannel_list(), next_ready_index); } /* only advance the last picked pointer if the selection was used */ - UpdateLastReadySubchannelIndexLocked(next_ready_index); + subchannel_list_->UpdateLastReadySubchannelIndexLocked(next_ready_index); return true; } return false; @@ -511,7 +450,7 @@ void RoundRobin::RoundRobinSubchannelList:: // Promote this list to p->subchannel_list_. // This list must be p->latest_pending_subchannel_list_, because // any previous update would have been shut down already and - // therefore weeded out in ProcessConnectivityChangeLocked(). + // therefore we would not be receiving a notification for them. GPR_ASSERT(p->latest_pending_subchannel_list_.get() == this); GPR_ASSERT(!shutting_down()); if (grpc_lb_round_robin_trace.enabled()) { @@ -526,7 +465,6 @@ void RoundRobin::RoundRobinSubchannelList:: num_subchannels()); } p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); - p->last_ready_subchannel_index_ = -1; } // Drain pending picks. p->DrainPendingPicksLocked(); @@ -580,6 +518,62 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( RenewConnectivityWatchLocked(); } +/** Returns the index into p->subchannel_list->subchannels of the next + * subchannel in READY state, or p->subchannel_list->num_subchannels if no + * subchannel is READY. + * + * Note that this function does *not* update p->last_ready_subchannel_index. + * The caller must do that if it returns a pick. */ +size_t +RoundRobin::RoundRobinSubchannelList::GetNextReadySubchannelIndexLocked() { + if (grpc_lb_round_robin_trace.enabled()) { + gpr_log(GPR_INFO, + "[RR %p] getting next ready subchannel (out of %" PRIuPTR + "), last_ready_index=%" PRIuPTR, + policy(), num_subchannels(), last_ready_index_); + } + for (size_t i = 0; i < num_subchannels(); ++i) { + const size_t index = (i + last_ready_index_ + 1) % num_subchannels(); + if (grpc_lb_round_robin_trace.enabled()) { + gpr_log( + GPR_INFO, + "[RR %p] checking subchannel %p, subchannel_list %p, index %" PRIuPTR + ": state=%s", + policy(), subchannel(index)->subchannel(), this, index, + grpc_connectivity_state_name( + subchannel(index)->connectivity_state())); + } + if (subchannel(index)->connectivity_state() == GRPC_CHANNEL_READY) { + if (grpc_lb_round_robin_trace.enabled()) { + gpr_log(GPR_INFO, + "[RR %p] found next ready subchannel (%p) at index %" PRIuPTR + " of subchannel_list %p", + policy(), subchannel(index)->subchannel(), index, this); + } + return index; + } + } + if (grpc_lb_round_robin_trace.enabled()) { + gpr_log(GPR_INFO, "[RR %p] no subchannels in ready state", this); + } + return num_subchannels(); +} + +// Sets last_ready_index_ to last_ready_index. +void RoundRobin::RoundRobinSubchannelList::UpdateLastReadySubchannelIndexLocked( + size_t last_ready_index) { + GPR_ASSERT(last_ready_index < num_subchannels()); + last_ready_index_ = last_ready_index; + if (grpc_lb_round_robin_trace.enabled()) { + gpr_log(GPR_INFO, + "[RR %p] setting last_ready_subchannel_index=%" PRIuPTR + " (SC %p, CSC %p)", + policy(), last_ready_index, + subchannel(last_ready_index)->subchannel(), + subchannel(last_ready_index)->connected_subchannel()); + } +} + grpc_connectivity_state RoundRobin::CheckConnectivityLocked( grpc_error** error) { return grpc_connectivity_state_get(&state_tracker_, error); @@ -593,7 +587,8 @@ void RoundRobin::NotifyOnStateChangeLocked(grpc_connectivity_state* current, void RoundRobin::PingOneLocked(grpc_closure* on_initiate, grpc_closure* on_ack) { - const size_t next_ready_index = GetNextReadySubchannelIndexLocked(); + const size_t next_ready_index = + subchannel_list_->GetNextReadySubchannelIndexLocked(); if (next_ready_index < subchannel_list_->num_subchannels()) { RoundRobinSubchannelData* selected = subchannel_list_->subchannel(next_ready_index); @@ -648,7 +643,6 @@ void RoundRobin::UpdateLocked(const grpc_channel_args& args) { "rr_update_empty"); } subchannel_list_ = std::move(latest_pending_subchannel_list_); - last_ready_subchannel_index_ = -1; } else { // If we've started picking, start watching the new list. latest_pending_subchannel_list_->StartWatchingLocked(); From 310d87d5098e04e6c09420bd21d9d9c332e3efd0 Mon Sep 17 00:00:00 2001 From: jiangtaoli2016 Date: Fri, 27 Apr 2018 08:49:02 -0700 Subject: [PATCH 113/165] fix namespace of security_connector test functions --- .../security_connector/security_connector.cc | 12 ++++---- .../security_connector/security_connector.h | 6 ++-- test/core/security/security_connector_test.cc | 30 +++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/core/lib/security/security_connector/security_connector.cc b/src/core/lib/security/security_connector/security_connector.cc index b6c8d1e497c..6eae30a6e5d 100644 --- a/src/core/lib/security/security_connector/security_connector.cc +++ b/src/core/lib/security/security_connector/security_connector.cc @@ -805,7 +805,7 @@ int grpc_ssl_host_matches_name(const tsi_peer* peer, const char* peer_name) { return r; } -grpc_auth_context* tsi_ssl_peer_to_auth_context(const tsi_peer* peer) { +grpc_auth_context* grpc_ssl_peer_to_auth_context(const tsi_peer* peer) { size_t i; grpc_auth_context* ctx = nullptr; const char* peer_identity_property_name = nullptr; @@ -869,7 +869,7 @@ static grpc_error* ssl_check_peer(grpc_security_connector* sc, gpr_free(msg); return error; } - *auth_context = tsi_ssl_peer_to_auth_context(peer); + *auth_context = grpc_ssl_peer_to_auth_context(peer); return GRPC_ERROR_NONE; } @@ -927,7 +927,7 @@ static void add_shallow_auth_property_to_peer(tsi_peer* peer, tsi_prop->value.length = prop->value_length; } -tsi_peer tsi_shallow_peer_from_ssl_auth_context( +tsi_peer grpc_shallow_peer_from_ssl_auth_context( const grpc_auth_context* auth_context) { size_t max_num_props = 0; grpc_auth_property_iterator it; @@ -958,7 +958,7 @@ tsi_peer tsi_shallow_peer_from_ssl_auth_context( return peer; } -void tsi_shallow_peer_destruct(tsi_peer* peer) { +void grpc_shallow_peer_destruct(tsi_peer* peer) { if (peer->properties != nullptr) gpr_free(peer->properties); } @@ -970,7 +970,7 @@ static bool ssl_channel_check_call_host(grpc_channel_security_connector* sc, grpc_ssl_channel_security_connector* c = reinterpret_cast(sc); grpc_security_status status = GRPC_SECURITY_ERROR; - tsi_peer peer = tsi_shallow_peer_from_ssl_auth_context(auth_context); + tsi_peer peer = grpc_shallow_peer_from_ssl_auth_context(auth_context); if (grpc_ssl_host_matches_name(&peer, host)) status = GRPC_SECURITY_OK; /* If the target name was overridden, then the original target_name was 'checked' transitively during the previous peer check at the end of the @@ -983,7 +983,7 @@ static bool ssl_channel_check_call_host(grpc_channel_security_connector* sc, *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING( "call host does not match SSL server name"); } - tsi_shallow_peer_destruct(&peer); + grpc_shallow_peer_destruct(&peer); return true; } diff --git a/src/core/lib/security/security_connector/security_connector.h b/src/core/lib/security/security_connector/security_connector.h index f2d94d6f1c3..f9723166d02 100644 --- a/src/core/lib/security/security_connector/security_connector.h +++ b/src/core/lib/security/security_connector/security_connector.h @@ -239,10 +239,10 @@ const tsi_peer_property* tsi_peer_get_property_by_name(const tsi_peer* peer, const char* name); /* Exposed for testing only. */ -grpc_auth_context* tsi_ssl_peer_to_auth_context(const tsi_peer* peer); -tsi_peer tsi_shallow_peer_from_ssl_auth_context( +grpc_auth_context* grpc_ssl_peer_to_auth_context(const tsi_peer* peer); +tsi_peer grpc_shallow_peer_from_ssl_auth_context( const grpc_auth_context* auth_context); -void tsi_shallow_peer_destruct(tsi_peer* peer); +void grpc_shallow_peer_destruct(tsi_peer* peer); int grpc_ssl_host_matches_name(const tsi_peer* peer, const char* peer_name); /* --- Default SSL Root Store. --- */ diff --git a/test/core/security/security_connector_test.cc b/test/core/security/security_connector_test.cc index c78d2ae41f7..e4c3ace6b4a 100644 --- a/test/core/security/security_connector_test.cc +++ b/test/core/security/security_connector_test.cc @@ -87,15 +87,15 @@ static void test_unauthenticated_ssl_peer(void) { GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE, &peer.properties[0]) == TSI_OK); - ctx = tsi_ssl_peer_to_auth_context(&peer); + ctx = grpc_ssl_peer_to_auth_context(&peer); GPR_ASSERT(ctx != nullptr); GPR_ASSERT(!grpc_auth_context_peer_is_authenticated(ctx)); GPR_ASSERT(check_transport_security_type(ctx)); - rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx); + rpeer = grpc_shallow_peer_from_ssl_auth_context(ctx); GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer)); - tsi_shallow_peer_destruct(&rpeer); + grpc_shallow_peer_destruct(&rpeer); tsi_peer_destruct(&peer); GRPC_AUTH_CONTEXT_UNREF(ctx, "test"); } @@ -187,7 +187,7 @@ static void test_cn_only_ssl_peer_to_auth_context(void) { GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( TSI_X509_PEM_CERT_PROPERTY, expected_pem_cert, &peer.properties[2]) == TSI_OK); - ctx = tsi_ssl_peer_to_auth_context(&peer); + ctx = grpc_ssl_peer_to_auth_context(&peer); GPR_ASSERT(ctx != nullptr); GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx)); GPR_ASSERT(check_identity(ctx, GRPC_X509_CN_PROPERTY_NAME, &expected_cn, 1)); @@ -195,10 +195,10 @@ static void test_cn_only_ssl_peer_to_auth_context(void) { GPR_ASSERT(check_x509_cn(ctx, expected_cn)); GPR_ASSERT(check_x509_pem_cert(ctx, expected_pem_cert)); - rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx); + rpeer = grpc_shallow_peer_from_ssl_auth_context(ctx); GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer)); - tsi_shallow_peer_destruct(&rpeer); + grpc_shallow_peer_destruct(&rpeer); tsi_peer_destruct(&peer); GRPC_AUTH_CONTEXT_UNREF(ctx, "test"); } @@ -223,7 +223,7 @@ static void test_cn_and_one_san_ssl_peer_to_auth_context(void) { GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( TSI_X509_PEM_CERT_PROPERTY, expected_pem_cert, &peer.properties[3]) == TSI_OK); - ctx = tsi_ssl_peer_to_auth_context(&peer); + ctx = grpc_ssl_peer_to_auth_context(&peer); GPR_ASSERT(ctx != nullptr); GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx)); GPR_ASSERT( @@ -232,10 +232,10 @@ static void test_cn_and_one_san_ssl_peer_to_auth_context(void) { GPR_ASSERT(check_x509_cn(ctx, expected_cn)); GPR_ASSERT(check_x509_pem_cert(ctx, expected_pem_cert)); - rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx); + rpeer = grpc_shallow_peer_from_ssl_auth_context(ctx); GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer)); - tsi_shallow_peer_destruct(&rpeer); + grpc_shallow_peer_destruct(&rpeer); tsi_peer_destruct(&peer); GRPC_AUTH_CONTEXT_UNREF(ctx, "test"); } @@ -264,7 +264,7 @@ static void test_cn_and_multiple_sans_ssl_peer_to_auth_context(void) { TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, expected_sans[i], &peer.properties[3 + i]) == TSI_OK); } - ctx = tsi_ssl_peer_to_auth_context(&peer); + ctx = grpc_ssl_peer_to_auth_context(&peer); GPR_ASSERT(ctx != nullptr); GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx)); GPR_ASSERT(check_identity(ctx, GRPC_X509_SAN_PROPERTY_NAME, expected_sans, @@ -273,10 +273,10 @@ static void test_cn_and_multiple_sans_ssl_peer_to_auth_context(void) { GPR_ASSERT(check_x509_cn(ctx, expected_cn)); GPR_ASSERT(check_x509_pem_cert(ctx, expected_pem_cert)); - rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx); + rpeer = grpc_shallow_peer_from_ssl_auth_context(ctx); GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer)); - tsi_shallow_peer_destruct(&rpeer); + grpc_shallow_peer_destruct(&rpeer); tsi_peer_destruct(&peer); GRPC_AUTH_CONTEXT_UNREF(ctx, "test"); } @@ -310,7 +310,7 @@ static void test_cn_and_multiple_sans_and_others_ssl_peer_to_auth_context( TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, expected_sans[i], &peer.properties[5 + i]) == TSI_OK); } - ctx = tsi_ssl_peer_to_auth_context(&peer); + ctx = grpc_ssl_peer_to_auth_context(&peer); GPR_ASSERT(ctx != nullptr); GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx)); GPR_ASSERT(check_identity(ctx, GRPC_X509_SAN_PROPERTY_NAME, expected_sans, @@ -319,10 +319,10 @@ static void test_cn_and_multiple_sans_and_others_ssl_peer_to_auth_context( GPR_ASSERT(check_x509_cn(ctx, expected_cn)); GPR_ASSERT(check_x509_pem_cert(ctx, expected_pem_cert)); - rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx); + rpeer = grpc_shallow_peer_from_ssl_auth_context(ctx); GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer)); - tsi_shallow_peer_destruct(&rpeer); + grpc_shallow_peer_destruct(&rpeer); tsi_peer_destruct(&peer); GRPC_AUTH_CONTEXT_UNREF(ctx, "test"); } From beaf140ff71578e8b2e48b0a0bf788b903579c3f Mon Sep 17 00:00:00 2001 From: Juanli Shen Date: Fri, 27 Apr 2018 10:45:59 -0700 Subject: [PATCH 114/165] Update the kokoro build version in gcloud command --- tools/gce/create_windows_debug_worker.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/gce/create_windows_debug_worker.sh b/tools/gce/create_windows_debug_worker.sh index 6f903b58fe5..3829b71e190 100755 --- a/tools/gce/create_windows_debug_worker.sh +++ b/tools/gce/create_windows_debug_worker.sh @@ -49,7 +49,8 @@ gcloud compute instances create "$INSTANCE_NAME" \ --zone "$ZONE" \ --machine-type "$MACHINE_TYPE" \ --image-project google.com:kokoro \ - --image kokoro-win7build-v9-prod-debug \ + # The version might need updating. + --image kokoro-win7build-v11-prod-debug \ --boot-disk-size 500 \ --boot-disk-type pd-ssd \ --tags=allow-ssh \ From d0bb3c88c8dde755f83cc51059996ad8396c82aa Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 27 Apr 2018 10:47:55 -0700 Subject: [PATCH 115/165] Remove SetConnectedSubchannelFromLocked(). --- .../lb_policy/pick_first/pick_first.cc | 27 +++++++++++-------- .../lb_policy/subchannel_list.h | 14 ---------- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 1fecdebccf2..2d9e4af96cc 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -332,18 +332,23 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { this, selected_->subchannel(), i, subchannel_list->num_subchannels()); } - if (selected_->connected_subchannel() != nullptr) { - sd->SetConnectedSubchannelFromLocked(selected_); + // Make sure it's in state READY. It might not be if we grabbed + // the combiner while a connectivity state notification + // informing us otherwise is pending. + // Note that CheckConnectivityStateLocked() also takes a ref to + // the connected subchannel. + grpc_error* error = GRPC_ERROR_NONE; + if (sd->CheckConnectivityStateLocked(&error) == GRPC_CHANNEL_READY) { + selected_ = sd; + subchannel_list_ = std::move(subchannel_list); + DestroyUnselectedSubchannelsLocked(); + sd->StartConnectivityWatchLocked(); + // If there was a previously pending update (which may or may + // not have contained the currently selected subchannel), drop + // it, so that it doesn't override what we've done here. + latest_pending_subchannel_list_.reset(); + return; } - selected_ = sd; - subchannel_list_ = std::move(subchannel_list); - DestroyUnselectedSubchannelsLocked(); - sd->StartConnectivityWatchLocked(); - // If there was a previously pending update (which may or may - // not have contained the currently selected subchannel), drop - // it, so that it doesn't override what we've done here. - latest_pending_subchannel_list_.reset(); - return; } } // Not keeping the previous selected subchannel, so set the latest diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index bad50c461cc..276a2f08a1b 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -89,20 +89,6 @@ class SubchannelData { return connected_subchannel_.get(); } -// FIXME: remove - // Used to set the connected subchannel in cases where we are retaining a - // subchannel from a previous subchannel list. This is slightly more - // efficient than getting the connected subchannel from the subchannel, - // because that approach requires the use of a mutex, whereas this one - // only mutates a refcount. - // TODO(roth): This method is a bit of a hack and is used only in - // pick_first. When we have time, find a way to remove this, possibly - // by making pick_first work more like round_robin. - void SetConnectedSubchannelFromLocked(SubchannelData* other) { - GPR_ASSERT(subchannel_ == other->subchannel_); - connected_subchannel_ = other->connected_subchannel_; // Adds ref. - } - // Synchronously checks the subchannel's connectivity state. // Must not be called while there is a connectivity notification // pending (i.e., between calling StartConnectivityWatchLocked() or From 771385789b3978932afeefcec204a32ba04a89e0 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Fri, 27 Apr 2018 10:53:16 -0700 Subject: [PATCH 116/165] Dont use benchmark counters --- test/cpp/microbenchmarks/helpers.cc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/cpp/microbenchmarks/helpers.cc b/test/cpp/microbenchmarks/helpers.cc index e4a31f50a97..e4ba37e2d6a 100644 --- a/test/cpp/microbenchmarks/helpers.cc +++ b/test/cpp/microbenchmarks/helpers.cc @@ -48,16 +48,10 @@ void TrackCounters::AddToLabel(std::ostream& out, benchmark::State& state) { static_cast(state.iterations())); } for (int i = 0; i < GRPC_STATS_HISTOGRAM_COUNT; i++) { - std::ostringstream median_ss; - median_ss << grpc_stats_histogram_name[i] << "-median"; - state.counters[median_ss.str()] = - benchmark::Counter(grpc_stats_histo_percentile( - &stats, static_cast(i), 50.0)); - std::ostringstream tail_ss; - tail_ss << grpc_stats_histogram_name[i] << "-99p"; - state.counters[tail_ss.str()] = - benchmark::Counter(grpc_stats_histo_percentile( - &stats, static_cast(i), 99.0)); + out << " " << grpc_stats_histogram_name[i] << "-median:" + << grpc_stats_histo_percentile(&stats, (grpc_stats_histograms)i, 50.0) + << " " << grpc_stats_histogram_name[i] << "-99p:" + << grpc_stats_histo_percentile(&stats, (grpc_stats_histograms)i, 99.0); } #ifdef GPR_LOW_LEVEL_COUNTERS grpc_memory_counters counters_at_end = grpc_memory_counters_snapshot(); From 7d92def91561fba72d235281e832c3b2fa208bb0 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 27 Apr 2018 11:26:08 -0700 Subject: [PATCH 117/165] clang-format --- .../lb_policy/pick_first/pick_first.cc | 6 ++-- .../lb_policy/subchannel_list.h | 30 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 2d9e4af96cc..f820316d6b2 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -384,9 +384,9 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( "), subchannel_list %p: state=%s p->shutdown_=%d " "sd->subchannel_list->shutting_down=%d error=%s", p, subchannel(), Index(), subchannel_list()->num_subchannels(), - subchannel_list(), - grpc_connectivity_state_name(connectivity_state), p->shutdown_, - subchannel_list()->shutting_down(), grpc_error_string(error)); + subchannel_list(), grpc_connectivity_state_name(connectivity_state), + p->shutdown_, subchannel_list()->shutting_down(), + grpc_error_string(error)); } // The notification must be for a subchannel in either the current or // latest pending subchannel lists. diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index 276a2f08a1b..7e2046bcdc0 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -358,8 +358,8 @@ void SubchannelData:: } template -bool SubchannelData:: - UpdateConnectedSubchannelLocked() { +bool SubchannelData::UpdateConnectedSubchannelLocked() { // If the subchannel is READY, take a ref to the connected subchannel. if (pending_connectivity_state_unsafe_ == GRPC_CHANNEL_READY) { connected_subchannel_ = @@ -381,9 +381,9 @@ bool SubchannelData:: "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR " (subchannel %p): state is READY but connected subchannel is " "null; moving to state IDLE", - subchannel_list_->tracer()->name(), - subchannel_list_->policy(), subchannel_list_, Index(), - subchannel_list_->num_subchannels(), subchannel_); + subchannel_list_->tracer()->name(), subchannel_list_->policy(), + subchannel_list_, Index(), subchannel_list_->num_subchannels(), + subchannel_); } pending_connectivity_state_unsafe_ = GRPC_CHANNEL_IDLE; return false; @@ -400,16 +400,16 @@ void SubchannelData:: OnConnectivityChangedLocked(void* arg, grpc_error* error) { SubchannelData* sd = static_cast(arg); if (sd->subchannel_list_->tracer()->enabled()) { - gpr_log(GPR_INFO, - "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR - " (subchannel %p): connectivity changed: state=%s, error=%s, " - "shutting_down=%d", - sd->subchannel_list_->tracer()->name(), - sd->subchannel_list_->policy(), sd->subchannel_list_, sd->Index(), - sd->subchannel_list_->num_subchannels(), sd->subchannel_, - grpc_connectivity_state_name( - sd->pending_connectivity_state_unsafe_), - grpc_error_string(error), sd->subchannel_list_->shutting_down()); + gpr_log( + GPR_INFO, + "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR + " (subchannel %p): connectivity changed: state=%s, error=%s, " + "shutting_down=%d", + sd->subchannel_list_->tracer()->name(), sd->subchannel_list_->policy(), + sd->subchannel_list_, sd->Index(), + sd->subchannel_list_->num_subchannels(), sd->subchannel_, + grpc_connectivity_state_name(sd->pending_connectivity_state_unsafe_), + grpc_error_string(error), sd->subchannel_list_->shutting_down()); } // If shutting down, unref subchannel and stop watching. if (sd->subchannel_list_->shutting_down() || error == GRPC_ERROR_CANCELLED) { From 99e910f58fa54e9bce2518c6f9752ba1e8dbd6af Mon Sep 17 00:00:00 2001 From: ncteisen Date: Fri, 27 Apr 2018 11:34:50 -0700 Subject: [PATCH 118/165] Stop tracking call size in bm diff --- tools/profiling/microbenchmarks/bm_diff/bm_constants.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_constants.py b/tools/profiling/microbenchmarks/bm_diff/bm_constants.py index 5719e426204..c8b6c1ebd05 100644 --- a/tools/profiling/microbenchmarks/bm_diff/bm_constants.py +++ b/tools/profiling/microbenchmarks/bm_diff/bm_constants.py @@ -22,11 +22,10 @@ _AVAILABLE_BENCHMARK_TESTS = [ 'bm_metadata', 'bm_fullstack_trickle' ] -_INTERESTING = ('cpu_time', 'real_time', 'call_initial_size-median', - 'locks_per_iteration', 'allocs_per_iteration', - 'writes_per_iteration', 'atm_cas_per_iteration', - 'atm_add_per_iteration', 'nows_per_iteration', - 'cli_transport_stalls_per_iteration', +_INTERESTING = ('cpu_time', 'real_time', 'locks_per_iteration', + 'allocs_per_iteration', 'writes_per_iteration', + 'atm_cas_per_iteration', 'atm_add_per_iteration', + 'nows_per_iteration', 'cli_transport_stalls_per_iteration', 'cli_stream_stalls_per_iteration', 'svr_transport_stalls_per_iteration', 'svr_stream_stalls_per_iteration', From d143bc345ed9caebcec88c1cda9729198ae97a4c Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 27 Apr 2018 11:44:07 -0700 Subject: [PATCH 119/165] Improve trace logging. --- .../lb_policy/pick_first/pick_first.cc | 28 +++++++++++-------- .../lb_policy/round_robin/round_robin.cc | 22 +++++++-------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index f820316d6b2..4db28fb18ca 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -377,27 +377,26 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( grpc_connectivity_state connectivity_state, grpc_error* error) { PickFirst* p = static_cast(subchannel_list()->policy()); - if (grpc_lb_pick_first_trace.enabled()) { - gpr_log(GPR_INFO, - "Pick First %p connectivity changed for subchannel %p (%" PRIuPTR - " of %" PRIuPTR - "), subchannel_list %p: state=%s p->shutdown_=%d " - "sd->subchannel_list->shutting_down=%d error=%s", - p, subchannel(), Index(), subchannel_list()->num_subchannels(), - subchannel_list(), grpc_connectivity_state_name(connectivity_state), - p->shutdown_, subchannel_list()->shutting_down(), - grpc_error_string(error)); - } // The notification must be for a subchannel in either the current or // latest pending subchannel lists. GPR_ASSERT(subchannel_list() == p->subchannel_list_.get() || subchannel_list() == p->latest_pending_subchannel_list_.get()); // Handle updates for the currently selected subchannel. if (p->selected_ == this) { + if (grpc_lb_pick_first_trace.enabled()) { + gpr_log(GPR_INFO, + "Pick First %p connectivity changed for selected subchannel", p); + } // If the new state is anything other than READY and there is a // pending update, switch to the pending update. if (connectivity_state != GRPC_CHANNEL_READY && p->latest_pending_subchannel_list_ != nullptr) { + if (grpc_lb_pick_first_trace.enabled()) { + gpr_log(GPR_INFO, + "Pick First %p promoting pending subchannel list %p to " + "replace %p", p, p->latest_pending_subchannel_list_.get(), + p->subchannel_list_.get()); + } p->selected_ = nullptr; StopConnectivityWatchLocked(); p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); @@ -446,7 +445,12 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( // Case 2. Promote p->latest_pending_subchannel_list_ to // p->subchannel_list_. if (subchannel_list() == p->latest_pending_subchannel_list_.get()) { - GPR_ASSERT(p->subchannel_list_ != nullptr); + if (grpc_lb_pick_first_trace.enabled()) { + gpr_log(GPR_INFO, + "Pick First %p promoting pending subchannel list %p to " + "replace %p", p, p->latest_pending_subchannel_list_.get(), + p->subchannel_list_.get()); + } p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); } // Cases 1 and 2. diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 1b17cbdd985..9d4f2842d16 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -475,27 +475,25 @@ void RoundRobin::RoundRobinSubchannelList:: void RoundRobin::RoundRobinSubchannelData::UpdateConnectivityStateLocked( grpc_connectivity_state connectivity_state, grpc_error* error) { - subchannel_list()->UpdateStateCountersLocked( - last_connectivity_state_, connectivity_state, GRPC_ERROR_REF(error)); - last_connectivity_state_ = connectivity_state; -} - -void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( - grpc_connectivity_state connectivity_state, grpc_error* error) { RoundRobin* p = static_cast(subchannel_list()->policy()); if (grpc_lb_round_robin_trace.enabled()) { gpr_log( GPR_INFO, "[RR %p] connectivity changed for subchannel %p, subchannel_list %p " - "(index %" PRIuPTR " of %" PRIuPTR - "): prev_state=%s new_state=%s " - "p->shutdown=%d sd->subchannel_list->shutting_down=%d error=%s", + "(index %" PRIuPTR " of %" PRIuPTR "): prev_state=%s new_state=%s", p, subchannel(), subchannel_list(), Index(), subchannel_list()->num_subchannels(), grpc_connectivity_state_name(last_connectivity_state_), - grpc_connectivity_state_name(connectivity_state), p->shutdown_, - subchannel_list()->shutting_down(), grpc_error_string(error)); + grpc_connectivity_state_name(connectivity_state)); } + subchannel_list()->UpdateStateCountersLocked( + last_connectivity_state_, connectivity_state, GRPC_ERROR_REF(error)); + last_connectivity_state_ = connectivity_state; +} + +void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( + grpc_connectivity_state connectivity_state, grpc_error* error) { + RoundRobin* p = static_cast(subchannel_list()->policy()); GPR_ASSERT(subchannel() != nullptr); // If the new state is TRANSIENT_FAILURE, re-resolve. // Only do this if we've started watching, not at startup time. From a25ece9f6a98721f6bc983de4c376d9766d36ae3 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 27 Apr 2018 11:48:27 -0700 Subject: [PATCH 120/165] Fix error refcounting bug. --- .../client_channel/lb_policy/round_robin/round_robin.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 9d4f2842d16..ba9d9af438a 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -486,8 +486,8 @@ void RoundRobin::RoundRobinSubchannelData::UpdateConnectivityStateLocked( grpc_connectivity_state_name(last_connectivity_state_), grpc_connectivity_state_name(connectivity_state)); } - subchannel_list()->UpdateStateCountersLocked( - last_connectivity_state_, connectivity_state, GRPC_ERROR_REF(error)); + subchannel_list()->UpdateStateCountersLocked(last_connectivity_state_, + connectivity_state, error); last_connectivity_state_ = connectivity_state; } From 7e1687b3ef79d8213cff6a0df66d33b01013c9ad Mon Sep 17 00:00:00 2001 From: Alexander Polcyn Date: Fri, 27 Apr 2018 18:30:12 -0700 Subject: [PATCH 121/165] address comment --- third_party/address_sorting/address_sorting.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/third_party/address_sorting/address_sorting.c b/third_party/address_sorting/address_sorting.c index 6aa1f994e38..e4f3b537992 100644 --- a/third_party/address_sorting/address_sorting.c +++ b/third_party/address_sorting/address_sorting.c @@ -225,15 +225,15 @@ static int compare_source_addr_exists(const address_sorting_sortable* first, static int compare_source_dest_scope_matches( const address_sorting_sortable* first, const address_sorting_sortable* second) { - int first_src_dst_scope_matches = 0; + bool first_src_dst_scope_matches = false; if (sockaddr_get_scope(&first->dest_addr) == sockaddr_get_scope(&first->source_addr)) { - first_src_dst_scope_matches = 1; + first_src_dst_scope_matches = true; } - int second_src_dst_scope_matches = 0; + bool second_src_dst_scope_matches = false; if (sockaddr_get_scope(&second->dest_addr) == sockaddr_get_scope(&second->source_addr)) { - second_src_dst_scope_matches = 1; + second_src_dst_scope_matches = true; } if (first_src_dst_scope_matches != second_src_dst_scope_matches) { return first_src_dst_scope_matches ? -1 : 1; @@ -244,15 +244,15 @@ static int compare_source_dest_scope_matches( static int compare_source_dest_labels_match( const address_sorting_sortable* first, const address_sorting_sortable* second) { - int first_label_matches = 0; + bool first_label_matches = false; if (get_label_value(&first->dest_addr) == get_label_value(&first->source_addr)) { - first_label_matches = 1; + first_label_matches = true; } - int second_label_matches = 0; + bool second_label_matches = false; if (get_label_value(&second->dest_addr) == get_label_value(&second->source_addr)) { - second_label_matches = 1; + second_label_matches = true; } if (first_label_matches != second_label_matches) { return first_label_matches ? -1 : 1; From 423ae6d013f0df1295db035faa200f8696344d8a Mon Sep 17 00:00:00 2001 From: Ben Sykes Date: Sat, 28 Apr 2018 17:37:23 -0700 Subject: [PATCH 122/165] Switch to Buffer.from to avoid using deprecated constructor --- src/compiler/node_generator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/node_generator.cc b/src/compiler/node_generator.cc index 661587cbd63..dbc7eefb391 100644 --- a/src/compiler/node_generator.cc +++ b/src/compiler/node_generator.cc @@ -134,7 +134,7 @@ void PrintMessageTransformer(const Descriptor* descriptor, Printer* out) { "throw new Error('Expected argument of type $name$');\n"); out->Outdent(); out->Print("}\n"); - out->Print("return new Buffer(arg.serializeBinary());\n"); + out->Print("return Buffer.from(arg.serializeBinary());\n"); out->Outdent(); out->Print("}\n\n"); From 56c32ccb237afa349d1826e4379b0e32c8bc8a72 Mon Sep 17 00:00:00 2001 From: Hope Casey-Allen Date: Sun, 29 Apr 2018 20:28:37 -0700 Subject: [PATCH 123/165] Fix typos in GPR_TIMER_SCOPE --- src/core/lib/iomgr/tcp_posix.cc | 2 +- src/core/lib/surface/call.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index fc2b94d693a..153be05e83c 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -371,7 +371,7 @@ static void call_read_cb(grpc_tcp* tcp, grpc_error* error) { #define MAX_READ_IOVEC 4 static void tcp_do_read(grpc_tcp* tcp) { - GPR_TIMER_SCOPE("tcp_continue_read", 0); + GPR_TIMER_SCOPE("tcp_do_read", 0); struct msghdr msg; struct iovec iov[MAX_READ_IOVEC]; ssize_t read_bytes; diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index 0a732bed838..da488034ca9 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -610,7 +610,7 @@ grpc_call_error grpc_call_cancel(grpc_call* call, void* reserved) { // This is called via the call combiner to start sending a batch down // the filter stack. static void execute_batch_in_call_combiner(void* arg, grpc_error* ignored) { - GPR_TIMER_SCOPE("execute_batch", 0); + GPR_TIMER_SCOPE("execute_batch_in_call_combiner", 0); grpc_transport_stream_op_batch* batch = static_cast(arg); grpc_call* call = static_cast(batch->handler_private.extra_arg); @@ -1539,7 +1539,7 @@ static void free_no_op_completion(void* p, grpc_cq_completion* completion) { static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops, size_t nops, void* notify_tag, int is_notify_tag_closure) { - GPR_TIMER_SCOPE("grpc_call_start_batch", 0); + GPR_TIMER_SCOPE("call_start_batch", 0); size_t i; const grpc_op* op; From 6bc4b2fa991fe0ad05d186a1a6b37b07adfb7351 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Mon, 30 Apr 2018 22:28:20 +0800 Subject: [PATCH 124/165] php: complete todo --- src/php/ext/grpc/php7_wrapper.h | 7 +++++ src/php/ext/grpc/server.c | 37 ++++++++----------------- src/php/tests/unit_tests/ServerTest.php | 18 ++++++++++++ 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index d4fa859249e..0239e04f761 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -30,6 +30,8 @@ add_property_string(arg, name, context, b) #define php_grpc_add_property_stringl(res, name, str, len, b) \ add_property_stringl(res, name, str, len, b) +#define php_grpc_add_property_zval(res, name, val) \ + add_property_zval(res, name, val) #define php_grpc_add_next_index_stringl(data, str, len, b) \ add_next_index_stringl(data, str, len, b) @@ -154,6 +156,11 @@ static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, add_property_string(arg, name, context) #define php_grpc_add_property_stringl(res, name, str, len, b) \ add_property_stringl(res, name, str, len) +#define php_grpc_add_property_zval(res, name, val) do { \ + zval tmp; \ + tmp = *val; \ + add_property_zval(res, name, &tmp); \ + } while(0) #define php_grpc_add_next_index_stringl(data, str, len, b) \ add_next_index_stringl(data, str, len) diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index a65d233017b..292d512e378 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -89,8 +89,6 @@ PHP_METHOD(Server, __construct) { if (args_array == NULL) { server->wrapped = grpc_server_create(NULL, NULL); } else { - //TODO(thinkerou): deal it if key of array is long, crash now on php7 - // and update unit test case php_grpc_read_args_array(args_array, &args TSRMLS_CC); server->wrapped = grpc_server_create(&args, NULL); efree(args.args); @@ -118,8 +116,8 @@ PHP_METHOD(Server, requestCall) { grpc_call_details_init(&details); grpc_metadata_array_init(&metadata); error_code = - grpc_server_request_call(server->wrapped, &call, &details, &metadata, - completion_queue, completion_queue, NULL); + grpc_server_request_call(server->wrapped, &call, &details, &metadata, + completion_queue, completion_queue, NULL); if (error_code != GRPC_CALL_OK) { zend_throw_exception(spl_ce_LogicException, "request_call failed", (long)error_code TSRMLS_CC); @@ -140,25 +138,12 @@ PHP_METHOD(Server, requestCall) { php_grpc_add_property_string(result, "host", host_text, true); gpr_free(method_text); gpr_free(host_text); -#if PHP_MAJOR_VERSION < 7 - add_property_zval(result, "call", grpc_php_wrap_call(call, true TSRMLS_CC)); - add_property_zval(result, "absolute_deadline", - grpc_php_wrap_timeval(details.deadline TSRMLS_CC)); - add_property_zval(result, "metadata", grpc_parse_metadata_array(&metadata - TSRMLS_CC)); -#else - zval zv_call; - zval zv_timeval; - zval zv_md; - //TODO(thinkerou): why use zval* to unit test error? - zv_call = *grpc_php_wrap_call(call, true); - zv_timeval = *grpc_php_wrap_timeval(details.deadline); - zv_md = *grpc_parse_metadata_array(&metadata); - - add_property_zval(result, "call", &zv_call); - add_property_zval(result, "absolute_deadline", &zv_timeval); - add_property_zval(result, "metadata", &zv_md); -#endif + php_grpc_add_property_zval(result, "call", + grpc_php_wrap_call(call, true TSRMLS_CC)); + php_grpc_add_property_zval(result, "absolute_deadline", + grpc_php_wrap_timeval(details.deadline TSRMLS_CC)); + php_grpc_add_property_zval(result, "metadata", + grpc_parse_metadata_array(&metadata TSRMLS_CC)); cleanup: grpc_call_details_destroy(&details); @@ -202,9 +187,9 @@ PHP_METHOD(Server, addSecureHttp2Port) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO", &addr, &addr_len, &creds_obj, grpc_ce_server_credentials) == FAILURE) { - zend_throw_exception( - spl_ce_InvalidArgumentException, - "add_http2_port expects a string and a ServerCredentials", 1 TSRMLS_CC); + zend_throw_exception(spl_ce_InvalidArgumentException, + "add_http2_port expects a string and a " + "ServerCredentials", 1 TSRMLS_CC); return; } wrapped_grpc_server_credentials *creds = diff --git a/src/php/tests/unit_tests/ServerTest.php b/src/php/tests/unit_tests/ServerTest.php index fee9f1e6448..ac6f2f03123 100644 --- a/src/php/tests/unit_tests/ServerTest.php +++ b/src/php/tests/unit_tests/ServerTest.php @@ -96,6 +96,24 @@ class ServerTest extends PHPUnit_Framework_TestCase $this->assertNull($this->server); } + /** + * @expectedException InvalidArgumentException + */ + public function testInvalidConstructorWithNumKeyOfArray() + { + $this->server = new Grpc\Server([10 => '127.0.0.1', + 20 => '8080', ]); + $this->assertNull($this->server); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testInvalidConstructorWithList() + { + $this->server = new Grpc\Server(['127.0.0.1', '8080']); + $this->assertNull($this->server); + } /** * @expectedException InvalidArgumentException */ From 3ffb8d5c4d1a2a56b157a16956b3c7c7d0e1d3ba Mon Sep 17 00:00:00 2001 From: Juanli Shen Date: Mon, 30 Apr 2018 10:41:46 -0700 Subject: [PATCH 125/165] Don't resolve if there is a resolution timer --- .../resolver/dns/c_ares/dns_resolver_ares.cc | 30 +++-- .../resolver/dns/native/dns_resolver.cc | 30 +++-- .../resolvers/dns_resolver_cooldown_test.cc | 115 ++++++++++-------- 3 files changed, 101 insertions(+), 74 deletions(-) diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc index 6ac9a776358..c3c62b60bfe 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -363,6 +363,15 @@ void AresDnsResolver::OnResolvedLocked(void* arg, grpc_error* error) { } void AresDnsResolver::MaybeStartResolvingLocked() { + // If there is an existing timer, the time it fires is the earliest time we + // can start the next resolution. + if (have_next_resolution_timer_) { + // TODO(dgq): remove the following two lines once Pick First stops + // discarding subchannels after selecting. + ++resolved_version_; + MaybeFinishNextLocked(); + return; + } if (last_resolution_timestamp_ >= 0) { const grpc_millis earliest_next_resolution = last_resolution_timestamp_ + min_time_between_resolutions_; @@ -375,17 +384,15 @@ void AresDnsResolver::MaybeStartResolvingLocked() { "In cooldown from last resolution (from %" PRIdPTR " ms ago). Will resolve again in %" PRIdPTR " ms", last_resolution_ago, ms_until_next_resolution); - if (!have_next_resolution_timer_) { - have_next_resolution_timer_ = true; - // TODO(roth): We currently deal with this ref manually. Once the - // new closure API is done, find a way to track this ref with the timer - // callback as part of the type system. - RefCountedPtr self = - Ref(DEBUG_LOCATION, "next_resolution_timer_cooldown"); - self.release(); - grpc_timer_init(&next_resolution_timer_, ms_until_next_resolution, - &on_next_resolution_); - } + have_next_resolution_timer_ = true; + // TODO(roth): We currently deal with this ref manually. Once the + // new closure API is done, find a way to track this ref with the timer + // callback as part of the type system. + RefCountedPtr self = + Ref(DEBUG_LOCATION, "next_resolution_timer_cooldown"); + self.release(); + grpc_timer_init(&next_resolution_timer_, ms_until_next_resolution, + &on_next_resolution_); // TODO(dgq): remove the following two lines once Pick First stops // discarding subchannels after selecting. ++resolved_version_; @@ -397,6 +404,7 @@ void AresDnsResolver::MaybeStartResolvingLocked() { } void AresDnsResolver::StartResolvingLocked() { + gpr_log(GPR_DEBUG, "Start resolving."); // TODO(roth): We currently deal with this ref manually. Once the // new closure API is done, find a way to track this ref with the timer // callback as part of the type system. diff --git a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc index fbab136421f..e7842a79513 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc @@ -236,6 +236,15 @@ void NativeDnsResolver::OnResolvedLocked(void* arg, grpc_error* error) { } void NativeDnsResolver::MaybeStartResolvingLocked() { + // If there is an existing timer, the time it fires is the earliest time we + // can start the next resolution. + if (have_next_resolution_timer_) { + // TODO(dgq): remove the following two lines once Pick First stops + // discarding subchannels after selecting. + ++resolved_version_; + MaybeFinishNextLocked(); + return; + } if (last_resolution_timestamp_ >= 0) { const grpc_millis earliest_next_resolution = last_resolution_timestamp_ + min_time_between_resolutions_; @@ -248,17 +257,15 @@ void NativeDnsResolver::MaybeStartResolvingLocked() { "In cooldown from last resolution (from %" PRIdPTR " ms ago). Will resolve again in %" PRIdPTR " ms", last_resolution_ago, ms_until_next_resolution); - if (!have_next_resolution_timer_) { - have_next_resolution_timer_ = true; - // TODO(roth): We currently deal with this ref manually. Once the - // new closure API is done, find a way to track this ref with the timer - // callback as part of the type system. - RefCountedPtr self = - Ref(DEBUG_LOCATION, "next_resolution_timer_cooldown"); - self.release(); - grpc_timer_init(&next_resolution_timer_, ms_until_next_resolution, - &on_next_resolution_); - } + have_next_resolution_timer_ = true; + // TODO(roth): We currently deal with this ref manually. Once the + // new closure API is done, find a way to track this ref with the timer + // callback as part of the type system. + RefCountedPtr self = + Ref(DEBUG_LOCATION, "next_resolution_timer_cooldown"); + self.release(); + grpc_timer_init(&next_resolution_timer_, ms_until_next_resolution, + &on_next_resolution_); // TODO(dgq): remove the following two lines once Pick First stops // discarding subchannels after selecting. ++resolved_version_; @@ -270,6 +277,7 @@ void NativeDnsResolver::MaybeStartResolvingLocked() { } void NativeDnsResolver::StartResolvingLocked() { + gpr_log(GPR_DEBUG, "Start resolving."); // TODO(roth): We currently deal with this ref manually. Once the // new closure API is done, find a way to track this ref with the timer // callback as part of the type system. diff --git a/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc b/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc index 01c61a9f186..37e1d714ca9 100644 --- a/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc +++ b/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc @@ -145,7 +145,6 @@ struct OnResolutionCallbackArg { grpc_core::OrphanablePtr resolver; grpc_channel_args* result = nullptr; grpc_millis delay_before_second_resolution = 0; - bool using_cares = false; }; // Counter for the number of times a resolution notification callback has been @@ -155,81 +154,100 @@ static int g_on_resolution_invocations_count; // Set to true by the last callback in the resolution chain. bool g_all_callbacks_invoked; -void on_third_resolution(void* arg, grpc_error* error) { +void on_fourth_resolution(void* arg, grpc_error* error) { OnResolutionCallbackArg* cb_arg = static_cast(arg); + grpc_channel_args_destroy(cb_arg->result); GPR_ASSERT(error == GRPC_ERROR_NONE); ++g_on_resolution_invocations_count; - grpc_channel_args_destroy(cb_arg->result); gpr_log(GPR_INFO, - "3rd: g_on_resolution_invocations_count: %d, g_resolution_count: %d", + "4th: g_on_resolution_invocations_count: %d, g_resolution_count: %d", g_on_resolution_invocations_count, g_resolution_count); // In this case we expect to have incurred in another system-level resolution - // because on_second_resolution slept for longer than the min resolution + // because on_third_resolution slept for longer than the min resolution // period. - GPR_ASSERT(g_on_resolution_invocations_count == 3); - GPR_ASSERT(g_resolution_count == 2); + GPR_ASSERT(g_on_resolution_invocations_count == 4); + GPR_ASSERT(g_resolution_count == 3); cb_arg->resolver.reset(); - if (cb_arg->using_cares) { - gpr_atm_rel_store(&g_iomgr_args.done_atm, 1); - gpr_mu_lock(g_iomgr_args.mu); - GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(g_iomgr_args.pollset, nullptr)); - gpr_mu_unlock(g_iomgr_args.mu); - } + gpr_atm_rel_store(&g_iomgr_args.done_atm, 1); + gpr_mu_lock(g_iomgr_args.mu); + GRPC_LOG_IF_ERROR("pollset_kick", + grpc_pollset_kick(g_iomgr_args.pollset, nullptr)); + gpr_mu_unlock(g_iomgr_args.mu); grpc_core::Delete(cb_arg); g_all_callbacks_invoked = true; } -void on_second_resolution(void* arg, grpc_error* error) { +void on_third_resolution(void* arg, grpc_error* error) { OnResolutionCallbackArg* cb_arg = static_cast(arg); - ++g_on_resolution_invocations_count; grpc_channel_args_destroy(cb_arg->result); + GPR_ASSERT(error == GRPC_ERROR_NONE); + ++g_on_resolution_invocations_count; + gpr_log(GPR_INFO, + "3rd: g_on_resolution_invocations_count: %d, g_resolution_count: %d", + g_on_resolution_invocations_count, g_resolution_count); + // The timer set because of the previous re-resolution request fires, so a new + // system-level resolution happened. + GPR_ASSERT(g_on_resolution_invocations_count == 3); + GPR_ASSERT(g_resolution_count == 2); + grpc_core::ExecCtx::Get()->TestOnlySetNow( + cb_arg->delay_before_second_resolution * 2); + cb_arg->resolver->NextLocked( + &cb_arg->result, + GRPC_CLOSURE_CREATE(on_fourth_resolution, arg, + grpc_combiner_scheduler(g_combiner))); + cb_arg->resolver->RequestReresolutionLocked(); + gpr_mu_lock(g_iomgr_args.mu); + GRPC_LOG_IF_ERROR("pollset_kick", + grpc_pollset_kick(g_iomgr_args.pollset, nullptr)); + gpr_mu_unlock(g_iomgr_args.mu); +} +void on_second_resolution(void* arg, grpc_error* error) { + OnResolutionCallbackArg* cb_arg = static_cast(arg); + grpc_channel_args_destroy(cb_arg->result); + GPR_ASSERT(error == GRPC_ERROR_NONE); + ++g_on_resolution_invocations_count; gpr_log(GPR_INFO, "2nd: g_on_resolution_invocations_count: %d, g_resolution_count: %d", g_on_resolution_invocations_count, g_resolution_count); // The resolution request for which this function is the callback happened // before the min resolution period. Therefore, no new system-level - // resolutions happened, as indicated by g_resolution_count. + // resolutions happened, as indicated by g_resolution_count. But a resolution + // timer was set to fire when the cooldown finishes. GPR_ASSERT(g_on_resolution_invocations_count == 2); GPR_ASSERT(g_resolution_count == 1); - grpc_core::ExecCtx::Get()->TestOnlySetNow( - cb_arg->delay_before_second_resolution * 2); + // Register a new callback to capture the timer firing. cb_arg->resolver->NextLocked( &cb_arg->result, GRPC_CLOSURE_CREATE(on_third_resolution, arg, grpc_combiner_scheduler(g_combiner))); - cb_arg->resolver->RequestReresolutionLocked(); - if (cb_arg->using_cares) { - gpr_mu_lock(g_iomgr_args.mu); - GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(g_iomgr_args.pollset, nullptr)); - gpr_mu_unlock(g_iomgr_args.mu); - } + gpr_mu_lock(g_iomgr_args.mu); + GRPC_LOG_IF_ERROR("pollset_kick", + grpc_pollset_kick(g_iomgr_args.pollset, nullptr)); + gpr_mu_unlock(g_iomgr_args.mu); } void on_first_resolution(void* arg, grpc_error* error) { OnResolutionCallbackArg* cb_arg = static_cast(arg); - ++g_on_resolution_invocations_count; grpc_channel_args_destroy(cb_arg->result); - cb_arg->resolver->NextLocked( - &cb_arg->result, - GRPC_CLOSURE_CREATE(on_second_resolution, arg, - grpc_combiner_scheduler(g_combiner))); - cb_arg->resolver->RequestReresolutionLocked(); + GPR_ASSERT(error == GRPC_ERROR_NONE); + ++g_on_resolution_invocations_count; gpr_log(GPR_INFO, "1st: g_on_resolution_invocations_count: %d, g_resolution_count: %d", g_on_resolution_invocations_count, g_resolution_count); - // Theres one initial system-level resolution and one invocation of a + // There's one initial system-level resolution and one invocation of a // notification callback (the current function). GPR_ASSERT(g_on_resolution_invocations_count == 1); GPR_ASSERT(g_resolution_count == 1); - if (cb_arg->using_cares) { - gpr_mu_lock(g_iomgr_args.mu); - GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(g_iomgr_args.pollset, nullptr)); - gpr_mu_unlock(g_iomgr_args.mu); - } + cb_arg->resolver->NextLocked( + &cb_arg->result, + GRPC_CLOSURE_CREATE(on_second_resolution, arg, + grpc_combiner_scheduler(g_combiner))); + cb_arg->resolver->RequestReresolutionLocked(); + gpr_mu_lock(g_iomgr_args.mu); + GRPC_LOG_IF_ERROR("pollset_kick", + grpc_pollset_kick(g_iomgr_args.pollset, nullptr)); + gpr_mu_unlock(g_iomgr_args.mu); } static void start_test_under_combiner(void* arg, grpc_error* error) { @@ -269,22 +287,19 @@ static void start_test_under_combiner(void* arg, grpc_error* error) { grpc_uri_destroy(uri); } -static void test_cooldown(bool using_cares) { +static void test_cooldown() { grpc_core::ExecCtx exec_ctx; - if (using_cares) iomgr_args_init(&g_iomgr_args); + iomgr_args_init(&g_iomgr_args); OnResolutionCallbackArg* res_cb_arg = grpc_core::New(); res_cb_arg->uri_str = "dns:127.0.0.1"; - res_cb_arg->using_cares = using_cares; GRPC_CLOSURE_SCHED(GRPC_CLOSURE_CREATE(start_test_under_combiner, res_cb_arg, grpc_combiner_scheduler(g_combiner)), GRPC_ERROR_NONE); - if (using_cares) { - grpc_core::ExecCtx::Get()->Flush(); - poll_pollset_until_request_done(&g_iomgr_args); - iomgr_args_finish(&g_iomgr_args); - } + grpc_core::ExecCtx::Get()->Flush(); + poll_pollset_until_request_done(&g_iomgr_args); + iomgr_args_finish(&g_iomgr_args); } int main(int argc, char** argv) { @@ -293,16 +308,12 @@ int main(int argc, char** argv) { g_combiner = grpc_combiner_create(); - bool using_cares = false; -#if GRPC_ARES == 1 - using_cares = true; -#endif g_default_dns_lookup_ares = grpc_dns_lookup_ares; grpc_dns_lookup_ares = test_dns_lookup_ares; default_resolve_address = grpc_resolve_address_impl; grpc_set_resolver_impl(&test_resolver); - test_cooldown(using_cares); + test_cooldown(); { grpc_core::ExecCtx exec_ctx; From a0bc0ac169ecae34b5a7a43cb5e0fdfc9662d22a Mon Sep 17 00:00:00 2001 From: kpayson64 Date: Mon, 30 Apr 2018 09:06:31 -0700 Subject: [PATCH 126/165] Remove CleanupThread This is no longer needed with the addition of a close() API that allows clean shutdown. --- src/python/grpcio/grpc/_channel.py | 26 +--- src/python/grpcio/grpc/_common.py | 34 ------ src/python/grpcio/grpc/_server.py | 10 +- .../grpcio/grpc/beta/_server_adaptations.py | 7 +- src/python/grpcio_tests/tests/tests.json | 1 - .../tests/unit/_thread_cleanup_test.py | 115 ------------------ 6 files changed, 10 insertions(+), 183 deletions(-) delete mode 100644 src/python/grpcio_tests/tests/unit/_thread_cleanup_test.py diff --git a/src/python/grpcio/grpc/_channel.py b/src/python/grpcio/grpc/_channel.py index 2eff08aa573..1e4a99d908f 100644 --- a/src/python/grpcio/grpc/_channel.py +++ b/src/python/grpcio/grpc/_channel.py @@ -222,16 +222,8 @@ def _consume_request_iterator(request_iterator, state, call, call.start_client_batch(operations, event_handler) state.due.add(cygrpc.OperationType.send_close_from_client) - def stop_consumption_thread(timeout): # pylint: disable=unused-argument - with state.condition: - if state.code is None: - call.cancel() - state.cancelled = True - _abort(state, grpc.StatusCode.CANCELLED, 'Cancelled!') - state.condition.notify_all() - - consumption_thread = _common.CleanupThread( - stop_consumption_thread, target=consume_request_iterator) + consumption_thread = threading.Thread(target=consume_request_iterator) + consumption_thread.daemon = True consumption_thread.start() @@ -706,14 +698,8 @@ def _run_channel_spin_thread(state): state.managed_calls = None return - def stop_channel_spin(timeout): # pylint: disable=unused-argument - with state.lock: - if state.managed_calls is not None: - for call in state.managed_calls: - call.cancel() - - channel_spin_thread = _common.CleanupThread( - stop_channel_spin, target=channel_spin) + channel_spin_thread = threading.Thread(target=channel_spin) + channel_spin_thread.daemon = True channel_spin_thread.start() @@ -855,10 +841,10 @@ def _moot(state): def _subscribe(state, callback, try_to_connect): with state.lock: if not state.callbacks_and_connectivities and not state.polling: - polling_thread = _common.CleanupThread( - lambda timeout: _moot(state), + polling_thread = threading.Thread( target=_poll_connectivity, args=(state, state.channel, bool(try_to_connect))) + polling_thread.daemon = True polling_thread.start() state.polling = True state.callbacks_and_connectivities.append([callback, None]) diff --git a/src/python/grpcio/grpc/_common.py b/src/python/grpcio/grpc/_common.py index bbb69ad4893..862987a0cd1 100644 --- a/src/python/grpcio/grpc/_common.py +++ b/src/python/grpcio/grpc/_common.py @@ -14,8 +14,6 @@ """Shared implementation.""" import logging -import threading -import time import six @@ -101,35 +99,3 @@ def deserialize(serialized_message, deserializer): def fully_qualified_method(group, method): return '/{}/{}'.format(group, method) - - -class CleanupThread(threading.Thread): - """A threading.Thread subclass supporting custom behavior on join(). - - On Python Interpreter exit, Python will attempt to join outstanding threads - prior to garbage collection. We may need to do additional cleanup, and - we accomplish this by overriding the join() method. - """ - - def __init__(self, behavior, *args, **kwargs): - """Constructor. - - Args: - behavior (function): Function called on join() with a single - argument, timeout, indicating the maximum duration of - `behavior`, or None indicating `behavior` has no deadline. - `behavior` must be idempotent. - args: Positional arguments passed to threading.Thread constructor. - kwargs: Keyword arguments passed to threading.Thread constructor. - """ - super(CleanupThread, self).__init__(*args, **kwargs) - self._behavior = behavior - - def join(self, timeout=None): - start_time = time.time() - self._behavior(timeout) - end_time = time.time() - if timeout is not None: - timeout -= end_time - start_time - timeout = max(timeout, 0) - super(CleanupThread, self).join(timeout) diff --git a/src/python/grpcio/grpc/_server.py b/src/python/grpcio/grpc/_server.py index c988e0c87ce..d849cadbeea 100644 --- a/src/python/grpcio/grpc/_server.py +++ b/src/python/grpcio/grpc/_server.py @@ -780,14 +780,8 @@ def _start(state): state.stage = _ServerStage.STARTED _request_call(state) - def cleanup_server(timeout): - if timeout is None: - _stop(state, _UNEXPECTED_EXIT_SERVER_GRACE).wait() - else: - _stop(state, timeout).wait() - - thread = _common.CleanupThread( - cleanup_server, target=_serve, args=(state,)) + thread = threading.Thread(target=_serve, args=(state,)) + thread.daemon = True thread.start() diff --git a/src/python/grpcio/grpc/beta/_server_adaptations.py b/src/python/grpcio/grpc/beta/_server_adaptations.py index 3c04fd76396..ccafec8951d 100644 --- a/src/python/grpcio/grpc/beta/_server_adaptations.py +++ b/src/python/grpcio/grpc/beta/_server_adaptations.py @@ -168,11 +168,8 @@ def _run_request_pipe_thread(request_iterator, request_consumer, return request_consumer.terminate() - def stop_request_pipe(timeout): # pylint: disable=unused-argument - thread_joined.set() - - request_pipe_thread = _common.CleanupThread( - stop_request_pipe, target=pipe_requests) + request_pipe_thread = threading.Thread(target=pipe_requests) + request_pipe_thread.daemon = True request_pipe_thread.start() diff --git a/src/python/grpcio_tests/tests/tests.json b/src/python/grpcio_tests/tests/tests.json index d38ee517f09..724427adb69 100644 --- a/src/python/grpcio_tests/tests/tests.json +++ b/src/python/grpcio_tests/tests/tests.json @@ -52,7 +52,6 @@ "unit._server_ssl_cert_config_test.ServerSSLCertReloadTestCertConfigReuse", "unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithClientAuth", "unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithoutClientAuth", - "unit._thread_cleanup_test.CleanupThreadTest", "unit.beta._beta_features_test.BetaFeaturesTest", "unit.beta._beta_features_test.ContextManagementAndLifecycleTest", "unit.beta._connectivity_channel_test.ConnectivityStatesTest", diff --git a/src/python/grpcio_tests/tests/unit/_thread_cleanup_test.py b/src/python/grpcio_tests/tests/unit/_thread_cleanup_test.py deleted file mode 100644 index 18f5af058a6..00000000000 --- a/src/python/grpcio_tests/tests/unit/_thread_cleanup_test.py +++ /dev/null @@ -1,115 +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. -"""Tests for CleanupThread.""" - -import threading -import time -import unittest - -from grpc import _common - -_SHORT_TIME = 0.5 -_LONG_TIME = 5.0 -_EPSILON = 0.5 - - -def cleanup(timeout): - if timeout is not None: - time.sleep(timeout) - else: - time.sleep(_LONG_TIME) - - -def slow_cleanup(timeout): - # Don't respect timeout - time.sleep(_LONG_TIME) - - -class CleanupThreadTest(unittest.TestCase): - - def testTargetInvocation(self): - event = threading.Event() - - def target(arg1, arg2, arg3=None): - self.assertEqual('arg1', arg1) - self.assertEqual('arg2', arg2) - self.assertEqual('arg3', arg3) - event.set() - - cleanup_thread = _common.CleanupThread( - behavior=lambda x: None, - target=target, - name='test-name', - args=('arg1', 'arg2'), - kwargs={ - 'arg3': 'arg3' - }) - cleanup_thread.start() - cleanup_thread.join() - self.assertEqual(cleanup_thread.name, 'test-name') - self.assertTrue(event.is_set()) - - def testJoinNoTimeout(self): - cleanup_thread = _common.CleanupThread(behavior=cleanup) - cleanup_thread.start() - start_time = time.time() - cleanup_thread.join() - end_time = time.time() - self.assertAlmostEqual( - _LONG_TIME, end_time - start_time, delta=_EPSILON) - - def testJoinTimeout(self): - cleanup_thread = _common.CleanupThread(behavior=cleanup) - cleanup_thread.start() - start_time = time.time() - cleanup_thread.join(_SHORT_TIME) - end_time = time.time() - self.assertAlmostEqual( - _SHORT_TIME, end_time - start_time, delta=_EPSILON) - - def testJoinTimeoutSlowBehavior(self): - cleanup_thread = _common.CleanupThread(behavior=slow_cleanup) - cleanup_thread.start() - start_time = time.time() - cleanup_thread.join(_SHORT_TIME) - end_time = time.time() - self.assertAlmostEqual( - _LONG_TIME, end_time - start_time, delta=_EPSILON) - - def testJoinTimeoutSlowTarget(self): - event = threading.Event() - - def target(): - event.wait(_LONG_TIME) - - cleanup_thread = _common.CleanupThread(behavior=cleanup, target=target) - cleanup_thread.start() - start_time = time.time() - cleanup_thread.join(_SHORT_TIME) - end_time = time.time() - self.assertAlmostEqual( - _SHORT_TIME, end_time - start_time, delta=_EPSILON) - event.set() - - def testJoinZeroTimeout(self): - cleanup_thread = _common.CleanupThread(behavior=cleanup) - cleanup_thread.start() - start_time = time.time() - cleanup_thread.join(0) - end_time = time.time() - self.assertAlmostEqual(0, end_time - start_time, delta=_EPSILON) - - -if __name__ == '__main__': - unittest.main(verbosity=2) From b85354ee49569dcf5c10b965a14c1a4451e91edf Mon Sep 17 00:00:00 2001 From: ncteisen Date: Thu, 19 Apr 2018 12:01:06 -0700 Subject: [PATCH 127/165] Add in compile out tracers option --- src/core/lib/debug/trace.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/lib/debug/trace.h b/src/core/lib/debug/trace.h index bfec92c529c..28157c6383d 100644 --- a/src/core/lib/debug/trace.h +++ b/src/core/lib/debug/trace.h @@ -57,13 +57,22 @@ class TraceFlag { const char* name() const { return name_; } +// This following define may be commented out to ensure that the compiler +// deletes any "if (tracer.enabled()) {...}" codeblocks. This is useful to +// test the performance impact tracers have on the system. +// +// #define COMPILE_OUT_ALL_TRACERS_IN_OPT_BUILD +#ifdef COMPILE_OUT_ALL_TRACERS_IN_OPT_BUILD + bool enabled() { return false; } +#else bool enabled() { #ifdef GRPC_THREADSAFE_TRACER return gpr_atm_no_barrier_load(&value_) != 0; #else return value_; -#endif +#endif // GRPC_THREADSAFE_TRACER } +#endif // COMPILE_OUT_ALL_TRACERS_IN_OPT_BUILD private: friend void grpc_core::testing::grpc_tracer_enable_flag(TraceFlag* flag); From 8d6c3466ae60a4391b6bcfc1dec39ccd9550b00b Mon Sep 17 00:00:00 2001 From: Juanli Shen Date: Mon, 30 Apr 2018 14:46:10 -0700 Subject: [PATCH 128/165] Move comment out of the command --- tools/gce/create_windows_debug_worker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gce/create_windows_debug_worker.sh b/tools/gce/create_windows_debug_worker.sh index 3829b71e190..3625df832a6 100755 --- a/tools/gce/create_windows_debug_worker.sh +++ b/tools/gce/create_windows_debug_worker.sh @@ -44,12 +44,12 @@ gcloud compute disks create "$TMP_DISK_NAME" \ echo 'Created scratch disk, waiting for it to become available.' sleep 15 +# The image version might need updating. gcloud compute instances create "$INSTANCE_NAME" \ --project="$CLOUD_PROJECT" \ --zone "$ZONE" \ --machine-type "$MACHINE_TYPE" \ --image-project google.com:kokoro \ - # The version might need updating. --image kokoro-win7build-v11-prod-debug \ --boot-disk-size 500 \ --boot-disk-type pd-ssd \ From 446d1ea6807b1b33346e26e446b9df2a94d0276e Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Mon, 30 Apr 2018 16:58:21 -0700 Subject: [PATCH 129/165] Message about the watcher timer init closure requiring immediate execution. --- src/core/ext/filters/client_channel/client_channel.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index a10bfea8b19..df57fe5bfb7 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -3164,6 +3164,8 @@ static void watch_connectivity_state_locked(void* arg, external_connectivity_watcher* found = nullptr; if (w->state != nullptr) { external_connectivity_watcher_list_append(w->chand, w); + // An assumption is being made that the closure is scheduled on the exec ctx + // scheduler and that GRPC_CLOSURE_RUN would run the closure immediately. GRPC_CLOSURE_RUN(w->watcher_timer_init, GRPC_ERROR_NONE); GRPC_CLOSURE_INIT(&w->my_closure, on_external_watch_complete_locked, w, grpc_combiner_scheduler(w->chand->combiner)); From 1de3f4ae8d7de2bee7cf5ad3f014cd8f7f76bb0b Mon Sep 17 00:00:00 2001 From: Ben Sykes Date: Mon, 30 Apr 2018 22:43:31 -0700 Subject: [PATCH 130/165] Add grpc_out option to set minimum_node_version Example protoc call: protoc --plugin=protoc-gen-grpc=grpc_node_plugin --js_out=import_style=commonjs,binary:./autogen/ --grpc_out=minimum_node_version=8:./autogen/ hello.proto --- src/compiler/node_generator.cc | 18 ++++++++++++------ src/compiler/node_generator.h | 8 +++++++- src/compiler/node_plugin.cc | 22 +++++++++++++++++++++- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/compiler/node_generator.cc b/src/compiler/node_generator.cc index dbc7eefb391..36ee60a198f 100644 --- a/src/compiler/node_generator.cc +++ b/src/compiler/node_generator.cc @@ -20,6 +20,7 @@ #include "src/compiler/config.h" #include "src/compiler/generator_helpers.h" +#include "src/compiler/node_generator.h" #include "src/compiler/node_generator_helpers.h" using grpc::protobuf::Descriptor; @@ -119,7 +120,7 @@ grpc::string NodeObjectPath(const Descriptor* descriptor) { } // Prints out the message serializer and deserializer functions -void PrintMessageTransformer(const Descriptor* descriptor, Printer* out) { +void PrintMessageTransformer(const Descriptor* descriptor, Printer* out, const Parameters& params) { map template_vars; grpc::string full_name = descriptor->full_name(); template_vars["identifier_name"] = MessageIdentifierName(full_name); @@ -134,7 +135,12 @@ void PrintMessageTransformer(const Descriptor* descriptor, Printer* out) { "throw new Error('Expected argument of type $name$');\n"); out->Outdent(); out->Print("}\n"); - out->Print("return Buffer.from(arg.serializeBinary());\n"); + if (params.minimum_node_version > 5) { + // Node version is > 5, we should use Buffer.from + out->Print("return Buffer.from(arg.serializeBinary());\n"); + } else { + out->Print("return new Buffer(arg.serializeBinary());\n"); + } out->Outdent(); out->Print("}\n\n"); @@ -219,12 +225,12 @@ void PrintImports(const FileDescriptor* file, Printer* out) { out->Print("\n"); } -void PrintTransformers(const FileDescriptor* file, Printer* out) { +void PrintTransformers(const FileDescriptor* file, Printer* out, const Parameters& params) { map messages = GetAllMessages(file); for (std::map::iterator it = messages.begin(); it != messages.end(); it++) { - PrintMessageTransformer(it->second, out); + PrintMessageTransformer(it->second, out, params); } out->Print("\n"); } @@ -236,7 +242,7 @@ void PrintServices(const FileDescriptor* file, Printer* out) { } } // namespace -grpc::string GenerateFile(const FileDescriptor* file) { +grpc::string GenerateFile(const FileDescriptor* file, const Parameters& params) { grpc::string output; { StringOutputStream output_stream(&output); @@ -257,7 +263,7 @@ grpc::string GenerateFile(const FileDescriptor* file) { PrintImports(file, &out); - PrintTransformers(file, &out); + PrintTransformers(file, &out, params); PrintServices(file, &out); diff --git a/src/compiler/node_generator.h b/src/compiler/node_generator.h index a9ffe75fc86..6906f2f450d 100644 --- a/src/compiler/node_generator.h +++ b/src/compiler/node_generator.h @@ -23,7 +23,13 @@ namespace grpc_node_generator { -grpc::string GenerateFile(const grpc::protobuf::FileDescriptor* file); +// Contains all the parameters that are parsed from the command line. +struct Parameters { + // Sets the earliest version of nodejs that needs to be supported. + int minimum_node_version; +}; + +grpc::string GenerateFile(const grpc::protobuf::FileDescriptor* file, const Parameters& params); } // namespace grpc_node_generator diff --git a/src/compiler/node_plugin.cc b/src/compiler/node_plugin.cc index bc38e9018a2..a224ac89d08 100644 --- a/src/compiler/node_plugin.cc +++ b/src/compiler/node_plugin.cc @@ -36,7 +36,27 @@ class NodeGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { const grpc::string& parameter, grpc::protobuf::compiler::GeneratorContext* context, grpc::string* error) const { - grpc::string code = GenerateFile(file); + + grpc_node_generator::Parameters generator_parameters; + generator_parameters.minimum_node_version = 4; + + if (!parameter.empty()) { + std::vector parameters_list = + grpc_generator::tokenize(parameter, ","); + for (auto parameter_string = parameters_list.begin(); + parameter_string != parameters_list.end(); parameter_string++) { + std::vector param = + grpc_generator::tokenize(*parameter_string, "="); + if (param[0] == "minimum_node_version") { + sscanf(param[1].c_str(), "%d", &generator_parameters.minimum_node_version); + } else { + *error = grpc::string("Unknown parameter: ") + *parameter_string; + return false; + } + } + } + + grpc::string code = GenerateFile(file, generator_parameters); if (code.size() == 0) { return true; } From 08718181e39ee830826335a546ae165983350843 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 1 May 2018 09:09:17 -0700 Subject: [PATCH 131/165] Make sure we set error for transient_failure state. --- .../client_channel/lb_policy/pick_first/pick_first.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 4db28fb18ca..92e738c7bd4 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -402,7 +402,12 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); grpc_connectivity_state_set( &p->state_tracker_, GRPC_CHANNEL_TRANSIENT_FAILURE, - GRPC_ERROR_REF(error), "selected_not_ready+switch_to_update"); + error != GRPC_ERROR_NONE + ? GRPC_ERROR_REF(error) + : GRPC_ERROR_CREATE_FROM_STATIC_STRING( + "selected subchannel not ready; switching to pending " + "update"), + "selected_not_ready+switch_to_update"); } else { // TODO(juanlishen): we re-resolve when the selected subchannel goes to // TRANSIENT_FAILURE because we used to shut down in this case before From 4454af55e1eb3862534d8dfa3d0f5d1066b55328 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Tue, 1 May 2018 09:45:01 -0700 Subject: [PATCH 132/165] Update stats generator --- tools/codegen/core/gen_stats_data.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tools/codegen/core/gen_stats_data.py b/tools/codegen/core/gen_stats_data.py index 5c9d9e5ea52..3ebd00d049f 100755 --- a/tools/codegen/core/gen_stats_data.py +++ b/tools/codegen/core/gen_stats_data.py @@ -230,13 +230,11 @@ with open('src/core/lib/debug/stats_data.h', 'w') as H: print >> H, "#ifndef GRPC_CORE_LIB_DEBUG_STATS_DATA_H" print >> H, "#define GRPC_CORE_LIB_DEBUG_STATS_DATA_H" print >> H + print >> H, "#include " + print >> H print >> H, "#include " print >> H, "#include \"src/core/lib/iomgr/exec_ctx.h\"" print >> H - print >> H, "#ifdef __cplusplus" - print >> H, "extern \"C\" {" - print >> H, "#endif" - print >> H for typename, instances in sorted(inst_map.items()): print >> H, "typedef enum {" @@ -289,10 +287,6 @@ with open('src/core/lib/debug/stats_data.h', 'w') as H: print >> H, "extern void (*const grpc_stats_inc_histogram[%d])(int x);" % len( inst_map['Histogram']) - print >> H - print >> H, "#ifdef __cplusplus" - print >> H, "}" - print >> H, "#endif" print >> H print >> H, "#endif /* GRPC_CORE_LIB_DEBUG_STATS_DATA_H */" @@ -316,10 +310,13 @@ with open('src/core/lib/debug/stats_data.cc', 'w') as C: [C], ["Automatically generated by tools/codegen/core/gen_stats_data.py"]) - print >> C, "#include \"src/core/lib/debug/stats_data.h\"" + print >> C, "#include " + print >> C print >> C, "#include \"src/core/lib/debug/stats.h\"" + print >> C, "#include \"src/core/lib/debug/stats_data.h\"" + print >> C, "#include \"src/core/lib/gpr/useful.h\"" print >> C, "#include \"src/core/lib/iomgr/exec_ctx.h\"" - print >> C, "#include " + print >> C histo_code = [] for histogram in inst_map['Histogram']: From a0aab7ebcc4e3af28f9dde745bf1800094b085a7 Mon Sep 17 00:00:00 2001 From: Juanli Shen Date: Tue, 1 May 2018 10:30:54 -0700 Subject: [PATCH 133/165] Add load data store --- BUILD | 14 + CMakeLists.txt | 84 +++ Makefile | 102 +++- build.yaml | 23 + grpc.gyp | 10 + .../server/load_reporter/load_data_store.cc | 273 ++++++++++ .../server/load_reporter/load_data_store.h | 339 ++++++++++++ test/cpp/server/load_reporter/BUILD | 31 ++ .../load_reporter/load_data_store_test.cc | 481 ++++++++++++++++++ .../generated/sources_and_headers.json | 37 ++ tools/run_tests/generated/tests.json | 24 + 11 files changed, 1416 insertions(+), 2 deletions(-) create mode 100644 src/cpp/server/load_reporter/load_data_store.cc create mode 100644 src/cpp/server/load_reporter/load_data_store.h create mode 100644 test/cpp/server/load_reporter/BUILD create mode 100644 test/cpp/server/load_reporter/load_data_store_test.cc diff --git a/BUILD b/BUILD index e04d0df1a23..f899632a1bf 100644 --- a/BUILD +++ b/BUILD @@ -1285,6 +1285,20 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "lb_load_data_store", + srcs = [ + "src/cpp/server/load_reporter/load_data_store.cc", + ], + hdrs = [ + "src/cpp/server/load_reporter/load_data_store.h", + ], + language = "c++", + deps = [ + "grpc++", + ], +) + grpc_cc_library( name = "grpc_resolver_dns_native", srcs = [ diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e0a93aff6b..d638dbfc6e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -584,6 +584,7 @@ endif() if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx json_run_localhost) endif() +add_dependencies(buildtests_cxx lb_load_data_store_test) add_dependencies(buildtests_cxx memory_test) add_dependencies(buildtests_cxx metrics_client) add_dependencies(buildtests_cxx mock_test) @@ -4972,6 +4973,49 @@ target_link_libraries(interop_server_main ) +endif (gRPC_BUILD_TESTS) +if (gRPC_BUILD_TESTS) + +add_library(lb_load_data_store + src/cpp/server/load_reporter/load_data_store.cc +) + +if(WIN32 AND MSVC) + set_target_properties(lb_load_data_store PROPERTIES COMPILE_PDB_NAME "lb_load_data_store" + COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" + ) + if (gRPC_INSTALL) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lb_load_data_store.pdb + DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL + ) + endif() +endif() + + +target_include_directories(lb_load_data_store + PUBLIC $ $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_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(lb_load_data_store + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc++ +) + + endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) @@ -12271,6 +12315,46 @@ endif() endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) +add_executable(lb_load_data_store_test + test/cpp/server/load_reporter/load_data_store_test.cc + third_party/googletest/googletest/src/gtest-all.cc + third_party/googletest/googlemock/src/gmock-all.cc +) + + +target_include_directories(lb_load_data_store_test + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_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(lb_load_data_store_test + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + lb_load_data_store + grpc++_test_util + grpc_test_util + grpc++ + grpc + gpr_test_util + gpr + ${_gRPC_GFLAGS_LIBRARIES} +) + +endif (gRPC_BUILD_TESTS) +if (gRPC_BUILD_TESTS) + add_executable(memory_test test/core/gprpp/memory_test.cc third_party/googletest/googletest/src/gtest-all.cc diff --git a/Makefile b/Makefile index c6468263398..4e9b7c4deab 100644 --- a/Makefile +++ b/Makefile @@ -1178,6 +1178,7 @@ interop_client: $(BINDIR)/$(CONFIG)/interop_client interop_server: $(BINDIR)/$(CONFIG)/interop_server interop_test: $(BINDIR)/$(CONFIG)/interop_test json_run_localhost: $(BINDIR)/$(CONFIG)/json_run_localhost +lb_load_data_store_test: $(BINDIR)/$(CONFIG)/lb_load_data_store_test memory_test: $(BINDIR)/$(CONFIG)/memory_test metrics_client: $(BINDIR)/$(CONFIG)/metrics_client mock_test: $(BINDIR)/$(CONFIG)/mock_test @@ -1390,9 +1391,9 @@ pc_cxx: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc pc_cxx_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc ifeq ($(EMBED_OPENSSL),true) -privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++_proto_reflection_desc_db.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a $(LIBDIR)/$(CONFIG)/libboringssl_crypto_test_data_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_asn1_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_buf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_chacha_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_compiler_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_spake25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ecdh_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_scrypt_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_p256-x86_64_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ctrdrbg_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_obj_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pool_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_file_test_gtest_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_gtest_main_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x509_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_span_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a $(LIBDIR)/$(CONFIG)/libbenchmark.a +privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++_proto_reflection_desc_db.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a $(LIBDIR)/$(CONFIG)/libboringssl_crypto_test_data_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_asn1_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_buf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_chacha_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_compiler_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_spake25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ecdh_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_scrypt_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_p256-x86_64_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ctrdrbg_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_obj_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pool_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_file_test_gtest_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_gtest_main_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x509_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_span_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a $(LIBDIR)/$(CONFIG)/libbenchmark.a else -privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++_proto_reflection_desc_db.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libbenchmark.a +privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++_proto_reflection_desc_db.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libbenchmark.a endif @@ -1660,6 +1661,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/interop_server \ $(BINDIR)/$(CONFIG)/interop_test \ $(BINDIR)/$(CONFIG)/json_run_localhost \ + $(BINDIR)/$(CONFIG)/lb_load_data_store_test \ $(BINDIR)/$(CONFIG)/memory_test \ $(BINDIR)/$(CONFIG)/metrics_client \ $(BINDIR)/$(CONFIG)/mock_test \ @@ -1831,6 +1833,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/interop_server \ $(BINDIR)/$(CONFIG)/interop_test \ $(BINDIR)/$(CONFIG)/json_run_localhost \ + $(BINDIR)/$(CONFIG)/lb_load_data_store_test \ $(BINDIR)/$(CONFIG)/memory_test \ $(BINDIR)/$(CONFIG)/metrics_client \ $(BINDIR)/$(CONFIG)/mock_test \ @@ -2283,6 +2286,8 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/inproc_sync_unary_ping_pong_test || ( echo test inproc_sync_unary_ping_pong_test failed ; exit 1 ) $(E) "[RUN] Testing interop_test" $(Q) $(BINDIR)/$(CONFIG)/interop_test || ( echo test interop_test failed ; exit 1 ) + $(E) "[RUN] Testing lb_load_data_store_test" + $(Q) $(BINDIR)/$(CONFIG)/lb_load_data_store_test || ( echo test lb_load_data_store_test failed ; exit 1 ) $(E) "[RUN] Testing memory_test" $(Q) $(BINDIR)/$(CONFIG)/memory_test || ( echo test memory_test failed ; exit 1 ) $(E) "[RUN] Testing mock_test" @@ -7207,6 +7212,55 @@ endif endif +LIBLB_LOAD_DATA_STORE_SRC = \ + src/cpp/server/load_reporter/load_data_store.cc \ + +PUBLIC_HEADERS_CXX += \ + +LIBLB_LOAD_DATA_STORE_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBLB_LOAD_DATA_STORE_SRC)))) + + +ifeq ($(NO_SECURE),true) + +# You can't build secure libraries if you don't have OpenSSL. + +$(LIBDIR)/$(CONFIG)/liblb_load_data_store.a: openssl_dep_error + + +else + +ifeq ($(NO_PROTOBUF),true) + +# You can't build a C++ library if you don't have protobuf - a bit overreached, but still okay. + +$(LIBDIR)/$(CONFIG)/liblb_load_data_store.a: protobuf_dep_error + + +else + +$(LIBDIR)/$(CONFIG)/liblb_load_data_store.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(PROTOBUF_DEP) $(LIBLB_LOAD_DATA_STORE_OBJS) + $(E) "[AR] Creating $@" + $(Q) mkdir -p `dirname $@` + $(Q) rm -f $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a + $(Q) $(AR) $(AROPTS) $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a $(LIBLB_LOAD_DATA_STORE_OBJS) +ifeq ($(SYSTEM),Darwin) + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a +endif + + + + +endif + +endif + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(LIBLB_LOAD_DATA_STORE_OBJS:.o=.dep) +endif +endif + + LIBQPS_SRC = \ $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc \ @@ -18027,6 +18081,49 @@ endif endif +LB_LOAD_DATA_STORE_TEST_SRC = \ + test/cpp/server/load_reporter/load_data_store_test.cc \ + +LB_LOAD_DATA_STORE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LB_LOAD_DATA_STORE_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/lb_load_data_store_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)/lb_load_data_store_test: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/lb_load_data_store_test: $(PROTOBUF_DEP) $(LB_LOAD_DATA_STORE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.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) $(LB_LOAD_DATA_STORE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.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)/lb_load_data_store_test + +endif + +endif + +$(OBJDIR)/$(CONFIG)/test/cpp/server/load_reporter/load_data_store_test.o: $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_lb_load_data_store_test: $(LB_LOAD_DATA_STORE_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(LB_LOAD_DATA_STORE_TEST_OBJS:.o=.dep) +endif +endif + + MEMORY_TEST_SRC = \ test/core/gprpp/memory_test.cc \ @@ -23895,6 +23992,7 @@ src/cpp/common/secure_channel_arguments.cc: $(OPENSSL_DEP) src/cpp/common/secure_create_auth_context.cc: $(OPENSSL_DEP) src/cpp/ext/proto_server_reflection.cc: $(OPENSSL_DEP) src/cpp/ext/proto_server_reflection_plugin.cc: $(OPENSSL_DEP) +src/cpp/server/load_reporter/load_data_store.cc: $(OPENSSL_DEP) src/cpp/server/secure_server_credentials.cc: $(OPENSSL_DEP) src/cpp/util/core_stats.cc: $(OPENSSL_DEP) src/cpp/util/error_details.cc: $(OPENSSL_DEP) diff --git a/build.yaml b/build.yaml index 374d5a03247..5f356174caa 100644 --- a/build.yaml +++ b/build.yaml @@ -1890,6 +1890,15 @@ libs: - test/cpp/interop/interop_server_bootstrap.cc deps: - interop_server_lib +- name: lb_load_data_store + build: private + language: c++ + headers: + - src/cpp/server/load_reporter/load_data_store.h + src: + - src/cpp/server/load_reporter/load_data_store.cc + deps: + - grpc++ - name: qps build: private language: c++ @@ -4766,6 +4775,20 @@ targets: - mac - linux - posix +- name: lb_load_data_store_test + gtest: true + build: test + language: c++ + src: + - test/cpp/server/load_reporter/load_data_store_test.cc + deps: + - lb_load_data_store + - grpc++_test_util + - grpc_test_util + - grpc++ + - grpc + - gpr_test_util + - gpr - name: memory_test gtest: true build: test diff --git a/grpc.gyp b/grpc.gyp index b36b166175e..c5e10edf7fb 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -1637,6 +1637,16 @@ 'test/cpp/interop/interop_server_bootstrap.cc', ], }, + { + 'target_name': 'lb_load_data_store', + 'type': 'static_library', + 'dependencies': [ + 'grpc++', + ], + 'sources': [ + 'src/cpp/server/load_reporter/load_data_store.cc', + ], + }, { 'target_name': 'qps', 'type': 'static_library', diff --git a/src/cpp/server/load_reporter/load_data_store.cc b/src/cpp/server/load_reporter/load_data_store.cc new file mode 100644 index 00000000000..70f12c1102d --- /dev/null +++ b/src/cpp/server/load_reporter/load_data_store.cc @@ -0,0 +1,273 @@ +/* + * + * Copyright 2018 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 +#include +#include +#include + +#include "src/cpp/server/load_reporter/load_data_store.h" + +namespace grpc { +namespace load_reporter { + +// Some helper functions. +namespace { + +// Given a map from type K to a set of value type V, finds the set associated +// with the given key and erases the value from the set. If the set becomes +// empty, also erases the key-set pair. Returns true if the value is erased +// successfully. +template +bool UnorderedMapOfSetEraseKeyValue(std::unordered_map>& map, + const K& key, const V& value) { + auto it = map.find(key); + if (it != map.end()) { + size_t erased = it->second.erase(value); + if (it->second.size() == 0) { + map.erase(it); + } + return erased; + } + return false; +}; + +// Given a map from type K to a set of value type V, removes the given key and +// the associated set, and returns the set. Returns an empty set if the key is +// not found. +template +std::set UnorderedMapOfSetExtract(std::unordered_map>& map, + const K& key) { + auto it = map.find(key); + if (it != map.end()) { + auto set = std::move(it->second); + map.erase(it); + return set; + } + return {}; +}; + +// From a non-empty container, returns a pointer to a random element. +template +const typename C::value_type* RandomElement(const C& container) { + GPR_ASSERT(!container.empty()); + auto it = container.begin(); + std::advance(it, std::rand() % container.size()); + return &(*it); +} + +} // namespace + +void PerBalancerStore::MergeRow(const LoadRecordKey& key, + const LoadRecordValue& value) { + // During suspension, the load data received will be dropped. + if (!suspended_) { + load_record_map_[key].MergeFrom(value); + gpr_log(GPR_DEBUG, + "[PerBalancerStore %p] Load data merged (Key: %s, Value: %s).", + this, key.ToString().c_str(), value.ToString().c_str()); + } else { + gpr_log(GPR_DEBUG, + "[PerBalancerStore %p] Load data dropped (Key: %s, Value: %s).", + this, key.ToString().c_str(), value.ToString().c_str()); + } + // We always keep track of num_calls_in_progress_, so that when this + // store is resumed, we still have a correct value of + // num_calls_in_progress_. + GPR_ASSERT(static_cast(num_calls_in_progress_) + + value.GetNumCallsInProgressDelta() >= + 0); + num_calls_in_progress_ += value.GetNumCallsInProgressDelta(); +} + +void PerBalancerStore::Suspend() { + suspended_ = true; + load_record_map_.clear(); + gpr_log(GPR_DEBUG, "[PerBalancerStore %p] Suspended.", this); +} + +void PerBalancerStore::Resume() { + suspended_ = false; + gpr_log(GPR_DEBUG, "[PerBalancerStore %p] Resumed.", this); +} + +uint64_t PerBalancerStore::GetNumCallsInProgressForReport() { + GPR_ASSERT(!suspended_); + last_reported_num_calls_in_progress_ = num_calls_in_progress_; + return num_calls_in_progress_; +} + +void PerHostStore::ReportStreamCreated(const grpc::string& lb_id, + const grpc::string& load_key) { + GPR_ASSERT(lb_id != kInvalidLbId); + SetUpForNewLbId(lb_id, load_key); + // Prior to this one, there was no load balancer receiving report, so we may + // have unassigned orphaned stores to assign to this new balancer. + // TODO(juanlishen): If the load key of this new stream is the same with + // some previously adopted orphan store, we may want to take the orphan to + // this stream. Need to discuss with LB team. + if (assigned_stores_.size() == 1) { + for (const auto& p : per_balancer_stores_) { + const grpc::string& other_lb_id = p.first; + const std::unique_ptr& orphaned_store = p.second; + if (other_lb_id != lb_id) { + orphaned_store->Resume(); + AssignOrphanedStore(orphaned_store.get(), lb_id); + } + } + } + // The first connected balancer will adopt the kInvalidLbId. + if (per_balancer_stores_.size() == 1) { + SetUpForNewLbId(kInvalidLbId, ""); + ReportStreamClosed(kInvalidLbId); + } +} + +void PerHostStore::ReportStreamClosed(const grpc::string& lb_id) { + auto it_store_for_gone_lb = per_balancer_stores_.find(lb_id); + GPR_ASSERT(it_store_for_gone_lb != per_balancer_stores_.end()); + // Remove this closed stream from our records. + GPR_ASSERT(UnorderedMapOfSetEraseKeyValue( + load_key_to_receiving_lb_ids_, it_store_for_gone_lb->second->load_key(), + lb_id)); + std::set orphaned_stores = + UnorderedMapOfSetExtract(assigned_stores_, lb_id); + // The stores that were assigned to this balancer are orphaned now. They + // should be re-assigned to other balancers which are still receiving reports. + for (PerBalancerStore* orphaned_store : orphaned_stores) { + const grpc::string* new_receiver = nullptr; + auto it = load_key_to_receiving_lb_ids_.find(orphaned_store->load_key()); + if (it != load_key_to_receiving_lb_ids_.end()) { + // First, try to pick from the active balancers with the same load key. + new_receiver = RandomElement(it->second); + } else if (!assigned_stores_.empty()) { + // If failed, pick from all the remaining active balancers. + new_receiver = &(RandomElement(assigned_stores_)->first); + } + if (new_receiver != nullptr) { + AssignOrphanedStore(orphaned_store, *new_receiver); + } else { + // Load data for an LB ID that can't be assigned to any stream should + // be dropped. + orphaned_store->Suspend(); + } + } +} + +PerBalancerStore* PerHostStore::FindPerBalancerStore( + const grpc::string& lb_id) const { + return per_balancer_stores_.find(lb_id) != per_balancer_stores_.end() + ? per_balancer_stores_.find(lb_id)->second.get() + : nullptr; +} + +const std::set* PerHostStore::GetAssignedStores( + const grpc::string& lb_id) const { + auto it = assigned_stores_.find(lb_id); + if (it == assigned_stores_.end()) return nullptr; + return &(it->second); +} + +void PerHostStore::AssignOrphanedStore(PerBalancerStore* orphaned_store, + const grpc::string& new_receiver) { + auto it = assigned_stores_.find(new_receiver); + GPR_ASSERT(it != assigned_stores_.end()); + it->second.insert(orphaned_store); + gpr_log(GPR_INFO, + "[PerHostStore %p] Re-assigned orphaned store (%p) with original LB" + " ID of %s to new receiver %s", + this, orphaned_store, orphaned_store->lb_id().c_str(), + new_receiver.c_str()); +} + +void PerHostStore::SetUpForNewLbId(const grpc::string& lb_id, + const grpc::string& load_key) { + // The top-level caller (i.e., LoadReportService) should guarantee the + // lb_id is unique for each reporting stream. + GPR_ASSERT(per_balancer_stores_.find(lb_id) == per_balancer_stores_.end()); + GPR_ASSERT(assigned_stores_.find(lb_id) == assigned_stores_.end()); + load_key_to_receiving_lb_ids_[load_key].insert(lb_id); + std::unique_ptr per_balancer_store( + new PerBalancerStore(lb_id, load_key)); + assigned_stores_[lb_id] = {per_balancer_store.get()}; + per_balancer_stores_[lb_id] = std::move(per_balancer_store); +} + +PerBalancerStore* LoadDataStore::FindPerBalancerStore( + const string& hostname, const string& lb_id) const { + auto it = per_host_stores_.find(hostname); + if (it != per_host_stores_.end()) { + const PerHostStore& per_host_store = it->second; + return per_host_store.FindPerBalancerStore(lb_id); + } else { + return nullptr; + } +} + +void LoadDataStore::MergeRow(const grpc::string& hostname, + const LoadRecordKey& key, + const LoadRecordValue& value) { + PerBalancerStore* per_balancer_store = + FindPerBalancerStore(hostname, key.lb_id()); + if (per_balancer_store != nullptr) { + per_balancer_store->MergeRow(key, value); + return; + } + // Unknown LB ID. Track it until its number of in-progress calls drops to + // zero. + int64_t in_progress_delta = value.GetNumCallsInProgressDelta(); + if (in_progress_delta != 0) { + auto it_tracker = unknown_balancer_id_trackers_.find(key.lb_id()); + if (it_tracker == unknown_balancer_id_trackers_.end()) { + gpr_log( + GPR_DEBUG, + "[LoadDataStore %p] Start tracking unknown balancer (lb_id_: %s).", + this, key.lb_id().c_str()); + unknown_balancer_id_trackers_.insert( + {key.lb_id(), static_cast(in_progress_delta)}); + } else if ((it_tracker->second += in_progress_delta) == 0) { + unknown_balancer_id_trackers_.erase(it_tracker); + gpr_log(GPR_DEBUG, + "[LoadDataStore %p] Stop tracking unknown balancer (lb_id_: %s).", + this, key.lb_id().c_str()); + } + } +} + +const std::set* LoadDataStore::GetAssignedStores( + const grpc::string& hostname, const grpc::string& lb_id) { + auto it = per_host_stores_.find(hostname); + if (it == per_host_stores_.end()) return nullptr; + return it->second.GetAssignedStores(lb_id); +} + +void LoadDataStore::ReportStreamCreated(const grpc::string& hostname, + const grpc::string& lb_id, + const grpc::string& load_key) { + per_host_stores_[hostname].ReportStreamCreated(lb_id, load_key); +} + +void LoadDataStore::ReportStreamClosed(const grpc::string& hostname, + const grpc::string& lb_id) { + auto it_per_host_store = per_host_stores_.find(hostname); + GPR_ASSERT(it_per_host_store != per_host_stores_.end()); + it_per_host_store->second.ReportStreamClosed(lb_id); +} + +} // namespace load_reporter +} // namespace grpc diff --git a/src/cpp/server/load_reporter/load_data_store.h b/src/cpp/server/load_reporter/load_data_store.h new file mode 100644 index 00000000000..feb8b2fd599 --- /dev/null +++ b/src/cpp/server/load_reporter/load_data_store.h @@ -0,0 +1,339 @@ +/* + * + * Copyright 2018 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_SRC_CPP_SERVER_LOAD_REPORTER_LOAD_DATA_STORE_H +#define GRPC_SRC_CPP_SERVER_LOAD_REPORTER_LOAD_DATA_STORE_H + +#include + +#include +#include +#include + +#include +#include + +namespace grpc { +namespace load_reporter { + +constexpr char kInvalidLbId[] = ""; +constexpr uint8_t kLbIdLen = 8; + +// The load data storage is organized in hierarchy. The LoadDataStore is the +// top-level data store. In LoadDataStore, for each host we keep a +// PerHostStore, in which for each balancer we keep a PerBalancerStore. Each +// PerBalancerStore maintains a map of load records, mapping from LoadRecordKey +// to LoadRecordValue. The LoadRecordValue contains a map of customized call +// metrics, mapping from a call metric name to the CallMetricValue. + +// The value of a customized call metric. +class CallMetricValue { + public: + explicit CallMetricValue(uint64_t num_calls = 0, + double total_metric_value = 0) + : num_calls_(num_calls), total_metric_value_(total_metric_value) {} + + void MergeFrom(CallMetricValue other) { + num_calls_ += other.num_calls_; + total_metric_value_ += other.total_metric_value_; + } + + // Getters. + uint64_t num_calls() const { return num_calls_; } + double total_metric_value() const { return total_metric_value_; } + + private: + // The number of calls that finished with this metric. + uint64_t num_calls_ = 0; + // The sum of metric values across all the calls that finished with this + // metric. + double total_metric_value_ = 0; +}; + +// The key of a load record. +class LoadRecordKey { + public: + explicit LoadRecordKey(grpc::string lb_id, grpc::string lb_tag, + grpc::string user_id, grpc::string client_ip_hex) + : lb_id_(std::move(lb_id)), + lb_tag_(std::move(lb_tag)), + user_id_(std::move(user_id)), + client_ip_hex_(std::move(client_ip_hex)) {} + + grpc::string ToString() const { + return "[lb_id_=" + lb_id_ + ", lb_tag_=" + lb_tag_ + + ", user_id_=" + user_id_ + ", client_ip_hex_=" + client_ip_hex_ + + "]"; + } + + bool operator==(const LoadRecordKey& other) const { + return lb_id_ == other.lb_id_ && lb_tag_ == other.lb_tag_ && + user_id_ == other.user_id_ && client_ip_hex_ == other.client_ip_hex_; + } + + // Getters. + const grpc::string& lb_id() const { return lb_id_; } + const grpc::string& lb_tag() const { return lb_tag_; } + const grpc::string& user_id() const { return user_id_; } + const grpc::string& client_ip_hex() const { return client_ip_hex_; } + + struct Hasher { + void hash_combine(size_t* seed, const grpc::string& k) const { + *seed ^= std::hash()(k) + 0x9e3779b9 + (*seed << 6) + + (*seed >> 2); + } + + size_t operator()(const LoadRecordKey& k) const { + size_t h = 0; + hash_combine(&h, k.lb_id_); + hash_combine(&h, k.lb_tag_); + hash_combine(&h, k.user_id_); + hash_combine(&h, k.client_ip_hex_); + return h; + } + }; + + private: + grpc::string lb_id_; + grpc::string lb_tag_; + grpc::string user_id_; + grpc::string client_ip_hex_; +}; + +// The value of a load record. +class LoadRecordValue { + public: + explicit LoadRecordValue(uint64_t start_count = 0, uint64_t ok_count = 0, + uint64_t error_count = 0, double bytes_sent = 0, + double bytes_recv = 0, double latency_ms = 0) + : start_count_(start_count), + ok_count_(ok_count), + error_count_(error_count), + bytes_sent_(bytes_sent), + bytes_recv_(bytes_recv), + latency_ms_(latency_ms) {} + + void MergeFrom(const LoadRecordValue& other) { + start_count_ += other.start_count_; + ok_count_ += other.ok_count_; + error_count_ += other.error_count_; + bytes_sent_ += other.bytes_sent_; + bytes_recv_ += other.bytes_recv_; + latency_ms_ += other.latency_ms_; + for (const auto& p : other.call_metrics_) { + const grpc::string& key = p.first; + const CallMetricValue& value = p.second; + call_metrics_[key].MergeFrom(value); + } + } + + int64_t GetNumCallsInProgressDelta() const { + return static_cast(start_count_ - ok_count_ - error_count_); + } + + grpc::string ToString() const { + return "[start_count_=" + grpc::to_string(start_count_) + + ", ok_count_=" + grpc::to_string(ok_count_) + + ", error_count_=" + grpc::to_string(error_count_) + + ", bytes_sent_=" + grpc::to_string(bytes_sent_) + + ", bytes_recv_=" + grpc::to_string(bytes_recv_) + + ", latency_ms_=" + grpc::to_string(latency_ms_) + "]"; + } + + bool InsertCallMetric(const grpc::string& metric_name, + const CallMetricValue& metric_value) { + return call_metrics_.insert({metric_name, metric_value}).second; + } + + // Getters. + uint64_t start_count() const { return start_count_; } + uint64_t ok_count() const { return ok_count_; } + uint64_t error_count() const { return error_count_; } + double bytes_sent() const { return bytes_sent_; } + double bytes_recv() const { return bytes_recv_; } + double latency_ms() const { return latency_ms_; } + const std::unordered_map& call_metrics() + const { + return call_metrics_; + } + + private: + uint64_t start_count_ = 0; + uint64_t ok_count_ = 0; + uint64_t error_count_ = 0; + double bytes_sent_ = 0; + double bytes_recv_ = 0; + double latency_ms_ = 0; + std::unordered_map call_metrics_; +}; + +// Stores the data associated with a particular LB ID. +class PerBalancerStore { + public: + using LoadRecordMap = + std::unordered_map; + + PerBalancerStore(grpc::string lb_id, grpc::string load_key) + : lb_id_(std::move(lb_id)), load_key_(std::move(load_key)) {} + + // Merge a load record with the given key and value if the store is not + // suspended. + void MergeRow(const LoadRecordKey& key, const LoadRecordValue& value); + + // Suspend this store, so that no detailed load data will be recorded. + void Suspend(); + // Resume this store from suspension. + void Resume(); + // Is this store suspended or not? + bool IsSuspended() const { return suspended_; } + + bool IsNumCallsInProgressChangedSinceLastReport() const { + return num_calls_in_progress_ != last_reported_num_calls_in_progress_; + } + + uint64_t GetNumCallsInProgressForReport(); + + grpc::string ToString() { + return "[PerBalancerStore lb_id_=" + lb_id_ + " load_key_=" + load_key_ + + "]"; + } + + void ClearLoadRecordMap() { load_record_map_.clear(); } + + // Getters. + const grpc::string& lb_id() const { return lb_id_; } + const grpc::string& load_key() const { return load_key_; } + const LoadRecordMap& load_record_map() const { return load_record_map_; } + + private: + grpc::string lb_id_; + // TODO(juanlishen): Use bytestring protobuf type? + grpc::string load_key_; + LoadRecordMap load_record_map_; + uint64_t num_calls_in_progress_ = 0; + uint64_t last_reported_num_calls_in_progress_ = 0; + bool suspended_ = false; +}; + +// Stores the data associated with a particular host. +class PerHostStore { + public: + // When a report stream is created, a PerBalancerStore is created for the + // LB ID (guaranteed unique) associated with that stream. If it is the only + // active store, adopt all the orphaned stores. If it is the first created + // store, adopt the store of kInvalidLbId. + void ReportStreamCreated(const grpc::string& lb_id, + const grpc::string& load_key); + + // When a report stream is closed, the PerBalancerStores assigned to the + // associate LB ID need to be re-assigned to other active balancers, + // ideally with the same load key. If there is no active balancer, we have + // to suspend those stores and drop the incoming load data until they are + // resumed. + void ReportStreamClosed(const grpc::string& lb_id); + + // Returns null if not found. Caller doesn't own the returned store. + PerBalancerStore* FindPerBalancerStore(const grpc::string& lb_id) const; + + // Returns null if lb_id is not found. The returned pointer points to the + // underlying data structure, which is not owned by the caller. + const std::set* GetAssignedStores( + const grpc::string& lb_id) const; + + private: + // Creates a PerBalancerStore for the given LB ID, assigns the store to + // itself, and records the LB ID to the load key. + void SetUpForNewLbId(const grpc::string& lb_id, const grpc::string& load_key); + + void AssignOrphanedStore(PerBalancerStore* orphaned_store, + const grpc::string& new_receiver); + + std::unordered_map> + load_key_to_receiving_lb_ids_; + + // Key: LB ID. The key set includes all the LB IDs that have been + // allocated for reporting streams so far. + // Value: the unique pointer to the PerBalancerStore of the LB ID. + std::unordered_map> + per_balancer_stores_; + + // Key: LB ID. The key set includes the LB IDs of the balancers that are + // currently receiving report. + // Value: the set of raw pointers to the PerBalancerStores assigned to the LB + // ID. Note that the sets in assigned_stores_ form a division of the value set + // of per_balancer_stores_. + std::unordered_map> + assigned_stores_; +}; + +// Thread-unsafe two-level bookkeeper of all the load data. +// Note: We never remove any store objects from this class, as per the +// current spec. That's because premature removal of the store objects +// may lead to loss of critical information, e.g., mapping from lb_id to +// load_key, and the number of in-progress calls. Such loss will cause +// information inconsistency when the balancer is re-connected. Keeping +// all the stores should be fine for PerHostStore, since we assume there +// should only be a few hostnames. But it's a potential problem for +// PerBalancerStore. +class LoadDataStore { + public: + // Returns null if not found. Caller doesn't own the returned store. + PerBalancerStore* FindPerBalancerStore(const grpc::string& hostname, + const grpc::string& lb_id) const; + + // Returns null if hostname or lb_id is not found. The returned pointer points + // to the underlying data structure, which is not owned by the caller. + const std::set* GetAssignedStores(const string& hostname, + const string& lb_id); + + // If a PerBalancerStore can be found by the hostname and LB ID in + // LoadRecordKey, the load data will be merged to that store. Otherwise, + // only track the number of the in-progress calls for this unknown LB ID. + void MergeRow(const grpc::string& hostname, const LoadRecordKey& key, + const LoadRecordValue& value); + + // Is the given lb_id a tracked unknown LB ID (i.e., the LB ID was associated + // with some received load data but unknown to this load data store)? + bool IsTrackedUnknownBalancerId(const grpc::string& lb_id) const { + return unknown_balancer_id_trackers_.find(lb_id) != + unknown_balancer_id_trackers_.end(); + } + + // Wrapper around PerHostStore::ReportStreamCreated. + void ReportStreamCreated(const grpc::string& hostname, + const grpc::string& lb_id, + const grpc::string& load_key); + + // Wrapper around PerHostStore::ReportStreamClosed. + void ReportStreamClosed(const grpc::string& hostname, + const grpc::string& lb_id); + + private: + // Buffered data that was fetched from Census but hasn't been sent to + // balancer. We need to keep this data ourselves because Census will + // delete the data once it's returned. + std::unordered_map per_host_stores_; + + // Tracks the number of in-progress calls for each unknown LB ID. + std::unordered_map unknown_balancer_id_trackers_; +}; + +} // namespace load_reporter +} // namespace grpc + +#endif // GRPC_SRC_CPP_SERVER_LOAD_REPORTER_LOAD_DATA_STORE_H diff --git a/test/cpp/server/load_reporter/BUILD b/test/cpp/server/load_reporter/BUILD new file mode 100644 index 00000000000..5cb3a00f82d --- /dev/null +++ b/test/cpp/server/load_reporter/BUILD @@ -0,0 +1,31 @@ +# Copyright 2017 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. + +licenses(["notice"]) # Apache v2 + +load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary", "grpc_package") + +grpc_package(name = "test/cpp/server/load_reporter") + +grpc_cc_test( + name = "lb_load_data_store_test", + srcs = ["load_data_store_test.cc"], + external_deps = [ + "gtest", + ], + deps = [ + "//:lb_load_data_store", + "//test/core/util:grpc_test_util", + ], +) diff --git a/test/cpp/server/load_reporter/load_data_store_test.cc b/test/cpp/server/load_reporter/load_data_store_test.cc new file mode 100644 index 00000000000..8280dee6a47 --- /dev/null +++ b/test/cpp/server/load_reporter/load_data_store_test.cc @@ -0,0 +1,481 @@ +/* + * + * Copyright 2018 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 + +#include +#include + +#include +#include + +#include "src/cpp/server/load_reporter/load_data_store.h" +#include "test/core/util/port.h" +#include "test/core/util/test_config.h" + +namespace grpc { +namespace testing { +namespace { + +using ::grpc::load_reporter::CallMetricValue; +using ::grpc::load_reporter::LoadDataStore; +using ::grpc::load_reporter::LoadRecordKey; +using ::grpc::load_reporter::LoadRecordValue; +using ::grpc::load_reporter::PerBalancerStore; +using ::grpc::load_reporter::kInvalidLbId; + +class LoadDataStoreTest : public ::testing::Test { + public: + LoadDataStoreTest() + : kKey1(kLbId1, kLbTag1, kUser1, kClientIp1), + kKey2(kLbId2, kLbTag2, kUser2, kClientIp2) {} + + // Check whether per_balancer_stores contains a store which was originally + // created for . + bool PerBalancerStoresContains( + const LoadDataStore& load_data_store, + const std::set* per_balancer_stores, + const grpc::string hostname, const grpc::string lb_id, + const grpc::string load_key) { + auto original_per_balancer_store = + load_data_store.FindPerBalancerStore(hostname, lb_id); + EXPECT_NE(original_per_balancer_store, nullptr); + EXPECT_EQ(original_per_balancer_store->lb_id(), lb_id); + EXPECT_EQ(original_per_balancer_store->load_key(), load_key); + for (auto per_balancer_store : *per_balancer_stores) { + if (per_balancer_store == original_per_balancer_store) { + return true; + } + } + return false; + } + + grpc::string FormatLbId(size_t index) { + return "kLbId" + std::to_string(index); + } + + const grpc::string kHostname1 = "kHostname1"; + const grpc::string kHostname2 = "kHostname2"; + const grpc::string kLbId1 = "kLbId1"; + const grpc::string kLbId2 = "kLbId2"; + const grpc::string kLbId3 = "kLbId3"; + const grpc::string kLbId4 = "kLbId4"; + const grpc::string kLoadKey1 = "kLoadKey1"; + const grpc::string kLoadKey2 = "kLoadKey2"; + const grpc::string kLbTag1 = "kLbTag1"; + const grpc::string kLbTag2 = "kLbTag2"; + const grpc::string kUser1 = "kUser1"; + const grpc::string kUser2 = "kUser2"; + const grpc::string kClientIp1 = "00"; + const grpc::string kClientIp2 = "02"; + const grpc::string kMetric1 = "kMetric1"; + const grpc::string kMetric2 = "kMetric2"; + const LoadRecordKey kKey1; + const LoadRecordKey kKey2; +}; + +using PerBalancerStoreTest = LoadDataStoreTest; + +TEST_F(LoadDataStoreTest, AssignToSelf) { + LoadDataStore load_data_store; + load_data_store.ReportStreamCreated(kHostname1, kLbId1, kLoadKey1); + auto assigned_stores = load_data_store.GetAssignedStores(kHostname1, kLbId1); + EXPECT_TRUE(PerBalancerStoresContains(load_data_store, assigned_stores, + kHostname1, kLbId1, kLoadKey1)); +} + +TEST_F(LoadDataStoreTest, ReassignOrphanStores) { + LoadDataStore load_data_store; + load_data_store.ReportStreamCreated(kHostname1, kLbId1, kLoadKey1); + load_data_store.ReportStreamCreated(kHostname1, kLbId2, kLoadKey1); + load_data_store.ReportStreamCreated(kHostname1, kLbId3, kLoadKey2); + load_data_store.ReportStreamCreated(kHostname2, kLbId4, kLoadKey1); + // 1. Close the second stream. + load_data_store.ReportStreamClosed(kHostname1, kLbId2); + auto assigned_to_lb_id_1 = + load_data_store.GetAssignedStores(kHostname1, kLbId1); + // The orphaned store is re-assigned to kLbId1 with the same load key. + EXPECT_TRUE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_1, + kHostname1, kLbId1, kLoadKey1)); + EXPECT_TRUE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_1, + kHostname1, kLbId2, kLoadKey1)); + // 2. Close the first stream. + load_data_store.ReportStreamClosed(kHostname1, kLbId1); + auto assigned_to_lb_id_3 = + load_data_store.GetAssignedStores(kHostname1, kLbId3); + // The orphaned stores are re-assigned to kLbId3 with the same host, + // because there isn't any LB with the same load key. + EXPECT_TRUE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_3, + kHostname1, kLbId1, kLoadKey1)); + EXPECT_TRUE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_3, + kHostname1, kLbId2, kLoadKey1)); + EXPECT_TRUE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_3, + kHostname1, kLbId3, kLoadKey2)); + // 3. Close the third stream. + load_data_store.ReportStreamClosed(kHostname1, kLbId3); + auto assigned_to_lb_id_4 = + load_data_store.GetAssignedStores(kHostname2, kLbId4); + // There is no active LB for the first host now. kLbId4 is active but + // it's for the second host, so it wll NOT adopt the orphaned stores. + EXPECT_FALSE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_4, + kHostname1, kLbId1, kLoadKey1)); + EXPECT_FALSE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_4, + kHostname1, kLbId2, kLoadKey1)); + EXPECT_FALSE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_4, + kHostname1, kLbId3, kLoadKey2)); + EXPECT_TRUE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_4, + kHostname2, kLbId4, kLoadKey1)); +} + +TEST_F(LoadDataStoreTest, OrphanAssignmentIsSticky) { + LoadDataStore load_data_store; + std::set active_lb_ids; + size_t num_lb_ids = 1000; + for (size_t i = 0; i < num_lb_ids; ++i) { + load_data_store.ReportStreamCreated(kHostname1, FormatLbId(i), kLoadKey1); + active_lb_ids.insert(FormatLbId(i)); + } + grpc::string orphaned_lb_id = FormatLbId(std::rand() % num_lb_ids); + load_data_store.ReportStreamClosed(kHostname1, orphaned_lb_id); + active_lb_ids.erase(orphaned_lb_id); + // Find which LB is assigned the orphaned store. + grpc::string assigned_lb_id = ""; + for (auto lb_id : active_lb_ids) { + if (PerBalancerStoresContains( + load_data_store, + load_data_store.GetAssignedStores(kHostname1, lb_id), kHostname1, + orphaned_lb_id, kLoadKey1)) { + assigned_lb_id = lb_id; + break; + } + } + EXPECT_STRNE(assigned_lb_id.c_str(), ""); + // Close 10 more stream, skipping the assigned_lb_id. The assignment of + // orphaned_lb_id shouldn't change. + for (size_t _ = 0; _ < 10; ++_) { + grpc::string lb_id_to_close = ""; + for (auto lb_id : active_lb_ids) { + if (lb_id != assigned_lb_id) { + lb_id_to_close = lb_id; + break; + } + } + EXPECT_STRNE(lb_id_to_close.c_str(), ""); + load_data_store.ReportStreamClosed(kHostname1, lb_id_to_close); + active_lb_ids.erase(lb_id_to_close); + EXPECT_TRUE(PerBalancerStoresContains( + load_data_store, + load_data_store.GetAssignedStores(kHostname1, assigned_lb_id), + kHostname1, orphaned_lb_id, kLoadKey1)); + } + // Close the assigned_lb_id, orphaned_lb_id will be re-assigned again. + load_data_store.ReportStreamClosed(kHostname1, assigned_lb_id); + active_lb_ids.erase(assigned_lb_id); + size_t orphaned_lb_id_occurences = 0; + for (auto lb_id : active_lb_ids) { + if (PerBalancerStoresContains( + load_data_store, + load_data_store.GetAssignedStores(kHostname1, lb_id), kHostname1, + orphaned_lb_id, kLoadKey1)) { + orphaned_lb_id_occurences++; + } + } + EXPECT_EQ(orphaned_lb_id_occurences, 1U); +} + +TEST_F(LoadDataStoreTest, HostTemporarilyLoseAllStreams) { + LoadDataStore load_data_store; + load_data_store.ReportStreamCreated(kHostname1, kLbId1, kLoadKey1); + load_data_store.ReportStreamCreated(kHostname2, kLbId2, kLoadKey1); + auto store_lb_id_1 = load_data_store.FindPerBalancerStore(kHostname1, kLbId1); + auto store_invalid_lb_id_1 = + load_data_store.FindPerBalancerStore(kHostname1, kInvalidLbId); + EXPECT_FALSE(store_lb_id_1->IsSuspended()); + EXPECT_FALSE(store_invalid_lb_id_1->IsSuspended()); + // Disconnect all the streams of the first host. + load_data_store.ReportStreamClosed(kHostname1, kLbId1); + // All the streams of that host are suspended. + EXPECT_TRUE(store_lb_id_1->IsSuspended()); + EXPECT_TRUE(store_invalid_lb_id_1->IsSuspended()); + // Detailed load data won't be kept when the PerBalancerStore is suspended. + store_lb_id_1->MergeRow(kKey1, LoadRecordValue()); + store_invalid_lb_id_1->MergeRow(kKey1, LoadRecordValue()); + EXPECT_EQ(store_lb_id_1->load_record_map().size(), 0U); + EXPECT_EQ(store_invalid_lb_id_1->load_record_map().size(), 0U); + // The stores for different hosts won't mix, even if the load key is the same. + auto assigned_to_lb_id_2 = + load_data_store.GetAssignedStores(kHostname2, kLbId2); + EXPECT_EQ(assigned_to_lb_id_2->size(), 2U); + EXPECT_TRUE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_2, + kHostname2, kLbId2, kLoadKey1)); + EXPECT_TRUE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_2, + kHostname2, kInvalidLbId, "")); + // A new stream is created for the first host. + load_data_store.ReportStreamCreated(kHostname1, kLbId3, kLoadKey2); + // The stores for the first host are resumed. + EXPECT_FALSE(store_lb_id_1->IsSuspended()); + EXPECT_FALSE(store_invalid_lb_id_1->IsSuspended()); + store_lb_id_1->MergeRow(kKey1, LoadRecordValue()); + store_invalid_lb_id_1->MergeRow(kKey1, LoadRecordValue()); + EXPECT_EQ(store_lb_id_1->load_record_map().size(), 1U); + EXPECT_EQ(store_invalid_lb_id_1->load_record_map().size(), 1U); + // The resumed stores are assigned to the new LB. + auto assigned_to_lb_id_3 = + load_data_store.GetAssignedStores(kHostname1, kLbId3); + EXPECT_EQ(assigned_to_lb_id_3->size(), 3U); + EXPECT_TRUE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_3, + kHostname1, kLbId1, kLoadKey1)); + EXPECT_TRUE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_3, + kHostname1, kInvalidLbId, "")); + EXPECT_TRUE(PerBalancerStoresContains(load_data_store, assigned_to_lb_id_3, + kHostname1, kLbId3, kLoadKey2)); +} + +TEST_F(LoadDataStoreTest, OneStorePerLbId) { + LoadDataStore load_data_store; + EXPECT_EQ(load_data_store.FindPerBalancerStore(kHostname1, kLbId1), nullptr); + EXPECT_EQ(load_data_store.FindPerBalancerStore(kHostname1, kInvalidLbId), + nullptr); + EXPECT_EQ(load_data_store.FindPerBalancerStore(kHostname2, kLbId2), nullptr); + EXPECT_EQ(load_data_store.FindPerBalancerStore(kHostname2, kLbId3), nullptr); + // Create The first stream. + load_data_store.ReportStreamCreated(kHostname1, kLbId1, kLoadKey1); + auto store_lb_id_1 = load_data_store.FindPerBalancerStore(kHostname1, kLbId1); + auto store_invalid_lb_id_1 = + load_data_store.FindPerBalancerStore(kHostname1, kInvalidLbId); + // Two stores will be created: one is for the stream; the other one is for + // kInvalidLbId. + EXPECT_NE(store_lb_id_1, nullptr); + EXPECT_NE(store_invalid_lb_id_1, nullptr); + EXPECT_NE(store_lb_id_1, store_invalid_lb_id_1); + EXPECT_EQ(load_data_store.FindPerBalancerStore(kHostname2, kLbId2), nullptr); + EXPECT_EQ(load_data_store.FindPerBalancerStore(kHostname2, kLbId3), nullptr); + // Create the second stream. + load_data_store.ReportStreamCreated(kHostname2, kLbId3, kLoadKey1); + auto store_lb_id_3 = load_data_store.FindPerBalancerStore(kHostname2, kLbId3); + auto store_invalid_lb_id_2 = + load_data_store.FindPerBalancerStore(kHostname2, kInvalidLbId); + EXPECT_NE(store_lb_id_3, nullptr); + EXPECT_NE(store_invalid_lb_id_2, nullptr); + EXPECT_NE(store_lb_id_3, store_invalid_lb_id_2); + // The PerBalancerStores created for different hosts are independent. + EXPECT_NE(store_lb_id_3, store_invalid_lb_id_1); + EXPECT_NE(store_invalid_lb_id_2, store_invalid_lb_id_1); + EXPECT_EQ(load_data_store.FindPerBalancerStore(kHostname2, kLbId2), nullptr); +} + +TEST_F(LoadDataStoreTest, ExactlyOnceAssignment) { + LoadDataStore load_data_store; + size_t num_create = 100; + size_t num_close = 50; + for (size_t i = 0; i < num_create; ++i) { + load_data_store.ReportStreamCreated(kHostname1, FormatLbId(i), kLoadKey1); + } + for (size_t i = 0; i < num_close; ++i) { + load_data_store.ReportStreamClosed(kHostname1, FormatLbId(i)); + } + std::set reported_lb_ids; + for (size_t i = num_close; i < num_create; ++i) { + for (auto assigned_store : + *load_data_store.GetAssignedStores(kHostname1, FormatLbId(i))) { + EXPECT_TRUE(reported_lb_ids.insert(assigned_store->lb_id()).second); + } + } + // Add one for kInvalidLbId. + EXPECT_EQ(reported_lb_ids.size(), (num_create + 1)); + EXPECT_NE(reported_lb_ids.find(kInvalidLbId), reported_lb_ids.end()); +} + +TEST_F(LoadDataStoreTest, UnknownBalancerIdTracking) { + LoadDataStore load_data_store; + load_data_store.ReportStreamCreated(kHostname1, kLbId1, kLoadKey1); + // Merge data for a known LB ID. + LoadRecordValue v1(192); + load_data_store.MergeRow(kHostname1, kKey1, v1); + // Merge data for unknown LB ID. + LoadRecordValue v2(23); + EXPECT_FALSE(load_data_store.IsTrackedUnknownBalancerId(kLbId2)); + load_data_store.MergeRow( + kHostname1, LoadRecordKey(kLbId2, kLbTag1, kUser1, kClientIp1), v2); + EXPECT_TRUE(load_data_store.IsTrackedUnknownBalancerId(kLbId2)); + LoadRecordValue v3(952); + load_data_store.MergeRow( + kHostname2, LoadRecordKey(kLbId3, kLbTag1, kUser1, kClientIp1), v3); + EXPECT_TRUE(load_data_store.IsTrackedUnknownBalancerId(kLbId3)); + // The data kept for a known LB ID is correct. + auto store_lb_id_1 = load_data_store.FindPerBalancerStore(kHostname1, kLbId1); + EXPECT_EQ(store_lb_id_1->load_record_map().size(), 1U); + EXPECT_EQ(store_lb_id_1->load_record_map().find(kKey1)->second.start_count(), + v1.start_count()); + EXPECT_EQ(store_lb_id_1->GetNumCallsInProgressForReport(), v1.start_count()); + // No PerBalancerStore created for Unknown LB ID. + EXPECT_EQ(load_data_store.FindPerBalancerStore(kHostname1, kLbId2), nullptr); + EXPECT_EQ(load_data_store.FindPerBalancerStore(kHostname2, kLbId3), nullptr); + // End all the started RPCs for kLbId1. + LoadRecordValue v4(0, v1.start_count()); + load_data_store.MergeRow(kHostname1, kKey1, v4); + EXPECT_EQ(store_lb_id_1->load_record_map().size(), 1U); + EXPECT_EQ(store_lb_id_1->load_record_map().find(kKey1)->second.start_count(), + v1.start_count()); + EXPECT_EQ(store_lb_id_1->load_record_map().find(kKey1)->second.ok_count(), + v4.ok_count()); + EXPECT_EQ(store_lb_id_1->GetNumCallsInProgressForReport(), 0U); + EXPECT_FALSE(load_data_store.IsTrackedUnknownBalancerId(kLbId1)); + // End all the started RPCs for kLbId2. + LoadRecordValue v5(0, v2.start_count()); + load_data_store.MergeRow( + kHostname1, LoadRecordKey(kLbId2, kLbTag1, kUser1, kClientIp1), v5); + EXPECT_FALSE(load_data_store.IsTrackedUnknownBalancerId(kLbId2)); + // End some of the started RPCs for kLbId3. + LoadRecordValue v6(0, v3.start_count() / 2); + load_data_store.MergeRow( + kHostname2, LoadRecordKey(kLbId3, kLbTag1, kUser1, kClientIp1), v6); + EXPECT_TRUE(load_data_store.IsTrackedUnknownBalancerId(kLbId3)); +} + +TEST_F(PerBalancerStoreTest, Suspend) { + PerBalancerStore per_balancer_store(kLbId1, kLoadKey1); + EXPECT_FALSE(per_balancer_store.IsSuspended()); + // Suspend the store. + per_balancer_store.Suspend(); + EXPECT_TRUE(per_balancer_store.IsSuspended()); + EXPECT_EQ(0U, per_balancer_store.load_record_map().size()); + // Data merged when the store is suspended won't be kept. + LoadRecordValue v1(139, 19); + per_balancer_store.MergeRow(kKey1, v1); + EXPECT_EQ(0U, per_balancer_store.load_record_map().size()); + // Resume the store. + per_balancer_store.Resume(); + EXPECT_FALSE(per_balancer_store.IsSuspended()); + EXPECT_EQ(0U, per_balancer_store.load_record_map().size()); + // Data merged after the store is resumed will be kept. + LoadRecordValue v2(23, 0, 51); + per_balancer_store.MergeRow(kKey1, v2); + EXPECT_EQ(1U, per_balancer_store.load_record_map().size()); + // Suspend the store. + per_balancer_store.Suspend(); + EXPECT_TRUE(per_balancer_store.IsSuspended()); + EXPECT_EQ(0U, per_balancer_store.load_record_map().size()); + // Data merged when the store is suspended won't be kept. + LoadRecordValue v3(62, 11); + per_balancer_store.MergeRow(kKey1, v3); + EXPECT_EQ(0U, per_balancer_store.load_record_map().size()); + // Resume the store. + per_balancer_store.Resume(); + EXPECT_FALSE(per_balancer_store.IsSuspended()); + EXPECT_EQ(0U, per_balancer_store.load_record_map().size()); + // Data merged after the store is resumed will be kept. + LoadRecordValue v4(225, 98); + per_balancer_store.MergeRow(kKey1, v4); + EXPECT_EQ(1U, per_balancer_store.load_record_map().size()); + // In-progress count is always kept. + EXPECT_EQ(per_balancer_store.GetNumCallsInProgressForReport(), + v1.start_count() - v1.ok_count() + v2.start_count() - + v2.error_count() + v3.start_count() - v3.ok_count() + + v4.start_count() - v4.ok_count()); +} + +TEST_F(PerBalancerStoreTest, DataAggregation) { + PerBalancerStore per_balancer_store(kLbId1, kLoadKey1); + // Construct some Values. + LoadRecordValue v1(992, 34, 13, 234.0, 164.0, 173467.38); + v1.InsertCallMetric(kMetric1, CallMetricValue(3, 2773.2)); + LoadRecordValue v2(4842, 213, 9, 393.0, 974.0, 1345.2398); + v2.InsertCallMetric(kMetric1, CallMetricValue(7, 25.234)); + v2.InsertCallMetric(kMetric2, CallMetricValue(2, 387.08)); + // v3 doesn't change the number of in-progress RPCs. + LoadRecordValue v3(293, 55, 293 - 55, 28764, 5284, 5772); + v3.InsertCallMetric(kMetric1, CallMetricValue(61, 3465.0)); + v3.InsertCallMetric(kMetric2, CallMetricValue(13, 672.0)); + // The initial state of the store. + uint64_t num_calls_in_progress = 0; + EXPECT_FALSE(per_balancer_store.IsNumCallsInProgressChangedSinceLastReport()); + EXPECT_EQ(per_balancer_store.GetNumCallsInProgressForReport(), + num_calls_in_progress); + // Merge v1 and get report of the number of in-progress calls. + per_balancer_store.MergeRow(kKey1, v1); + EXPECT_TRUE(per_balancer_store.IsNumCallsInProgressChangedSinceLastReport()); + EXPECT_EQ(per_balancer_store.GetNumCallsInProgressForReport(), + num_calls_in_progress += + (v1.start_count() - v1.ok_count() - v1.error_count())); + EXPECT_FALSE(per_balancer_store.IsNumCallsInProgressChangedSinceLastReport()); + // Merge v2 and get report of the number of in-progress calls. + per_balancer_store.MergeRow(kKey2, v2); + EXPECT_TRUE(per_balancer_store.IsNumCallsInProgressChangedSinceLastReport()); + EXPECT_EQ(per_balancer_store.GetNumCallsInProgressForReport(), + num_calls_in_progress += + (v2.start_count() - v2.ok_count() - v2.error_count())); + EXPECT_FALSE(per_balancer_store.IsNumCallsInProgressChangedSinceLastReport()); + // Merge v3 and get report of the number of in-progress calls. + per_balancer_store.MergeRow(kKey1, v3); + EXPECT_FALSE(per_balancer_store.IsNumCallsInProgressChangedSinceLastReport()); + EXPECT_EQ(per_balancer_store.GetNumCallsInProgressForReport(), + num_calls_in_progress); + // LoadRecordValue for kKey1 is aggregated correctly. + LoadRecordValue value_for_key1 = + per_balancer_store.load_record_map().find(kKey1)->second; + EXPECT_EQ(value_for_key1.start_count(), v1.start_count() + v3.start_count()); + EXPECT_EQ(value_for_key1.ok_count(), v1.ok_count() + v3.ok_count()); + EXPECT_EQ(value_for_key1.error_count(), v1.error_count() + v3.error_count()); + EXPECT_EQ(value_for_key1.bytes_sent(), v1.bytes_sent() + v3.bytes_sent()); + EXPECT_EQ(value_for_key1.bytes_recv(), v1.bytes_recv() + v3.bytes_recv()); + EXPECT_EQ(value_for_key1.latency_ms(), v1.latency_ms() + v3.latency_ms()); + EXPECT_EQ(value_for_key1.call_metrics().size(), 2U); + EXPECT_EQ(value_for_key1.call_metrics().find(kMetric1)->second.num_calls(), + v1.call_metrics().find(kMetric1)->second.num_calls() + + v3.call_metrics().find(kMetric1)->second.num_calls()); + EXPECT_EQ( + value_for_key1.call_metrics().find(kMetric1)->second.total_metric_value(), + v1.call_metrics().find(kMetric1)->second.total_metric_value() + + v3.call_metrics().find(kMetric1)->second.total_metric_value()); + EXPECT_EQ(value_for_key1.call_metrics().find(kMetric2)->second.num_calls(), + v3.call_metrics().find(kMetric2)->second.num_calls()); + EXPECT_EQ( + value_for_key1.call_metrics().find(kMetric2)->second.total_metric_value(), + v3.call_metrics().find(kMetric2)->second.total_metric_value()); + // LoadRecordValue for kKey2 is aggregated (trivially) correctly. + LoadRecordValue value_for_key2 = + per_balancer_store.load_record_map().find(kKey2)->second; + EXPECT_EQ(value_for_key2.start_count(), v2.start_count()); + EXPECT_EQ(value_for_key2.ok_count(), v2.ok_count()); + EXPECT_EQ(value_for_key2.error_count(), v2.error_count()); + EXPECT_EQ(value_for_key2.bytes_sent(), v2.bytes_sent()); + EXPECT_EQ(value_for_key2.bytes_recv(), v2.bytes_recv()); + EXPECT_EQ(value_for_key2.latency_ms(), v2.latency_ms()); + EXPECT_EQ(value_for_key2.call_metrics().size(), 2U); + EXPECT_EQ(value_for_key2.call_metrics().find(kMetric1)->second.num_calls(), + v2.call_metrics().find(kMetric1)->second.num_calls()); + EXPECT_EQ( + value_for_key2.call_metrics().find(kMetric1)->second.total_metric_value(), + v2.call_metrics().find(kMetric1)->second.total_metric_value()); + EXPECT_EQ(value_for_key2.call_metrics().find(kMetric2)->second.num_calls(), + v2.call_metrics().find(kMetric2)->second.num_calls()); + EXPECT_EQ( + value_for_key2.call_metrics().find(kMetric2)->second.total_metric_value(), + v2.call_metrics().find(kMetric2)->second.total_metric_value()); +} + +} // namespace +} // namespace testing +} // namespace grpc + +int main(int argc, char** argv) { + grpc_test_init(argc, argv); + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 41722e063d5..9092125a54a 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -3903,6 +3903,26 @@ "third_party": false, "type": "target" }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc++", + "grpc++_test_util", + "grpc_test_util", + "lb_load_data_store" + ], + "headers": [], + "is_filegroup": false, + "language": "c++", + "name": "lb_load_data_store_test", + "src": [ + "test/cpp/server/load_reporter/load_data_store_test.cc" + ], + "third_party": false, + "type": "target" + }, { "deps": [ "gpr", @@ -7467,6 +7487,23 @@ "third_party": false, "type": "lib" }, + { + "deps": [ + "grpc++" + ], + "headers": [ + "src/cpp/server/load_reporter/load_data_store.h" + ], + "is_filegroup": false, + "language": "c++", + "name": "lb_load_data_store", + "src": [ + "src/cpp/server/load_reporter/load_data_store.cc", + "src/cpp/server/load_reporter/load_data_store.h" + ], + "third_party": false, + "type": "lib" + }, { "deps": [ "grpc", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 067d9b300d3..8eb5303e823 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -4389,6 +4389,30 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "lb_load_data_store_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": true + }, { "args": [], "benchmark": false, From 269e54ebe353d4161a48675128ca8c3141d3b5c8 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 1 May 2018 11:25:00 -0700 Subject: [PATCH 134/165] Maintain ref to LB policy. --- .../lb_policy/pick_first/pick_first.cc | 12 +++++++++++- .../lb_policy/round_robin/round_robin.cc | 9 ++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 92e738c7bd4..a00341b24e2 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -90,7 +90,17 @@ class PickFirst : public LoadBalancingPolicy { grpc_client_channel_factory* client_channel_factory, const grpc_channel_args& args) : SubchannelList(policy, tracer, addresses, combiner, - client_channel_factory, args) {} + client_channel_factory, args) { + // Need to maintain a ref to the LB policy as long as we maintain + // any references to subchannels, since the subchannels' + // pollset_sets will include the LB policy's pollset_set. + policy->Ref(DEBUG_LOCATION, "subchannel_list").release(); + } + + ~PickFirstSubchannelList() { + PickFirst* p = static_cast(policy()); + p->Unref(DEBUG_LOCATION, "subchannel_list"); + } }; void ShutdownLocked() override; diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index ba9d9af438a..79e8ad56633 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -136,10 +136,17 @@ class RoundRobin : public LoadBalancingPolicy { grpc_client_channel_factory* client_channel_factory, const grpc_channel_args& args) : SubchannelList(policy, tracer, addresses, combiner, - client_channel_factory, args) {} + client_channel_factory, args) { + // Need to maintain a ref to the LB policy as long as we maintain + // any references to subchannels, since the subchannels' + // pollset_sets will include the LB policy's pollset_set. + policy->Ref(DEBUG_LOCATION, "subchannel_list").release(); + } ~RoundRobinSubchannelList() { GRPC_ERROR_UNREF(last_transient_failure_error_); + RoundRobin* p = static_cast(policy()); + p->Unref(DEBUG_LOCATION, "subchannel_list"); } // Starts watching the subchannels in this list. From 65a544241d3aefbb230990e2ba9f144f2acb6da5 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 1 May 2018 11:49:15 -0700 Subject: [PATCH 135/165] clang-format --- .../client_channel/lb_policy/pick_first/pick_first.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index a00341b24e2..41ca2d42114 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -404,7 +404,8 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( if (grpc_lb_pick_first_trace.enabled()) { gpr_log(GPR_INFO, "Pick First %p promoting pending subchannel list %p to " - "replace %p", p, p->latest_pending_subchannel_list_.get(), + "replace %p", + p, p->latest_pending_subchannel_list_.get(), p->subchannel_list_.get()); } p->selected_ = nullptr; @@ -463,7 +464,8 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked( if (grpc_lb_pick_first_trace.enabled()) { gpr_log(GPR_INFO, "Pick First %p promoting pending subchannel list %p to " - "replace %p", p, p->latest_pending_subchannel_list_.get(), + "replace %p", + p, p->latest_pending_subchannel_list_.get(), p->subchannel_list_.get()); } p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); From 026b20eebba34889892b07a16ebe7ec6b674c404 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 1 May 2018 14:52:03 -0700 Subject: [PATCH 136/165] Fix error refcounting bug. --- .../filters/client_channel/lb_policy/pick_first/pick_first.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 41ca2d42114..76df9766983 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -359,6 +359,7 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { latest_pending_subchannel_list_.reset(); return; } + GRPC_ERROR_UNREF(error); } } // Not keeping the previous selected subchannel, so set the latest From 2d3186eee47a368829227bc7458e6630e79d2d5f Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Tue, 1 May 2018 17:09:01 -0700 Subject: [PATCH 137/165] Use Bazel 0.12.0 --- tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh | 4 ++-- tools/internal_ci/linux/grpc_msan_on_foundry.sh | 4 ++-- tools/internal_ci/linux/grpc_ubsan_on_foundry.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh index 3102992beff..8a479bddf63 100755 --- a/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh @@ -22,8 +22,8 @@ mkdir -p ${KOKORO_KEYSTORE_DIR} cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service temp_dir=$(mktemp -d) -ln -f "${KOKORO_GFILE_DIR}/bazel-canary" ${temp_dir}/bazel -chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" +ln -f "${KOKORO_GFILE_DIR}/bazel-release-0.12.0" ${temp_dir}/bazel +chmod 755 "${KOKORO_GFILE_DIR}/bazel-release-0.12.0" export PATH="${temp_dir}:${PATH}" # This should show ${temp_dir}/bazel which bazel diff --git a/tools/internal_ci/linux/grpc_msan_on_foundry.sh b/tools/internal_ci/linux/grpc_msan_on_foundry.sh index 6858d971cb7..390ca3428de 100644 --- a/tools/internal_ci/linux/grpc_msan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_msan_on_foundry.sh @@ -23,8 +23,8 @@ mkdir -p ${KOKORO_KEYSTORE_DIR} cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service temp_dir=$(mktemp -d) -ln -f "${KOKORO_GFILE_DIR}/bazel-canary" ${temp_dir}/bazel -chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" +ln -f "${KOKORO_GFILE_DIR}/bazel-release-0.12.0" ${temp_dir}/bazel +chmod 755 "${KOKORO_GFILE_DIR}/bazel-release-0.12.0" export PATH="${temp_dir}:${PATH}" # This should show ${temp_dir}/bazel which bazel diff --git a/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh b/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh index 0f0c12db12b..ba50011e5b8 100644 --- a/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh @@ -23,8 +23,8 @@ mkdir -p ${KOKORO_KEYSTORE_DIR} cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service temp_dir=$(mktemp -d) -ln -f "${KOKORO_GFILE_DIR}/bazel-canary" ${temp_dir}/bazel -chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" +ln -f "${KOKORO_GFILE_DIR}/bazel-release-0.12.0" ${temp_dir}/bazel +chmod 755 "${KOKORO_GFILE_DIR}/bazel-release-0.12.0" export PATH="${temp_dir}:${PATH}" # This should show ${temp_dir}/bazel which bazel From ca7ba4d0ac3ab452c5db60befc8be37fd6e2339b Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Fri, 20 Apr 2018 02:49:34 +0000 Subject: [PATCH 138/165] Keep Core memory inside cygrpc.Channel objects This removes invocation-side completion queues from the _cygrpc API. Invocation-side calls are changed to no longer share the same lifetime as Core calls. Illegal metadata is now detected on invocation rather than at the start of a batch (so passing illegal metadata to a response-streaming method will now raise an exception immediately rather than later on when attempting to read the first response message). It is no longer possible to create a call without immediately starting at least one batch of operations on it. Only tests are affected by this change; there are no real use cases in which one wants to start a call but wait a little while before learning that the server has rejected it. It is now required that code above cygrpc.Channel spend threads on next_event whenever events are pending. A cygrpc.Channel.close method is introduced, but it merely blocks until the cygrpc.Channel's completion queues are drained; it does not itself drain them. Noteworthy here is that we drop the cygrpc.Channel.__dealloc__ method. It is not the same as __del__ (which is not something that can be added to cygrpc.Channel) and there is no guarantee that __dealloc__ will be called at all or that it will be called while the cygrpc.Channel instance's Python attributes are intact (in testing, I saw both in different environments). This commit does not knowingly break any garbage-collection-based memory management working (or "happening to appear to work in some circumstances"), though if it does, the proper remedy is to call grpc.Channel.close... which is the objective towards which this commit builds. --- src/python/grpcio/grpc/_channel.py | 381 +++++++------- .../grpc/_cython/_cygrpc/channel.pxd.pxi | 56 +- .../grpc/_cython/_cygrpc/channel.pyx.pxi | 477 +++++++++++++++--- .../_cython/_cygrpc/completion_queue.pxd.pxi | 8 +- .../_cython/_cygrpc/completion_queue.pyx.pxi | 93 ++-- .../unit/_cython/_cancel_many_calls_test.py | 50 +- .../tests/unit/_cython/_channel_test.py | 28 +- .../tests/unit/_cython/_common.py | 3 +- ...s_server_completion_queue_per_call_test.py | 54 +- ...ges_single_server_completion_queue_test.py | 55 +- .../_read_some_but_not_all_responses_test.py | 73 ++- .../tests/unit/_cython/cygrpc_test.py | 112 ++-- .../tests/unit/_invalid_metadata_test.py | 49 +- 13 files changed, 911 insertions(+), 528 deletions(-) diff --git a/src/python/grpcio/grpc/_channel.py b/src/python/grpcio/grpc/_channel.py index 2eff08aa573..6604f8f35c0 100644 --- a/src/python/grpcio/grpc/_channel.py +++ b/src/python/grpcio/grpc/_channel.py @@ -79,27 +79,6 @@ def _wait_once_until(condition, until): condition.wait(timeout=remaining) -_INTERNAL_CALL_ERROR_MESSAGE_FORMAT = ( - 'Internal gRPC call error %d. ' + - 'Please report to https://github.com/grpc/grpc/issues') - - -def _check_call_error(call_error, metadata): - if call_error == cygrpc.CallError.invalid_metadata: - raise ValueError('metadata was invalid: %s' % metadata) - elif call_error != cygrpc.CallError.ok: - raise ValueError(_INTERNAL_CALL_ERROR_MESSAGE_FORMAT % call_error) - - -def _call_error_set_RPCstate(state, call_error, metadata): - if call_error == cygrpc.CallError.invalid_metadata: - _abort(state, grpc.StatusCode.INTERNAL, - 'metadata was invalid: %s' % metadata) - else: - _abort(state, grpc.StatusCode.INTERNAL, - _INTERNAL_CALL_ERROR_MESSAGE_FORMAT % call_error) - - class _RPCState(object): def __init__(self, due, initial_metadata, trailing_metadata, code, details): @@ -163,7 +142,7 @@ def _handle_event(event, state, response_deserializer): return callbacks -def _event_handler(state, call, response_deserializer): +def _event_handler(state, response_deserializer): def handle_event(event): with state.condition: @@ -172,40 +151,47 @@ def _event_handler(state, call, response_deserializer): done = not state.due for callback in callbacks: callback() - return call if done else None + return done return handle_event -def _consume_request_iterator(request_iterator, state, call, - request_serializer): - event_handler = _event_handler(state, call, None) +def _consume_request_iterator(request_iterator, state, call, request_serializer, + event_handler): - def consume_request_iterator(): + def consume_request_iterator(): # pylint: disable=too-many-branches while True: try: request = next(request_iterator) except StopIteration: break except Exception: # pylint: disable=broad-except - logging.exception("Exception iterating requests!") - call.cancel() - _abort(state, grpc.StatusCode.UNKNOWN, - "Exception iterating requests!") + code = grpc.StatusCode.UNKNOWN + details = 'Exception iterating requests!' + logging.exception(details) + call.cancel(_common.STATUS_CODE_TO_CYGRPC_STATUS_CODE[code], + details) + _abort(state, code, details) return serialized_request = _common.serialize(request, request_serializer) with state.condition: if state.code is None and not state.cancelled: if serialized_request is None: - call.cancel() + code = grpc.StatusCode.INTERNAL # pylint: disable=redefined-variable-type details = 'Exception serializing request!' - _abort(state, grpc.StatusCode.INTERNAL, details) + call.cancel( + _common.STATUS_CODE_TO_CYGRPC_STATUS_CODE[code], + details) + _abort(state, code, details) return else: operations = (cygrpc.SendMessageOperation( serialized_request, _EMPTY_FLAGS),) - call.start_client_batch(operations, event_handler) - state.due.add(cygrpc.OperationType.send_message) + operating = call.operate(operations, event_handler) + if operating: + state.due.add(cygrpc.OperationType.send_message) + else: + return while True: state.condition.wait() if state.code is None: @@ -219,15 +205,19 @@ def _consume_request_iterator(request_iterator, state, call, if state.code is None: operations = ( cygrpc.SendCloseFromClientOperation(_EMPTY_FLAGS),) - call.start_client_batch(operations, event_handler) - state.due.add(cygrpc.OperationType.send_close_from_client) + operating = call.operate(operations, event_handler) + if operating: + state.due.add(cygrpc.OperationType.send_close_from_client) def stop_consumption_thread(timeout): # pylint: disable=unused-argument with state.condition: if state.code is None: - call.cancel() + code = grpc.StatusCode.CANCELLED + details = 'Consumption thread cleaned up!' + call.cancel(_common.STATUS_CODE_TO_CYGRPC_STATUS_CODE[code], + details) state.cancelled = True - _abort(state, grpc.StatusCode.CANCELLED, 'Cancelled!') + _abort(state, code, details) state.condition.notify_all() consumption_thread = _common.CleanupThread( @@ -247,9 +237,12 @@ class _Rendezvous(grpc.RpcError, grpc.Future, grpc.Call): def cancel(self): with self._state.condition: if self._state.code is None: - self._call.cancel() + code = grpc.StatusCode.CANCELLED + details = 'Locally cancelled by application!' + self._call.cancel( + _common.STATUS_CODE_TO_CYGRPC_STATUS_CODE[code], details) self._state.cancelled = True - _abort(self._state, grpc.StatusCode.CANCELLED, 'Cancelled!') + _abort(self._state, code, details) self._state.condition.notify_all() return False @@ -318,12 +311,13 @@ class _Rendezvous(grpc.RpcError, grpc.Future, grpc.Call): def _next(self): with self._state.condition: if self._state.code is None: - event_handler = _event_handler(self._state, self._call, + event_handler = _event_handler(self._state, self._response_deserializer) - self._call.start_client_batch( + operating = self._call.operate( (cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS),), event_handler) - self._state.due.add(cygrpc.OperationType.receive_message) + if operating: + self._state.due.add(cygrpc.OperationType.receive_message) elif self._state.code is grpc.StatusCode.OK: raise StopIteration() else: @@ -408,9 +402,12 @@ class _Rendezvous(grpc.RpcError, grpc.Future, grpc.Call): def __del__(self): with self._state.condition: if self._state.code is None: - self._call.cancel() - self._state.cancelled = True self._state.code = grpc.StatusCode.CANCELLED + self._state.details = 'Cancelled upon garbage collection!' + self._state.cancelled = True + self._call.cancel( + _common.STATUS_CODE_TO_CYGRPC_STATUS_CODE[self._state.code], + self._state.details) self._state.condition.notify_all() @@ -437,6 +434,24 @@ def _end_unary_response_blocking(state, call, with_call, deadline): raise _Rendezvous(state, None, None, deadline) +def _stream_unary_invocation_operationses(metadata): + return ( + ( + cygrpc.SendInitialMetadataOperation(metadata, _EMPTY_FLAGS), + cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS), + cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS), + ), + (cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS),), + ) + + +def _stream_unary_invocation_operationses_and_tags(metadata): + return tuple(( + operations, + None, + ) for operations in _stream_unary_invocation_operationses(metadata)) + + class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable): def __init__(self, channel, managed_call, method, request_serializer, @@ -448,8 +463,8 @@ class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable): self._response_deserializer = response_deserializer def _prepare(self, request, timeout, metadata): - deadline, serialized_request, rendezvous = (_start_unary_request( - request, timeout, self._request_serializer)) + deadline, serialized_request, rendezvous = _start_unary_request( + request, timeout, self._request_serializer) if serialized_request is None: return None, None, None, rendezvous else: @@ -467,48 +482,38 @@ class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable): def _blocking(self, request, timeout, metadata, credentials): state, operations, deadline, rendezvous = self._prepare( request, timeout, metadata) - if rendezvous: + if state is None: raise rendezvous else: - completion_queue = cygrpc.CompletionQueue() - call = self._channel.create_call(None, 0, completion_queue, - self._method, None, deadline) - if credentials is not None: - call.set_credentials(credentials._credentials) - call_error = call.start_client_batch(operations, None) - _check_call_error(call_error, metadata) - _handle_event(completion_queue.poll(), state, - self._response_deserializer) - return state, call, deadline + call = self._channel.segregated_call( + 0, self._method, None, deadline, metadata, None + if credentials is None else credentials._credentials, (( + operations, + None, + ),)) + event = call.next_event() + _handle_event(event, state, self._response_deserializer) + return state, call, def __call__(self, request, timeout=None, metadata=None, credentials=None): - state, call, deadline = self._blocking(request, timeout, metadata, - credentials) - return _end_unary_response_blocking(state, call, False, deadline) + state, call, = self._blocking(request, timeout, metadata, credentials) + return _end_unary_response_blocking(state, call, False, None) def with_call(self, request, timeout=None, metadata=None, credentials=None): - state, call, deadline = self._blocking(request, timeout, metadata, - credentials) - return _end_unary_response_blocking(state, call, True, deadline) + state, call, = self._blocking(request, timeout, metadata, credentials) + return _end_unary_response_blocking(state, call, True, None) def future(self, request, timeout=None, metadata=None, credentials=None): state, operations, deadline, rendezvous = self._prepare( request, timeout, metadata) - if rendezvous: - return rendezvous + if state is None: + raise rendezvous else: - call, drive_call = self._managed_call(None, 0, self._method, None, - deadline) - if credentials is not None: - call.set_credentials(credentials._credentials) - event_handler = _event_handler(state, call, - self._response_deserializer) - with state.condition: - call_error = call.start_client_batch(operations, event_handler) - if call_error != cygrpc.CallError.ok: - _call_error_set_RPCstate(state, call_error, metadata) - return _Rendezvous(state, None, None, deadline) - drive_call() + event_handler = _event_handler(state, self._response_deserializer) + call = self._managed_call( + 0, self._method, None, deadline, metadata, None + if credentials is None else credentials._credentials, + (operations,), event_handler) return _Rendezvous(state, call, self._response_deserializer, deadline) @@ -524,34 +529,27 @@ class _UnaryStreamMultiCallable(grpc.UnaryStreamMultiCallable): self._response_deserializer = response_deserializer def __call__(self, request, timeout=None, metadata=None, credentials=None): - deadline, serialized_request, rendezvous = (_start_unary_request( - request, timeout, self._request_serializer)) + deadline, serialized_request, rendezvous = _start_unary_request( + request, timeout, self._request_serializer) if serialized_request is None: raise rendezvous else: state = _RPCState(_UNARY_STREAM_INITIAL_DUE, None, None, None, None) - call, drive_call = self._managed_call(None, 0, self._method, None, - deadline) - if credentials is not None: - call.set_credentials(credentials._credentials) - event_handler = _event_handler(state, call, - self._response_deserializer) - with state.condition: - call.start_client_batch( - (cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS),), - event_handler) - operations = ( + operationses = ( + ( cygrpc.SendInitialMetadataOperation(metadata, _EMPTY_FLAGS), cygrpc.SendMessageOperation(serialized_request, _EMPTY_FLAGS), cygrpc.SendCloseFromClientOperation(_EMPTY_FLAGS), cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS), - ) - call_error = call.start_client_batch(operations, event_handler) - if call_error != cygrpc.CallError.ok: - _call_error_set_RPCstate(state, call_error, metadata) - return _Rendezvous(state, None, None, deadline) - drive_call() + ), + (cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS),), + ) + event_handler = _event_handler(state, self._response_deserializer) + call = self._managed_call( + 0, self._method, None, deadline, metadata, None + if credentials is None else credentials._credentials, + operationses, event_handler) return _Rendezvous(state, call, self._response_deserializer, deadline) @@ -569,49 +567,38 @@ class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable): def _blocking(self, request_iterator, timeout, metadata, credentials): deadline = _deadline(timeout) state = _RPCState(_STREAM_UNARY_INITIAL_DUE, None, None, None, None) - completion_queue = cygrpc.CompletionQueue() - call = self._channel.create_call(None, 0, completion_queue, - self._method, None, deadline) - if credentials is not None: - call.set_credentials(credentials._credentials) - with state.condition: - call.start_client_batch( - (cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS),), None) - operations = ( - cygrpc.SendInitialMetadataOperation(metadata, _EMPTY_FLAGS), - cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS), - cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS), - ) - call_error = call.start_client_batch(operations, None) - _check_call_error(call_error, metadata) - _consume_request_iterator(request_iterator, state, call, - self._request_serializer) + call = self._channel.segregated_call( + 0, self._method, None, deadline, metadata, None + if credentials is None else credentials._credentials, + _stream_unary_invocation_operationses_and_tags(metadata)) + _consume_request_iterator(request_iterator, state, call, + self._request_serializer, None) while True: - event = completion_queue.poll() + event = call.next_event() with state.condition: _handle_event(event, state, self._response_deserializer) state.condition.notify_all() if not state.due: break - return state, call, deadline + return state, call, def __call__(self, request_iterator, timeout=None, metadata=None, credentials=None): - state, call, deadline = self._blocking(request_iterator, timeout, - metadata, credentials) - return _end_unary_response_blocking(state, call, False, deadline) + state, call, = self._blocking(request_iterator, timeout, metadata, + credentials) + return _end_unary_response_blocking(state, call, False, None) def with_call(self, request_iterator, timeout=None, metadata=None, credentials=None): - state, call, deadline = self._blocking(request_iterator, timeout, - metadata, credentials) - return _end_unary_response_blocking(state, call, True, deadline) + state, call, = self._blocking(request_iterator, timeout, metadata, + credentials) + return _end_unary_response_blocking(state, call, True, None) def future(self, request_iterator, @@ -620,27 +607,13 @@ class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable): credentials=None): deadline = _deadline(timeout) state = _RPCState(_STREAM_UNARY_INITIAL_DUE, None, None, None, None) - call, drive_call = self._managed_call(None, 0, self._method, None, - deadline) - if credentials is not None: - call.set_credentials(credentials._credentials) - event_handler = _event_handler(state, call, self._response_deserializer) - with state.condition: - call.start_client_batch( - (cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS),), - event_handler) - operations = ( - cygrpc.SendInitialMetadataOperation(metadata, _EMPTY_FLAGS), - cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS), - cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS), - ) - call_error = call.start_client_batch(operations, event_handler) - if call_error != cygrpc.CallError.ok: - _call_error_set_RPCstate(state, call_error, metadata) - return _Rendezvous(state, None, None, deadline) - drive_call() - _consume_request_iterator(request_iterator, state, call, - self._request_serializer) + event_handler = _event_handler(state, self._response_deserializer) + call = self._managed_call( + 0, self._method, None, deadline, metadata, None + if credentials is None else credentials._credentials, + _stream_unary_invocation_operationses(metadata), event_handler) + _consume_request_iterator(request_iterator, state, call, + self._request_serializer, event_handler) return _Rendezvous(state, call, self._response_deserializer, deadline) @@ -661,26 +634,20 @@ class _StreamStreamMultiCallable(grpc.StreamStreamMultiCallable): credentials=None): deadline = _deadline(timeout) state = _RPCState(_STREAM_STREAM_INITIAL_DUE, None, None, None, None) - call, drive_call = self._managed_call(None, 0, self._method, None, - deadline) - if credentials is not None: - call.set_credentials(credentials._credentials) - event_handler = _event_handler(state, call, self._response_deserializer) - with state.condition: - call.start_client_batch( - (cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS),), - event_handler) - operations = ( + operationses = ( + ( cygrpc.SendInitialMetadataOperation(metadata, _EMPTY_FLAGS), cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS), - ) - call_error = call.start_client_batch(operations, event_handler) - if call_error != cygrpc.CallError.ok: - _call_error_set_RPCstate(state, call_error, metadata) - return _Rendezvous(state, None, None, deadline) - drive_call() - _consume_request_iterator(request_iterator, state, call, - self._request_serializer) + ), + (cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS),), + ) + event_handler = _event_handler(state, self._response_deserializer) + call = self._managed_call( + 0, self._method, None, deadline, metadata, None + if credentials is None else credentials._credentials, operationses, + event_handler) + _consume_request_iterator(request_iterator, state, call, + self._request_serializer, event_handler) return _Rendezvous(state, call, self._response_deserializer, deadline) @@ -689,28 +656,25 @@ class _ChannelCallState(object): def __init__(self, channel): self.lock = threading.Lock() self.channel = channel - self.completion_queue = cygrpc.CompletionQueue() - self.managed_calls = None + self.managed_calls = 0 def _run_channel_spin_thread(state): def channel_spin(): while True: - event = state.completion_queue.poll() - completed_call = event.tag(event) - if completed_call is not None: + event = state.channel.next_call_event() + call_completed = event.tag(event) + if call_completed: with state.lock: - state.managed_calls.remove(completed_call) - if not state.managed_calls: - state.managed_calls = None + state.managed_calls -= 1 + if state.managed_calls == 0: return def stop_channel_spin(timeout): # pylint: disable=unused-argument with state.lock: - if state.managed_calls is not None: - for call in state.managed_calls: - call.cancel() + state.channel.close(cygrpc.StatusCode.cancelled, + 'Channel spin thread cleaned up!') channel_spin_thread = _common.CleanupThread( stop_channel_spin, target=channel_spin) @@ -719,37 +683,41 @@ def _run_channel_spin_thread(state): def _channel_managed_call_management(state): - def create(parent, flags, method, host, deadline): - """Creates a managed cygrpc.Call and a function to call to drive it. - - If operations are successfully added to the returned cygrpc.Call, the - returned function must be called. If operations are not successfully added - to the returned cygrpc.Call, the returned function must not be called. - - Args: - parent: A cygrpc.Call to be used as the parent of the created call. - flags: An integer bitfield of call flags. - method: The RPC method. - host: A host string for the created call. - deadline: A float to be the deadline of the created call or None if the - call is to have an infinite deadline. - - Returns: - A cygrpc.Call with which to conduct an RPC and a function to call if - operations are successfully started on the call. - """ - call = state.channel.create_call(parent, flags, state.completion_queue, - method, host, deadline) - - def drive(): - with state.lock: - if state.managed_calls is None: - state.managed_calls = set((call,)) - _run_channel_spin_thread(state) - else: - state.managed_calls.add(call) + # pylint: disable=too-many-arguments + def create(flags, method, host, deadline, metadata, credentials, + operationses, event_handler): + """Creates a cygrpc.IntegratedCall. - return call, drive + Args: + flags: An integer bitfield of call flags. + method: The RPC method. + host: A host string for the created call. + deadline: A float to be the deadline of the created call or None if + the call is to have an infinite deadline. + metadata: The metadata for the call or None. + credentials: A cygrpc.CallCredentials or None. + operationses: An iterable of iterables of cygrpc.Operations to be + started on the call. + event_handler: A behavior to call to handle the events resultant from + the operations on the call. + + Returns: + A cygrpc.IntegratedCall with which to conduct an RPC. + """ + operationses_and_tags = tuple(( + operations, + event_handler, + ) for operations in operationses) + with state.lock: + call = state.channel.integrated_call(flags, method, host, deadline, + metadata, credentials, + operationses_and_tags) + if state.managed_calls == 0: + state.managed_calls = 1 + _run_channel_spin_thread(state) + else: + state.managed_calls += 1 + return call return create @@ -819,12 +787,9 @@ def _poll_connectivity(state, channel, initial_try_to_connect): callback_and_connectivity[1] = state.connectivity if callbacks: _spawn_delivery(state, callbacks) - completion_queue = cygrpc.CompletionQueue() while True: - channel.watch_connectivity_state(connectivity, - time.time() + 0.2, completion_queue, - None) - event = completion_queue.poll() + event = channel.watch_connectivity_state(connectivity, + time.time() + 0.2) with state.lock: if not state.callbacks_and_connectivities and not state.try_to_connect: state.polling = False diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi index 1ba76b7f838..eefc685c0b0 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi @@ -13,9 +13,59 @@ # limitations under the License. +cdef _check_call_error_no_metadata(c_call_error) + + +cdef _check_and_raise_call_error_no_metadata(c_call_error) + + +cdef _check_call_error(c_call_error, metadata) + + +cdef class _CallState: + + cdef grpc_call *c_call + cdef set due + + +cdef class _ChannelState: + + cdef object condition + cdef grpc_channel *c_channel + # A boolean field indicating that the channel is open (if True) or is being + # closed (i.e. a call to close is currently executing) or is closed (if + # False). + # TODO(https://github.com/grpc/grpc/issues/3064): Eliminate "is being closed" + # a state in which condition may be acquired by any thread, eliminate this + # field and just use the NULLness of c_channel as an indication that the + # channel is closed. + cdef object open + + # A dict from _BatchOperationTag to _CallState + cdef dict integrated_call_states + cdef grpc_completion_queue *c_call_completion_queue + + # A set of _CallState + cdef set segregated_call_states + + cdef set connectivity_due + cdef grpc_completion_queue *c_connectivity_completion_queue + + +cdef class IntegratedCall: + + cdef _ChannelState _channel_state + cdef _CallState _call_state + + +cdef class SegregatedCall: + + cdef _ChannelState _channel_state + cdef _CallState _call_state + cdef grpc_completion_queue *_c_completion_queue + + cdef class Channel: cdef grpc_arg_pointer_vtable _vtable - cdef grpc_channel *c_channel - cdef list references - cdef readonly _ArgumentsProcessor _arguments_processor + cdef _ChannelState _state diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi index a3966497bcb..72e74e84aee 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi @@ -14,82 +14,439 @@ cimport cpython +import threading + +_INTERNAL_CALL_ERROR_MESSAGE_FORMAT = ( + 'Internal gRPC call error %d. ' + + 'Please report to https://github.com/grpc/grpc/issues') + + +cdef str _call_error_metadata(metadata): + return 'metadata was invalid: %s' % metadata + + +cdef str _call_error_no_metadata(c_call_error): + return _INTERNAL_CALL_ERROR_MESSAGE_FORMAT % c_call_error + + +cdef str _call_error(c_call_error, metadata): + if c_call_error == GRPC_CALL_ERROR_INVALID_METADATA: + return _call_error_metadata(metadata) + else: + return _call_error_no_metadata(c_call_error) + + +cdef _check_call_error_no_metadata(c_call_error): + if c_call_error != GRPC_CALL_OK: + return _INTERNAL_CALL_ERROR_MESSAGE_FORMAT % c_call_error + else: + return None + + +cdef _check_and_raise_call_error_no_metadata(c_call_error): + error = _check_call_error_no_metadata(c_call_error) + if error is not None: + raise ValueError(error) + + +cdef _check_call_error(c_call_error, metadata): + if c_call_error == GRPC_CALL_ERROR_INVALID_METADATA: + return _call_error_metadata(metadata) + else: + return _check_call_error_no_metadata(c_call_error) + + +cdef void _raise_call_error_no_metadata(c_call_error) except *: + raise ValueError(_call_error_no_metadata(c_call_error)) + + +cdef void _raise_call_error(c_call_error, metadata) except *: + raise ValueError(_call_error(c_call_error, metadata)) + + +cdef _destroy_c_completion_queue(grpc_completion_queue *c_completion_queue): + grpc_completion_queue_shutdown(c_completion_queue) + grpc_completion_queue_destroy(c_completion_queue) + + +cdef class _CallState: + + def __cinit__(self): + self.due = set() + + +cdef class _ChannelState: + + def __cinit__(self): + self.condition = threading.Condition() + self.open = True + self.integrated_call_states = {} + self.segregated_call_states = set() + self.connectivity_due = set() + + +cdef tuple _operate(grpc_call *c_call, object operations, object user_tag): + cdef grpc_call_error c_call_error + cdef _BatchOperationTag tag = _BatchOperationTag(user_tag, operations, None) + tag.prepare() + cpython.Py_INCREF(tag) + with nogil: + c_call_error = grpc_call_start_batch( + c_call, tag.c_ops, tag.c_nops, tag, NULL) + return c_call_error, tag + + +cdef object _operate_from_integrated_call( + _ChannelState channel_state, _CallState call_state, object operations, + object user_tag): + cdef grpc_call_error c_call_error + cdef _BatchOperationTag tag + with channel_state.condition: + if call_state.due: + c_call_error, tag = _operate(call_state.c_call, operations, user_tag) + if c_call_error == GRPC_CALL_OK: + call_state.due.add(tag) + channel_state.integrated_call_states[tag] = call_state + return True + else: + _raise_call_error_no_metadata(c_call_error) + else: + return False + + +cdef object _operate_from_segregated_call( + _ChannelState channel_state, _CallState call_state, object operations, + object user_tag): + cdef grpc_call_error c_call_error + cdef _BatchOperationTag tag + with channel_state.condition: + if call_state.due: + c_call_error, tag = _operate(call_state.c_call, operations, user_tag) + if c_call_error == GRPC_CALL_OK: + call_state.due.add(tag) + return True + else: + _raise_call_error_no_metadata(c_call_error) + else: + return False + + +cdef _cancel( + _ChannelState channel_state, _CallState call_state, grpc_status_code code, + str details): + cdef grpc_call_error c_call_error + with channel_state.condition: + if call_state.due: + c_call_error = grpc_call_cancel_with_status( + call_state.c_call, code, _encode(details), NULL) + _check_and_raise_call_error_no_metadata(c_call_error) + + +cdef BatchOperationEvent _next_call_event( + _ChannelState channel_state, grpc_completion_queue *c_completion_queue, + on_success): + tag, event = _latent_event(c_completion_queue, None) + with channel_state.condition: + on_success(tag) + channel_state.condition.notify_all() + return event + + +# TODO(https://github.com/grpc/grpc/issues/14569): This could be a lot simpler. +cdef void _call( + _ChannelState channel_state, _CallState call_state, + grpc_completion_queue *c_completion_queue, on_success, int flags, method, + host, object deadline, CallCredentials credentials, + object operationses_and_user_tags, object metadata) except *: + """Invokes an RPC. + + Args: + channel_state: A _ChannelState with its "open" attribute set to True. RPCs + may not be invoked on a closed channel. + call_state: An empty _CallState to be altered (specifically assigned a + c_call and having its due set populated) if the RPC invocation is + successful. + c_completion_queue: A grpc_completion_queue to be used for the call's + operations. + on_success: A behavior to be called if attempting to start operations for + the call succeeds. If called the behavior will be called while holding the + channel_state condition and passed the tags associated with operations + that were successfully started for the call. + flags: Flags to be passed to gRPC Core as part of call creation. + method: The fully-qualified name of the RPC method being invoked. + host: A "host" string to be passed to gRPC Core as part of call creation. + deadline: A float for the deadline of the RPC, or None if the RPC is to have + no deadline. + credentials: A _CallCredentials for the RPC or None. + operationses_and_user_tags: A sequence of length-two sequences the first + element of which is a sequence of Operations and the second element of + which is an object to be used as a tag. A SendInitialMetadataOperation + must be present in the first element of this value. + metadata: The metadata for this call. + """ + cdef grpc_slice method_slice + cdef grpc_slice host_slice + cdef grpc_slice *host_slice_ptr + cdef grpc_call_credentials *c_call_credentials + cdef grpc_call_error c_call_error + cdef tuple error_and_wrapper_tag + cdef _BatchOperationTag wrapper_tag + with channel_state.condition: + if channel_state.open: + method_slice = _slice_from_bytes(method) + if host is None: + host_slice_ptr = NULL + else: + host_slice = _slice_from_bytes(host) + host_slice_ptr = &host_slice + call_state.c_call = grpc_channel_create_call( + channel_state.c_channel, NULL, flags, + c_completion_queue, method_slice, host_slice_ptr, + _timespec_from_time(deadline), NULL) + grpc_slice_unref(method_slice) + if host_slice_ptr: + grpc_slice_unref(host_slice) + if credentials is not None: + c_call_credentials = credentials.c() + c_call_error = grpc_call_set_credentials( + call_state.c_call, c_call_credentials) + grpc_call_credentials_release(c_call_credentials) + if c_call_error != GRPC_CALL_OK: + grpc_call_unref(call_state.c_call) + call_state.c_call = NULL + _raise_call_error_no_metadata(c_call_error) + started_tags = set() + for operations, user_tag in operationses_and_user_tags: + c_call_error, tag = _operate(call_state.c_call, operations, user_tag) + if c_call_error == GRPC_CALL_OK: + started_tags.add(tag) + else: + grpc_call_cancel(call_state.c_call, NULL) + grpc_call_unref(call_state.c_call) + call_state.c_call = NULL + _raise_call_error(c_call_error, metadata) + else: + call_state.due.update(started_tags) + on_success(started_tags) + else: + raise ValueError('Cannot invoke RPC on closed channel!') + +cdef void _process_integrated_call_tag( + _ChannelState state, _BatchOperationTag tag) except *: + cdef _CallState call_state = state.integrated_call_states.pop(tag) + call_state.due.remove(tag) + if not call_state.due: + grpc_call_unref(call_state.c_call) + call_state.c_call = NULL + + +cdef class IntegratedCall: + + def __cinit__(self, _ChannelState channel_state, _CallState call_state): + self._channel_state = channel_state + self._call_state = call_state + + def operate(self, operations, tag): + return _operate_from_integrated_call( + self._channel_state, self._call_state, operations, tag) + + def cancel(self, code, details): + _cancel(self._channel_state, self._call_state, code, details) + + +cdef IntegratedCall _integrated_call( + _ChannelState state, int flags, method, host, object deadline, + object metadata, CallCredentials credentials, operationses_and_user_tags): + call_state = _CallState() + + def on_success(started_tags): + for started_tag in started_tags: + state.integrated_call_states[started_tag] = call_state + + _call( + state, call_state, state.c_call_completion_queue, on_success, flags, + method, host, deadline, credentials, operationses_and_user_tags, metadata) + + return IntegratedCall(state, call_state) + + +cdef object _process_segregated_call_tag( + _ChannelState state, _CallState call_state, + grpc_completion_queue *c_completion_queue, _BatchOperationTag tag): + call_state.due.remove(tag) + if not call_state.due: + grpc_call_unref(call_state.c_call) + call_state.c_call = NULL + state.segregated_call_states.remove(call_state) + _destroy_c_completion_queue(c_completion_queue) + return True + else: + return False + + +cdef class SegregatedCall: + + def __cinit__(self, _ChannelState channel_state, _CallState call_state): + self._channel_state = channel_state + self._call_state = call_state + + def operate(self, operations, tag): + return _operate_from_segregated_call( + self._channel_state, self._call_state, operations, tag) + + def cancel(self, code, details): + _cancel(self._channel_state, self._call_state, code, details) + + def next_event(self): + def on_success(tag): + _process_segregated_call_tag( + self._channel_state, self._call_state, self._c_completion_queue, tag) + return _next_call_event( + self._channel_state, self._c_completion_queue, on_success) + + +cdef SegregatedCall _segregated_call( + _ChannelState state, int flags, method, host, object deadline, + object metadata, CallCredentials credentials, operationses_and_user_tags): + cdef _CallState call_state = _CallState() + cdef grpc_completion_queue *c_completion_queue = ( + grpc_completion_queue_create_for_next(NULL)) + cdef SegregatedCall segregated_call + + def on_success(started_tags): + state.segregated_call_states.add(call_state) + + try: + _call( + state, call_state, c_completion_queue, on_success, flags, method, host, + deadline, credentials, operationses_and_user_tags, metadata) + except: + _destroy_c_completion_queue(c_completion_queue) + raise + + segregated_call = SegregatedCall(state, call_state) + segregated_call._c_completion_queue = c_completion_queue + return segregated_call + + +cdef object _watch_connectivity_state( + _ChannelState state, grpc_connectivity_state last_observed_state, + object deadline): + cdef _ConnectivityTag tag = _ConnectivityTag(object()) + with state.condition: + if state.open: + cpython.Py_INCREF(tag) + grpc_channel_watch_connectivity_state( + state.c_channel, last_observed_state, _timespec_from_time(deadline), + state.c_connectivity_completion_queue, tag) + state.connectivity_due.add(tag) + else: + raise ValueError('Cannot invoke RPC on closed channel!') + completed_tag, event = _latent_event( + state.c_connectivity_completion_queue, None) + with state.condition: + state.connectivity_due.remove(completed_tag) + state.condition.notify_all() + return event + + +cdef _close(_ChannelState state, grpc_status_code code, object details): + cdef _CallState call_state + encoded_details = _encode(details) + with state.condition: + if state.open: + state.open = False + for call_state in set(state.integrated_call_states.values()): + grpc_call_cancel_with_status( + call_state.c_call, code, encoded_details, NULL) + for call_state in state.segregated_call_states: + grpc_call_cancel_with_status( + call_state.c_call, code, encoded_details, NULL) + # TODO(https://github.com/grpc/grpc/issues/3064): Cancel connectivity + # watching. + + while state.integrated_call_states: + state.condition.wait() + while state.segregated_call_states: + state.condition.wait() + while state.connectivity_due: + state.condition.wait() + + _destroy_c_completion_queue(state.c_call_completion_queue) + _destroy_c_completion_queue(state.c_connectivity_completion_queue) + grpc_channel_destroy(state.c_channel) + state.c_channel = NULL + grpc_shutdown() + state.condition.notify_all() + else: + # Another call to close already completed in the past or is currently + # being executed in another thread. + while state.c_channel != NULL: + state.condition.wait() + cdef class Channel: - def __cinit__(self, bytes target, object arguments, - ChannelCredentials channel_credentials=None): + def __cinit__( + self, bytes target, object arguments, + ChannelCredentials channel_credentials): grpc_init() + self._state = _ChannelState() self._vtable.copy = &_copy_pointer self._vtable.destroy = &_destroy_pointer self._vtable.cmp = &_compare_pointer cdef _ArgumentsProcessor arguments_processor = _ArgumentsProcessor( arguments) cdef grpc_channel_args *c_arguments = arguments_processor.c(&self._vtable) - self.references = [] - c_target = target if channel_credentials is None: - self.c_channel = grpc_insecure_channel_create(c_target, c_arguments, NULL) + self._state.c_channel = grpc_insecure_channel_create( + target, c_arguments, NULL) else: c_channel_credentials = channel_credentials.c() - self.c_channel = grpc_secure_channel_create( - c_channel_credentials, c_target, c_arguments, NULL) + self._state.c_channel = grpc_secure_channel_create( + c_channel_credentials, target, c_arguments, NULL) grpc_channel_credentials_release(c_channel_credentials) - arguments_processor.un_c() - self.references.append(target) - self.references.append(arguments) - - def create_call(self, Call parent, int flags, - CompletionQueue queue not None, - method, host, object deadline): - if queue.is_shutting_down: - raise ValueError("queue must not be shutting down or shutdown") - cdef grpc_slice method_slice = _slice_from_bytes(method) - cdef grpc_slice host_slice - cdef grpc_slice *host_slice_ptr = NULL - if host is not None: - host_slice = _slice_from_bytes(host) - host_slice_ptr = &host_slice - cdef Call operation_call = Call() - operation_call.references = [self, queue] - cdef grpc_call *parent_call = NULL - if parent is not None: - parent_call = parent.c_call - operation_call.c_call = grpc_channel_create_call( - self.c_channel, parent_call, flags, - queue.c_completion_queue, method_slice, host_slice_ptr, - _timespec_from_time(deadline), NULL) - grpc_slice_unref(method_slice) - if host_slice_ptr: - grpc_slice_unref(host_slice) - return operation_call + self._state.c_call_completion_queue = ( + grpc_completion_queue_create_for_next(NULL)) + self._state.c_connectivity_completion_queue = ( + grpc_completion_queue_create_for_next(NULL)) + + def target(self): + cdef char *c_target + with self._state.condition: + c_target = grpc_channel_get_target(self._state.c_channel) + target = c_target + gpr_free(c_target) + return target + + def integrated_call( + self, int flags, method, host, object deadline, object metadata, + CallCredentials credentials, operationses_and_tags): + return _integrated_call( + self._state, flags, method, host, deadline, metadata, credentials, + operationses_and_tags) + + def next_call_event(self): + def on_success(tag): + _process_integrated_call_tag(self._state, tag) + return _next_call_event( + self._state, self._state.c_call_completion_queue, on_success) + + def segregated_call( + self, int flags, method, host, object deadline, object metadata, + CallCredentials credentials, operationses_and_tags): + return _segregated_call( + self._state, flags, method, host, deadline, metadata, credentials, + operationses_and_tags) def check_connectivity_state(self, bint try_to_connect): - cdef grpc_connectivity_state result - with nogil: - result = grpc_channel_check_connectivity_state(self.c_channel, - try_to_connect) - return result + with self._state.condition: + return grpc_channel_check_connectivity_state( + self._state.c_channel, try_to_connect) def watch_connectivity_state( - self, grpc_connectivity_state last_observed_state, - object deadline, CompletionQueue queue not None, tag): - cdef _ConnectivityTag connectivity_tag = _ConnectivityTag(tag) - cpython.Py_INCREF(connectivity_tag) - grpc_channel_watch_connectivity_state( - self.c_channel, last_observed_state, _timespec_from_time(deadline), - queue.c_completion_queue, connectivity_tag) + self, grpc_connectivity_state last_observed_state, object deadline): + return _watch_connectivity_state(self._state, last_observed_state, deadline) - def target(self): - cdef char *target = NULL - with nogil: - target = grpc_channel_get_target(self.c_channel) - result = target - with nogil: - gpr_free(target) - return result - - def __dealloc__(self): - if self.c_channel != NULL: - grpc_channel_destroy(self.c_channel) - grpc_shutdown() + def close(self, code, details): + _close(self._state, code, details) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pxd.pxi index 5ea0287b819..9f06ce086ee 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pxd.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pxd.pxi @@ -13,10 +13,16 @@ # limitations under the License. +cdef grpc_event _next(grpc_completion_queue *c_completion_queue, deadline) + + +cdef _interpret_event(grpc_event c_event) + + cdef class CompletionQueue: cdef grpc_completion_queue *c_completion_queue cdef bint is_shutting_down cdef bint is_shutdown - cdef _interpret_event(self, grpc_event event) + cdef _interpret_event(self, grpc_event c_event) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi index 40496d11243..a2d765546a5 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi @@ -20,6 +20,53 @@ import time cdef int _INTERRUPT_CHECK_PERIOD_MS = 200 +cdef grpc_event _next(grpc_completion_queue *c_completion_queue, deadline): + cdef gpr_timespec c_increment + cdef gpr_timespec c_timeout + cdef gpr_timespec c_deadline + c_increment = gpr_time_from_millis(_INTERRUPT_CHECK_PERIOD_MS, GPR_TIMESPAN) + if deadline is None: + c_deadline = gpr_inf_future(GPR_CLOCK_REALTIME) + else: + c_deadline = _timespec_from_time(deadline) + + with nogil: + while True: + c_timeout = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), c_increment) + if gpr_time_cmp(c_timeout, c_deadline) > 0: + c_timeout = c_deadline + c_event = grpc_completion_queue_next(c_completion_queue, c_timeout, NULL) + if (c_event.type != GRPC_QUEUE_TIMEOUT or + gpr_time_cmp(c_timeout, c_deadline) == 0): + break + + # Handle any signals + with gil: + cpython.PyErr_CheckSignals() + return c_event + + +cdef _interpret_event(grpc_event c_event): + cdef _Tag tag + if c_event.type == GRPC_QUEUE_TIMEOUT: + # NOTE(nathaniel): For now we coopt ConnectivityEvent here. + return None, ConnectivityEvent(GRPC_QUEUE_TIMEOUT, False, None) + elif c_event.type == GRPC_QUEUE_SHUTDOWN: + # NOTE(nathaniel): For now we coopt ConnectivityEvent here. + return None, ConnectivityEvent(GRPC_QUEUE_SHUTDOWN, False, None) + else: + tag = <_Tag>c_event.tag + # We receive event tags only after they've been inc-ref'd elsewhere in + # the code. + cpython.Py_DECREF(tag) + return tag, tag.event(c_event) + + +cdef _latent_event(grpc_completion_queue *c_completion_queue, object deadline): + cdef grpc_event c_event = _next(c_completion_queue, deadline) + return _interpret_event(c_event) + + cdef class CompletionQueue: def __cinit__(self, shutdown_cq=False): @@ -36,48 +83,16 @@ cdef class CompletionQueue: self.is_shutting_down = False self.is_shutdown = False - cdef _interpret_event(self, grpc_event event): - cdef _Tag tag = None - if event.type == GRPC_QUEUE_TIMEOUT: - # NOTE(nathaniel): For now we coopt ConnectivityEvent here. - return ConnectivityEvent(GRPC_QUEUE_TIMEOUT, False, None) - elif event.type == GRPC_QUEUE_SHUTDOWN: + cdef _interpret_event(self, grpc_event c_event): + unused_tag, event = _interpret_event(c_event) + if event.completion_type == GRPC_QUEUE_SHUTDOWN: self.is_shutdown = True - # NOTE(nathaniel): For now we coopt ConnectivityEvent here. - return ConnectivityEvent(GRPC_QUEUE_TIMEOUT, True, None) - else: - tag = <_Tag>event.tag - # We receive event tags only after they've been inc-ref'd elsewhere in - # the code. - cpython.Py_DECREF(tag) - return tag.event(event) + return event + # We name this 'poll' to avoid problems with CPython's expectations for + # 'special' methods (like next and __next__). def poll(self, deadline=None): - # We name this 'poll' to avoid problems with CPython's expectations for - # 'special' methods (like next and __next__). - cdef gpr_timespec c_increment - cdef gpr_timespec c_timeout - cdef gpr_timespec c_deadline - if deadline is None: - c_deadline = gpr_inf_future(GPR_CLOCK_REALTIME) - else: - c_deadline = _timespec_from_time(deadline) - with nogil: - c_increment = gpr_time_from_millis(_INTERRUPT_CHECK_PERIOD_MS, GPR_TIMESPAN) - - while True: - c_timeout = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), c_increment) - if gpr_time_cmp(c_timeout, c_deadline) > 0: - c_timeout = c_deadline - event = grpc_completion_queue_next( - self.c_completion_queue, c_timeout, NULL) - if event.type != GRPC_QUEUE_TIMEOUT or gpr_time_cmp(c_timeout, c_deadline) == 0: - break; - - # Handle any signals - with gil: - cpython.PyErr_CheckSignals() - return self._interpret_event(event) + return self._interpret_event(_next(self.c_completion_queue, deadline)) def shutdown(self): with nogil: diff --git a/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py b/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py index 4f8868d3461..578a3d79ad1 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py +++ b/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py @@ -19,6 +19,7 @@ import unittest from grpc._cython import cygrpc from grpc.framework.foundation import logging_pool from tests.unit.framework.common import test_constants +from tests.unit._cython import test_utilities _EMPTY_FLAGS = 0 _EMPTY_METADATA = () @@ -30,6 +31,8 @@ _RECEIVE_MESSAGE_TAG = 'receive_message' _SERVER_COMPLETE_CALL_TAG = 'server_complete_call' _SUCCESS_CALL_FRACTION = 1.0 / 8.0 +_SUCCESSFUL_CALLS = int(test_constants.RPC_CONCURRENCY * _SUCCESS_CALL_FRACTION) +_UNSUCCESSFUL_CALLS = test_constants.RPC_CONCURRENCY - _SUCCESSFUL_CALLS class _State(object): @@ -150,7 +153,8 @@ class CancelManyCallsTest(unittest.TestCase): server.register_completion_queue(server_completion_queue) port = server.add_http2_port(b'[::]:0') server.start() - channel = cygrpc.Channel('localhost:{}'.format(port).encode(), None) + channel = cygrpc.Channel('localhost:{}'.format(port).encode(), None, + None) state = _State() @@ -165,31 +169,33 @@ class CancelManyCallsTest(unittest.TestCase): client_condition = threading.Condition() client_due = set() - client_completion_queue = cygrpc.CompletionQueue() - client_driver = _QueueDriver(client_condition, client_completion_queue, - client_due) - client_driver.start() with client_condition: client_calls = [] for index in range(test_constants.RPC_CONCURRENCY): - client_call = channel.create_call(None, _EMPTY_FLAGS, - client_completion_queue, - b'/twinkies', None, None) - operations = ( - cygrpc.SendInitialMetadataOperation(_EMPTY_METADATA, - _EMPTY_FLAGS), - cygrpc.SendMessageOperation(b'\x45\x56', _EMPTY_FLAGS), - cygrpc.SendCloseFromClientOperation(_EMPTY_FLAGS), - cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS), - cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS), - cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS), - ) tag = 'client_complete_call_{0:04d}_tag'.format(index) - client_call.start_client_batch(operations, tag) + client_call = channel.integrated_call( + _EMPTY_FLAGS, b'/twinkies', None, None, _EMPTY_METADATA, + None, (( + ( + cygrpc.SendInitialMetadataOperation( + _EMPTY_METADATA, _EMPTY_FLAGS), + cygrpc.SendMessageOperation(b'\x45\x56', + _EMPTY_FLAGS), + cygrpc.SendCloseFromClientOperation(_EMPTY_FLAGS), + cygrpc.ReceiveInitialMetadataOperation( + _EMPTY_FLAGS), + cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS), + cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS), + ), + tag, + ),)) client_due.add(tag) client_calls.append(client_call) + client_events_future = test_utilities.SimpleFuture( + lambda: tuple(channel.next_call_event() for _ in range(_SUCCESSFUL_CALLS))) + with state.condition: while True: if state.parked_handlers < test_constants.THREAD_CONCURRENCY: @@ -201,12 +207,14 @@ class CancelManyCallsTest(unittest.TestCase): state.condition.notify_all() break - client_driver.events( - test_constants.RPC_CONCURRENCY * _SUCCESS_CALL_FRACTION) + client_events_future.result() with client_condition: for client_call in client_calls: - client_call.cancel() + client_call.cancel(cygrpc.StatusCode.cancelled, 'Cancelled!') + for _ in range(_UNSUCCESSFUL_CALLS): + channel.next_call_event() + channel.close(cygrpc.StatusCode.unknown, 'Cancelled on channel close!') with state.condition: server.shutdown(server_completion_queue, _SERVER_SHUTDOWN_TAG) diff --git a/src/python/grpcio_tests/tests/unit/_cython/_channel_test.py b/src/python/grpcio_tests/tests/unit/_cython/_channel_test.py index 7305d0fa3f0..d95286071d5 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/_channel_test.py +++ b/src/python/grpcio_tests/tests/unit/_cython/_channel_test.py @@ -21,25 +21,20 @@ from grpc._cython import cygrpc from tests.unit.framework.common import test_constants -def _channel_and_completion_queue(): - channel = cygrpc.Channel(b'localhost:54321', ()) - completion_queue = cygrpc.CompletionQueue() - return channel, completion_queue +def _channel(): + return cygrpc.Channel(b'localhost:54321', (), None) -def _connectivity_loop(channel, completion_queue): +def _connectivity_loop(channel): for _ in range(100): connectivity = channel.check_connectivity_state(True) - channel.watch_connectivity_state(connectivity, - time.time() + 0.2, completion_queue, - None) - completion_queue.poll() + channel.watch_connectivity_state(connectivity, time.time() + 0.2) def _create_loop_destroy(): - channel, completion_queue = _channel_and_completion_queue() - _connectivity_loop(channel, completion_queue) - completion_queue.shutdown() + channel = _channel() + _connectivity_loop(channel) + channel.close(cygrpc.StatusCode.ok, 'Channel close!') def _in_parallel(behavior, arguments): @@ -55,12 +50,9 @@ def _in_parallel(behavior, arguments): class ChannelTest(unittest.TestCase): def test_single_channel_lonely_connectivity(self): - channel, completion_queue = _channel_and_completion_queue() - _in_parallel(_connectivity_loop, ( - channel, - completion_queue, - )) - completion_queue.shutdown() + channel = _channel() + _connectivity_loop(channel) + channel.close(cygrpc.StatusCode.ok, 'Channel close!') def test_multiple_channels_lonely_connectivity(self): _in_parallel(_create_loop_destroy, ()) diff --git a/src/python/grpcio_tests/tests/unit/_cython/_common.py b/src/python/grpcio_tests/tests/unit/_cython/_common.py index 7fd3d19b4ec..d8210f36f80 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/_common.py +++ b/src/python/grpcio_tests/tests/unit/_cython/_common.py @@ -100,7 +100,8 @@ class RpcTest(object): self.server.register_completion_queue(self.server_completion_queue) port = self.server.add_http2_port(b'[::]:0') self.server.start() - self.channel = cygrpc.Channel('localhost:{}'.format(port).encode(), []) + self.channel = cygrpc.Channel('localhost:{}'.format(port).encode(), [], + None) self._server_shutdown_tag = 'server_shutdown_tag' self.server_condition = threading.Condition() diff --git a/src/python/grpcio_tests/tests/unit/_cython/_no_messages_server_completion_queue_per_call_test.py b/src/python/grpcio_tests/tests/unit/_cython/_no_messages_server_completion_queue_per_call_test.py index 7caa98f72da..8a721788f4e 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/_no_messages_server_completion_queue_per_call_test.py +++ b/src/python/grpcio_tests/tests/unit/_cython/_no_messages_server_completion_queue_per_call_test.py @@ -19,6 +19,7 @@ import unittest from grpc._cython import cygrpc from tests.unit._cython import _common +from tests.unit._cython import test_utilities class Test(_common.RpcTest, unittest.TestCase): @@ -41,31 +42,27 @@ class Test(_common.RpcTest, unittest.TestCase): server_request_call_tag, }) - client_call = self.channel.create_call(None, _common.EMPTY_FLAGS, - self.client_completion_queue, - b'/twinkies', None, None) client_receive_initial_metadata_tag = 'client_receive_initial_metadata_tag' client_complete_rpc_tag = 'client_complete_rpc_tag' - with self.client_condition: - client_receive_initial_metadata_start_batch_result = ( - client_call.start_client_batch([ - cygrpc.ReceiveInitialMetadataOperation(_common.EMPTY_FLAGS), - ], client_receive_initial_metadata_tag)) - self.assertEqual(cygrpc.CallError.ok, - client_receive_initial_metadata_start_batch_result) - client_complete_rpc_start_batch_result = client_call.start_client_batch( + client_call = self.channel.integrated_call( + _common.EMPTY_FLAGS, b'/twinkies', None, None, + _common.INVOCATION_METADATA, None, [( [ - cygrpc.SendInitialMetadataOperation( - _common.INVOCATION_METADATA, _common.EMPTY_FLAGS), - cygrpc.SendCloseFromClientOperation(_common.EMPTY_FLAGS), - cygrpc.ReceiveStatusOnClientOperation(_common.EMPTY_FLAGS), - ], client_complete_rpc_tag) - self.assertEqual(cygrpc.CallError.ok, - client_complete_rpc_start_batch_result) - self.client_driver.add_due({ + cygrpc.ReceiveInitialMetadataOperation(_common.EMPTY_FLAGS), + ], client_receive_initial_metadata_tag, - client_complete_rpc_tag, - }) + )]) + client_call.operate([ + cygrpc.SendInitialMetadataOperation(_common.INVOCATION_METADATA, + _common.EMPTY_FLAGS), + cygrpc.SendCloseFromClientOperation(_common.EMPTY_FLAGS), + cygrpc.ReceiveStatusOnClientOperation(_common.EMPTY_FLAGS), + ], client_complete_rpc_tag) + + client_events_future = test_utilities.SimpleFuture( + lambda: [ + self.channel.next_call_event(), + self.channel.next_call_event(),]) server_request_call_event = self.server_driver.event_with_tag( server_request_call_tag) @@ -96,20 +93,23 @@ class Test(_common.RpcTest, unittest.TestCase): server_complete_rpc_event = server_call_driver.event_with_tag( server_complete_rpc_tag) - client_receive_initial_metadata_event = self.client_driver.event_with_tag( - client_receive_initial_metadata_tag) - client_complete_rpc_event = self.client_driver.event_with_tag( - client_complete_rpc_tag) + client_events = client_events_future.result() + if client_events[0].tag is client_receive_initial_metadata_tag: + client_receive_initial_metadata_event = client_events[0] + client_complete_rpc_event = client_events[1] + else: + client_complete_rpc_event = client_events[0] + client_receive_initial_metadata_event = client_events[1] return ( _common.OperationResult(server_request_call_start_batch_result, server_request_call_event.completion_type, server_request_call_event.success), _common.OperationResult( - client_receive_initial_metadata_start_batch_result, + cygrpc.CallError.ok, client_receive_initial_metadata_event.completion_type, client_receive_initial_metadata_event.success), - _common.OperationResult(client_complete_rpc_start_batch_result, + _common.OperationResult(cygrpc.CallError.ok, client_complete_rpc_event.completion_type, client_complete_rpc_event.success), _common.OperationResult( diff --git a/src/python/grpcio_tests/tests/unit/_cython/_no_messages_single_server_completion_queue_test.py b/src/python/grpcio_tests/tests/unit/_cython/_no_messages_single_server_completion_queue_test.py index 8582a39c010..47f39ebce2b 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/_no_messages_single_server_completion_queue_test.py +++ b/src/python/grpcio_tests/tests/unit/_cython/_no_messages_single_server_completion_queue_test.py @@ -19,6 +19,7 @@ import unittest from grpc._cython import cygrpc from tests.unit._cython import _common +from tests.unit._cython import test_utilities class Test(_common.RpcTest, unittest.TestCase): @@ -36,28 +37,31 @@ class Test(_common.RpcTest, unittest.TestCase): server_request_call_tag, }) - client_call = self.channel.create_call(None, _common.EMPTY_FLAGS, - self.client_completion_queue, - b'/twinkies', None, None) client_receive_initial_metadata_tag = 'client_receive_initial_metadata_tag' client_complete_rpc_tag = 'client_complete_rpc_tag' - with self.client_condition: - client_receive_initial_metadata_start_batch_result = ( - client_call.start_client_batch([ - cygrpc.ReceiveInitialMetadataOperation(_common.EMPTY_FLAGS), - ], client_receive_initial_metadata_tag)) - client_complete_rpc_start_batch_result = client_call.start_client_batch( - [ - cygrpc.SendInitialMetadataOperation( - _common.INVOCATION_METADATA, _common.EMPTY_FLAGS), - cygrpc.SendCloseFromClientOperation(_common.EMPTY_FLAGS), - cygrpc.ReceiveStatusOnClientOperation(_common.EMPTY_FLAGS), - ], client_complete_rpc_tag) - self.client_driver.add_due({ - client_receive_initial_metadata_tag, - client_complete_rpc_tag, - }) - + client_call = self.channel.integrated_call( + _common.EMPTY_FLAGS, b'/twinkies', None, None, + _common.INVOCATION_METADATA, None, [ + ( + [ + cygrpc.SendInitialMetadataOperation( + _common.INVOCATION_METADATA, _common.EMPTY_FLAGS), + cygrpc.SendCloseFromClientOperation( + _common.EMPTY_FLAGS), + cygrpc.ReceiveStatusOnClientOperation( + _common.EMPTY_FLAGS), + ], + client_complete_rpc_tag, + ), + ]) + client_call.operate([ + cygrpc.ReceiveInitialMetadataOperation(_common.EMPTY_FLAGS), + ], client_receive_initial_metadata_tag) + + client_events_future = test_utilities.SimpleFuture( + lambda: [ + self.channel.next_call_event(), + self.channel.next_call_event(),]) server_request_call_event = self.server_driver.event_with_tag( server_request_call_tag) @@ -87,20 +91,19 @@ class Test(_common.RpcTest, unittest.TestCase): server_complete_rpc_event = self.server_driver.event_with_tag( server_complete_rpc_tag) - client_receive_initial_metadata_event = self.client_driver.event_with_tag( - client_receive_initial_metadata_tag) - client_complete_rpc_event = self.client_driver.event_with_tag( - client_complete_rpc_tag) + client_events = client_events_future.result() + client_receive_initial_metadata_event = client_events[0] + client_complete_rpc_event = client_events[1] return ( _common.OperationResult(server_request_call_start_batch_result, server_request_call_event.completion_type, server_request_call_event.success), _common.OperationResult( - client_receive_initial_metadata_start_batch_result, + cygrpc.CallError.ok, client_receive_initial_metadata_event.completion_type, client_receive_initial_metadata_event.success), - _common.OperationResult(client_complete_rpc_start_batch_result, + _common.OperationResult(cygrpc.CallError.ok, client_complete_rpc_event.completion_type, client_complete_rpc_event.success), _common.OperationResult( diff --git a/src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py b/src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py index bc63b548799..8a903bfaf91 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py +++ b/src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py @@ -17,6 +17,7 @@ import threading import unittest from grpc._cython import cygrpc +from tests.unit._cython import test_utilities _EMPTY_FLAGS = 0 _EMPTY_METADATA = () @@ -118,7 +119,8 @@ class ReadSomeButNotAllResponsesTest(unittest.TestCase): server.register_completion_queue(server_completion_queue) port = server.add_http2_port(b'[::]:0') server.start() - channel = cygrpc.Channel('localhost:{}'.format(port).encode(), set()) + channel = cygrpc.Channel('localhost:{}'.format(port).encode(), set(), + None) server_shutdown_tag = 'server_shutdown_tag' server_driver = _ServerDriver(server_completion_queue, @@ -127,10 +129,6 @@ class ReadSomeButNotAllResponsesTest(unittest.TestCase): client_condition = threading.Condition() client_due = set() - client_completion_queue = cygrpc.CompletionQueue() - client_driver = _QueueDriver(client_condition, client_completion_queue, - client_due) - client_driver.start() server_call_condition = threading.Condition() server_send_initial_metadata_tag = 'server_send_initial_metadata_tag' @@ -154,25 +152,28 @@ class ReadSomeButNotAllResponsesTest(unittest.TestCase): server_completion_queue, server_rpc_tag) - client_call = channel.create_call(None, _EMPTY_FLAGS, - client_completion_queue, b'/twinkies', - None, None) client_receive_initial_metadata_tag = 'client_receive_initial_metadata_tag' client_complete_rpc_tag = 'client_complete_rpc_tag' - with client_condition: - client_receive_initial_metadata_start_batch_result = ( - client_call.start_client_batch([ - cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS), - ], client_receive_initial_metadata_tag)) - client_due.add(client_receive_initial_metadata_tag) - client_complete_rpc_start_batch_result = ( - client_call.start_client_batch([ - cygrpc.SendInitialMetadataOperation(_EMPTY_METADATA, - _EMPTY_FLAGS), - cygrpc.SendCloseFromClientOperation(_EMPTY_FLAGS), - cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS), - ], client_complete_rpc_tag)) - client_due.add(client_complete_rpc_tag) + client_call = channel.segregated_call( + _EMPTY_FLAGS, b'/twinkies', None, None, _EMPTY_METADATA, None, ( + ( + [ + cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS), + ], + client_receive_initial_metadata_tag, + ), + ( + [ + cygrpc.SendInitialMetadataOperation( + _EMPTY_METADATA, _EMPTY_FLAGS), + cygrpc.SendCloseFromClientOperation(_EMPTY_FLAGS), + cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS), + ], + client_complete_rpc_tag, + ), + )) + client_receive_initial_metadata_event_future = test_utilities.SimpleFuture( + client_call.next_event) server_rpc_event = server_driver.first_event() @@ -208,19 +209,20 @@ class ReadSomeButNotAllResponsesTest(unittest.TestCase): server_complete_rpc_tag) server_call_driver.events() - with client_condition: - client_receive_first_message_tag = 'client_receive_first_message_tag' - client_receive_first_message_start_batch_result = ( - client_call.start_client_batch([ - cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS), - ], client_receive_first_message_tag)) - client_due.add(client_receive_first_message_tag) - client_receive_first_message_event = client_driver.event_with_tag( - client_receive_first_message_tag) + client_recieve_initial_metadata_event = client_receive_initial_metadata_event_future.result( + ) + + client_receive_first_message_tag = 'client_receive_first_message_tag' + client_call.operate([ + cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS), + ], client_receive_first_message_tag) + client_receive_first_message_event = client_call.next_event() - client_call_cancel_result = client_call.cancel() - client_driver.events() + client_call_cancel_result = client_call.cancel( + cygrpc.StatusCode.cancelled, 'Cancelled during test!') + client_complete_rpc_event = client_call.next_event() + channel.close(cygrpc.StatusCode.unknown, 'Channel closed!') server.shutdown(server_completion_queue, server_shutdown_tag) server.cancel_all_calls() server_driver.events() @@ -228,11 +230,6 @@ class ReadSomeButNotAllResponsesTest(unittest.TestCase): self.assertEqual(cygrpc.CallError.ok, request_call_result) self.assertEqual(cygrpc.CallError.ok, server_send_initial_metadata_start_batch_result) - self.assertEqual(cygrpc.CallError.ok, - client_receive_initial_metadata_start_batch_result) - self.assertEqual(cygrpc.CallError.ok, - client_complete_rpc_start_batch_result) - self.assertEqual(cygrpc.CallError.ok, client_call_cancel_result) self.assertIs(server_rpc_tag, server_rpc_event.tag) self.assertEqual(cygrpc.CompletionType.operation_complete, server_rpc_event.completion_type) diff --git a/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py b/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py index 23f5ef605dd..724a6907465 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py +++ b/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py @@ -51,8 +51,8 @@ class TypeSmokeTest(unittest.TestCase): del server def testChannelUpDown(self): - channel = cygrpc.Channel(b'[::]:0', None) - del channel + channel = cygrpc.Channel(b'[::]:0', None, None) + channel.close(cygrpc.StatusCode.cancelled, 'Test method anyway!') def test_metadata_plugin_call_credentials_up_down(self): cygrpc.MetadataPluginCallCredentials(_metadata_plugin, @@ -121,7 +121,7 @@ class ServerClientMixin(object): client_credentials) else: self.client_channel = cygrpc.Channel('localhost:{}'.format( - self.port).encode(), set()) + self.port).encode(), set(), None) if host_override: self.host_argument = None # default host self.expected_host = host_override @@ -131,17 +131,20 @@ class ServerClientMixin(object): self.expected_host = self.host_argument def tearDownMixin(self): + self.client_channel.close(cygrpc.StatusCode.ok, 'test being torn down!') + del self.client_channel del self.server del self.client_completion_queue del self.server_completion_queue - def _perform_operations(self, operations, call, queue, deadline, - description): - """Perform the list of operations with given call, queue, and deadline. + def _perform_queue_operations(self, operations, call, queue, deadline, + description): + """Perform the operations with given call, queue, and deadline. - Invocation errors are reported with as an exception with `description` in - the message. Performs the operations asynchronously, returning a future. - """ + Invocation errors are reported with as an exception with `description` + in the message. Performs the operations asynchronously, returning a + future. + """ def performer(): tag = object() @@ -185,9 +188,6 @@ class ServerClientMixin(object): self.assertEqual(cygrpc.CallError.ok, request_call_result) client_call_tag = object() - client_call = self.client_channel.create_call( - None, 0, self.client_completion_queue, METHOD, self.host_argument, - DEADLINE) client_initial_metadata = ( ( CLIENT_METADATA_ASCII_KEY, @@ -198,18 +198,24 @@ class ServerClientMixin(object): CLIENT_METADATA_BIN_VALUE, ), ) - client_start_batch_result = client_call.start_client_batch([ - cygrpc.SendInitialMetadataOperation(client_initial_metadata, - _EMPTY_FLAGS), - cygrpc.SendMessageOperation(REQUEST, _EMPTY_FLAGS), - cygrpc.SendCloseFromClientOperation(_EMPTY_FLAGS), - cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS), - cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS), - cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS), - ], client_call_tag) - self.assertEqual(cygrpc.CallError.ok, client_start_batch_result) - client_event_future = test_utilities.CompletionQueuePollFuture( - self.client_completion_queue, DEADLINE) + client_call = self.client_channel.integrated_call( + 0, METHOD, self.host_argument, DEADLINE, client_initial_metadata, + None, [ + ( + [ + cygrpc.SendInitialMetadataOperation( + client_initial_metadata, _EMPTY_FLAGS), + cygrpc.SendMessageOperation(REQUEST, _EMPTY_FLAGS), + cygrpc.SendCloseFromClientOperation(_EMPTY_FLAGS), + cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS), + cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS), + cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS), + ], + client_call_tag, + ), + ]) + client_event_future = test_utilities.SimpleFuture( + self.client_channel.next_call_event) request_event = self.server_completion_queue.poll(deadline=DEADLINE) self.assertEqual(cygrpc.CompletionType.operation_complete, @@ -304,66 +310,76 @@ class ServerClientMixin(object): del client_call del server_call - def test6522(self): + def test_6522(self): DEADLINE = time.time() + 5 DEADLINE_TOLERANCE = 0.25 METHOD = b'twinkies' empty_metadata = () + # Prologue server_request_tag = object() self.server.request_call(self.server_completion_queue, self.server_completion_queue, server_request_tag) - client_call = self.client_channel.create_call( - None, 0, self.client_completion_queue, METHOD, self.host_argument, - DEADLINE) - - # Prologue - def perform_client_operations(operations, description): - return self._perform_operations(operations, client_call, - self.client_completion_queue, - DEADLINE, description) - - client_event_future = perform_client_operations([ - cygrpc.SendInitialMetadataOperation(empty_metadata, _EMPTY_FLAGS), - cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS), - ], "Client prologue") + client_call = self.client_channel.segregated_call( + 0, METHOD, self.host_argument, DEADLINE, None, None, ([( + [ + cygrpc.SendInitialMetadataOperation(empty_metadata, + _EMPTY_FLAGS), + cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS), + ], + object(), + ), ( + [ + cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS), + ], + object(), + )])) + + client_initial_metadata_event_future = test_utilities.SimpleFuture( + client_call.next_event) request_event = self.server_completion_queue.poll(deadline=DEADLINE) server_call = request_event.call def perform_server_operations(operations, description): - return self._perform_operations(operations, server_call, - self.server_completion_queue, - DEADLINE, description) + return self._perform_queue_operations(operations, server_call, + self.server_completion_queue, + DEADLINE, description) server_event_future = perform_server_operations([ cygrpc.SendInitialMetadataOperation(empty_metadata, _EMPTY_FLAGS), ], "Server prologue") - client_event_future.result() # force completion + client_initial_metadata_event_future.result() # force completion server_event_future.result() # Messaging for _ in range(10): - client_event_future = perform_client_operations([ + client_call.operate([ cygrpc.SendMessageOperation(b'', _EMPTY_FLAGS), cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS), ], "Client message") + client_message_event_future = test_utilities.SimpleFuture( + client_call.next_event) server_event_future = perform_server_operations([ cygrpc.SendMessageOperation(b'', _EMPTY_FLAGS), cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS), ], "Server receive") - client_event_future.result() # force completion + client_message_event_future.result() # force completion server_event_future.result() # Epilogue - client_event_future = perform_client_operations([ + client_call.operate([ cygrpc.SendCloseFromClientOperation(_EMPTY_FLAGS), - cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS) ], "Client epilogue") + # One for ReceiveStatusOnClient, one for SendCloseFromClient. + client_events_future = test_utilities.SimpleFuture( + lambda: { + client_call.next_event(), + client_call.next_event(),}) server_event_future = perform_server_operations([ cygrpc.ReceiveCloseOnServerOperation(_EMPTY_FLAGS), @@ -371,7 +387,7 @@ class ServerClientMixin(object): empty_metadata, cygrpc.StatusCode.ok, b'', _EMPTY_FLAGS) ], "Server epilogue") - client_event_future.result() # force completion + client_events_future.result() # force completion server_event_future.result() diff --git a/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py b/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py index 4edf0fc4adc..f153089a24d 100644 --- a/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py +++ b/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py @@ -81,29 +81,16 @@ class InvalidMetadataTest(unittest.TestCase): request = b'\x07\x08' metadata = (('InVaLiD', 'UnaryRequestFutureUnaryResponse'),) expected_error_details = "metadata was invalid: %s" % metadata - response_future = self._unary_unary.future(request, metadata=metadata) - with self.assertRaises(grpc.RpcError) as exception_context: - response_future.result() - self.assertEqual(exception_context.exception.details(), - expected_error_details) - self.assertEqual(exception_context.exception.code(), - grpc.StatusCode.INTERNAL) - self.assertEqual(response_future.details(), expected_error_details) - self.assertEqual(response_future.code(), grpc.StatusCode.INTERNAL) + with self.assertRaises(ValueError) as exception_context: + self._unary_unary.future(request, metadata=metadata) def testUnaryRequestStreamResponse(self): request = b'\x37\x58' metadata = (('InVaLiD', 'UnaryRequestStreamResponse'),) expected_error_details = "metadata was invalid: %s" % metadata - response_iterator = self._unary_stream(request, metadata=metadata) - with self.assertRaises(grpc.RpcError) as exception_context: - next(response_iterator) - self.assertEqual(exception_context.exception.details(), - expected_error_details) - self.assertEqual(exception_context.exception.code(), - grpc.StatusCode.INTERNAL) - self.assertEqual(response_iterator.details(), expected_error_details) - self.assertEqual(response_iterator.code(), grpc.StatusCode.INTERNAL) + with self.assertRaises(ValueError) as exception_context: + self._unary_stream(request, metadata=metadata) + self.assertIn(expected_error_details, str(exception_context.exception)) def testStreamRequestBlockingUnaryResponse(self): request_iterator = ( @@ -129,32 +116,18 @@ class InvalidMetadataTest(unittest.TestCase): b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH)) metadata = (('InVaLiD', 'StreamRequestFutureUnaryResponse'),) expected_error_details = "metadata was invalid: %s" % metadata - response_future = self._stream_unary.future( - request_iterator, metadata=metadata) - with self.assertRaises(grpc.RpcError) as exception_context: - response_future.result() - self.assertEqual(exception_context.exception.details(), - expected_error_details) - self.assertEqual(exception_context.exception.code(), - grpc.StatusCode.INTERNAL) - self.assertEqual(response_future.details(), expected_error_details) - self.assertEqual(response_future.code(), grpc.StatusCode.INTERNAL) + with self.assertRaises(ValueError) as exception_context: + self._stream_unary.future(request_iterator, metadata=metadata) + self.assertIn(expected_error_details, str(exception_context.exception)) def testStreamRequestStreamResponse(self): request_iterator = ( b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH)) metadata = (('InVaLiD', 'StreamRequestStreamResponse'),) expected_error_details = "metadata was invalid: %s" % metadata - response_iterator = self._stream_stream( - request_iterator, metadata=metadata) - with self.assertRaises(grpc.RpcError) as exception_context: - next(response_iterator) - self.assertEqual(exception_context.exception.details(), - expected_error_details) - self.assertEqual(exception_context.exception.code(), - grpc.StatusCode.INTERNAL) - self.assertEqual(response_iterator.details(), expected_error_details) - self.assertEqual(response_iterator.code(), grpc.StatusCode.INTERNAL) + with self.assertRaises(ValueError) as exception_context: + self._stream_stream(request_iterator, metadata=metadata) + self.assertIn(expected_error_details, str(exception_context.exception)) if __name__ == '__main__': From 6a5c7ff8c758f47f34da6a72f558181ec6561faf Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Wed, 2 May 2018 12:01:25 -0700 Subject: [PATCH 139/165] update health.proto --- src/proto/grpc/health/v1/health.proto | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/proto/grpc/health/v1/health.proto b/src/proto/grpc/health/v1/health.proto index 3fda02c2c3c..bcc02f8ac83 100644 --- a/src/proto/grpc/health/v1/health.proto +++ b/src/proto/grpc/health/v1/health.proto @@ -1,4 +1,5 @@ -// Copyright 2015 gRPC authors. +// Copyright 2015, gRPC Authors +// All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,10 +13,18 @@ // See the License for the specific language governing permissions and // limitations under the License. +// The canonical version of this proto can be found at +// https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto + syntax = "proto3"; package grpc.health.v1; + option csharp_namespace = "Grpc.Health.V1"; +option go_package = "google.golang.org/grpc/health/grpc_health_v1"; +option java_multiple_files = true; +option java_outer_classname = "HealthProto"; +option java_package = "io.grpc.health.v1"; message HealthCheckRequest { string service = 1; From f6bf95f332365b5139c0d86a872c47e70d865ef0 Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Wed, 2 May 2018 12:02:14 -0700 Subject: [PATCH 140/165] update csharp gen --- src/csharp/Grpc.Examples/Math.cs | 86 +++- src/csharp/Grpc.HealthCheck/Health.cs | 42 +- src/csharp/Grpc.HealthCheck/HealthGrpc.cs | 6 +- .../BenchmarkService.cs | 6 +- src/csharp/Grpc.IntegrationTesting/Control.cs | 386 ++++++++++++++---- .../CoreStats/Stats.cs | 74 +++- .../Grpc.IntegrationTesting/EchoMessages.cs | 102 ++++- src/csharp/Grpc.IntegrationTesting/Empty.cs | 22 +- .../Grpc.IntegrationTesting/Messages.cs | 198 +++++++-- src/csharp/Grpc.IntegrationTesting/Metrics.cs | 58 ++- .../Grpc.IntegrationTesting/Payloads.cs | 70 +++- .../ReportQpsScenarioService.cs | 6 +- src/csharp/Grpc.IntegrationTesting/Stats.cs | 138 +++++-- src/csharp/Grpc.IntegrationTesting/Test.cs | 6 +- .../Grpc.IntegrationTesting/WorkerService.cs | 6 +- src/csharp/Grpc.Reflection/Reflection.cs | 134 +++++- 16 files changed, 1102 insertions(+), 238 deletions(-) diff --git a/src/csharp/Grpc.Examples/Math.cs b/src/csharp/Grpc.Examples/Math.cs index e5b76f83052..4c3879f577e 100644 --- a/src/csharp/Grpc.Examples/Math.cs +++ b/src/csharp/Grpc.Examples/Math.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: math/math.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: math/math.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -47,6 +49,7 @@ namespace Math { #region Messages public sealed partial class DivArgs : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DivArgs()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -71,6 +74,7 @@ namespace Math { public DivArgs(DivArgs other) : this() { dividend_ = other.dividend_; divisor_ = other.divisor_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -115,7 +119,7 @@ namespace Math { } if (Dividend != other.Dividend) return false; if (Divisor != other.Divisor) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -123,6 +127,9 @@ namespace Math { int hash = 1; if (Dividend != 0L) hash ^= Dividend.GetHashCode(); if (Divisor != 0L) hash ^= Divisor.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -141,6 +148,9 @@ namespace Math { output.WriteRawTag(16); output.WriteInt64(Divisor); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -152,6 +162,9 @@ namespace Math { if (Divisor != 0L) { size += 1 + pb::CodedOutputStream.ComputeInt64Size(Divisor); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -166,6 +179,7 @@ namespace Math { if (other.Divisor != 0L) { Divisor = other.Divisor; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -174,7 +188,7 @@ namespace Math { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Dividend = input.ReadInt64(); @@ -192,6 +206,7 @@ namespace Math { public sealed partial class DivReply : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DivReply()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -216,6 +231,7 @@ namespace Math { public DivReply(DivReply other) : this() { quotient_ = other.quotient_; remainder_ = other.remainder_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -260,7 +276,7 @@ namespace Math { } if (Quotient != other.Quotient) return false; if (Remainder != other.Remainder) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -268,6 +284,9 @@ namespace Math { int hash = 1; if (Quotient != 0L) hash ^= Quotient.GetHashCode(); if (Remainder != 0L) hash ^= Remainder.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -286,6 +305,9 @@ namespace Math { output.WriteRawTag(16); output.WriteInt64(Remainder); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -297,6 +319,9 @@ namespace Math { if (Remainder != 0L) { size += 1 + pb::CodedOutputStream.ComputeInt64Size(Remainder); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -311,6 +336,7 @@ namespace Math { if (other.Remainder != 0L) { Remainder = other.Remainder; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -319,7 +345,7 @@ namespace Math { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Quotient = input.ReadInt64(); @@ -337,6 +363,7 @@ namespace Math { public sealed partial class FibArgs : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FibArgs()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -360,6 +387,7 @@ namespace Math { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public FibArgs(FibArgs other) : this() { limit_ = other.limit_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -392,13 +420,16 @@ namespace Math { return true; } if (Limit != other.Limit) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Limit != 0L) hash ^= Limit.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -413,6 +444,9 @@ namespace Math { output.WriteRawTag(8); output.WriteInt64(Limit); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -421,6 +455,9 @@ namespace Math { if (Limit != 0L) { size += 1 + pb::CodedOutputStream.ComputeInt64Size(Limit); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -432,6 +469,7 @@ namespace Math { if (other.Limit != 0L) { Limit = other.Limit; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -440,7 +478,7 @@ namespace Math { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Limit = input.ReadInt64(); @@ -454,6 +492,7 @@ namespace Math { public sealed partial class Num : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Num()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -477,6 +516,7 @@ namespace Math { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Num(Num other) : this() { num_ = other.num_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -509,13 +549,16 @@ namespace Math { return true; } if (Num_ != other.Num_) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Num_ != 0L) hash ^= Num_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -530,6 +573,9 @@ namespace Math { output.WriteRawTag(8); output.WriteInt64(Num_); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -538,6 +584,9 @@ namespace Math { if (Num_ != 0L) { size += 1 + pb::CodedOutputStream.ComputeInt64Size(Num_); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -549,6 +598,7 @@ namespace Math { if (other.Num_ != 0L) { Num_ = other.Num_; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -557,7 +607,7 @@ namespace Math { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Num_ = input.ReadInt64(); @@ -571,6 +621,7 @@ namespace Math { public sealed partial class FibReply : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FibReply()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -594,6 +645,7 @@ namespace Math { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public FibReply(FibReply other) : this() { count_ = other.count_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -626,13 +678,16 @@ namespace Math { return true; } if (Count != other.Count) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Count != 0L) hash ^= Count.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -647,6 +702,9 @@ namespace Math { output.WriteRawTag(8); output.WriteInt64(Count); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -655,6 +713,9 @@ namespace Math { if (Count != 0L) { size += 1 + pb::CodedOutputStream.ComputeInt64Size(Count); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -666,6 +727,7 @@ namespace Math { if (other.Count != 0L) { Count = other.Count; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -674,7 +736,7 @@ namespace Math { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Count = input.ReadInt64(); diff --git a/src/csharp/Grpc.HealthCheck/Health.cs b/src/csharp/Grpc.HealthCheck/Health.cs index b9880d96369..a90f261d286 100644 --- a/src/csharp/Grpc.HealthCheck/Health.cs +++ b/src/csharp/Grpc.HealthCheck/Health.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: grpc/health/v1/health.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grpc/health/v1/health.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -29,7 +31,9 @@ namespace Grpc.Health.V1 { "ZXJ2aW5nU3RhdHVzEgsKB1VOS05PV04QABILCgdTRVJWSU5HEAESDwoLTk9U", "X1NFUlZJTkcQAjJaCgZIZWFsdGgSUAoFQ2hlY2sSIi5ncnBjLmhlYWx0aC52", "MS5IZWFsdGhDaGVja1JlcXVlc3QaIy5ncnBjLmhlYWx0aC52MS5IZWFsdGhD", - "aGVja1Jlc3BvbnNlQhGqAg5HcnBjLkhlYWx0aC5WMWIGcHJvdG8z")); + "aGVja1Jlc3BvbnNlQmEKEWlvLmdycGMuaGVhbHRoLnYxQgtIZWFsdGhQcm90", + "b1ABWixnb29nbGUuZ29sYW5nLm9yZy9ncnBjL2hlYWx0aC9ncnBjX2hlYWx0", + "aF92MaoCDkdycGMuSGVhbHRoLlYxYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { @@ -43,6 +47,7 @@ namespace Grpc.Health.V1 { #region Messages public sealed partial class HealthCheckRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HealthCheckRequest()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -66,6 +71,7 @@ namespace Grpc.Health.V1 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HealthCheckRequest(HealthCheckRequest other) : this() { service_ = other.service_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -98,13 +104,16 @@ namespace Grpc.Health.V1 { return true; } if (Service != other.Service) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Service.Length != 0) hash ^= Service.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -119,6 +128,9 @@ namespace Grpc.Health.V1 { output.WriteRawTag(10); output.WriteString(Service); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -127,6 +139,9 @@ namespace Grpc.Health.V1 { if (Service.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Service); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -138,6 +153,7 @@ namespace Grpc.Health.V1 { if (other.Service.Length != 0) { Service = other.Service; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -146,7 +162,7 @@ namespace Grpc.Health.V1 { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Service = input.ReadString(); @@ -160,6 +176,7 @@ namespace Grpc.Health.V1 { public sealed partial class HealthCheckResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HealthCheckResponse()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -183,6 +200,7 @@ namespace Grpc.Health.V1 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HealthCheckResponse(HealthCheckResponse other) : this() { status_ = other.status_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -215,13 +233,16 @@ namespace Grpc.Health.V1 { return true; } if (Status != other.Status) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Status != 0) hash ^= Status.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -236,6 +257,9 @@ namespace Grpc.Health.V1 { output.WriteRawTag(8); output.WriteEnum((int) Status); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -244,6 +268,9 @@ namespace Grpc.Health.V1 { if (Status != 0) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -255,6 +282,7 @@ namespace Grpc.Health.V1 { if (other.Status != 0) { Status = other.Status; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -263,7 +291,7 @@ namespace Grpc.Health.V1 { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { status_ = (global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus) input.ReadEnum(); diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs index 1d80bcd59ec..b22bd8444d6 100644 --- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs +++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs @@ -3,7 +3,8 @@ // source: grpc/health/v1/health.proto // // Original file comments: -// Copyright 2015 gRPC authors. +// Copyright 2015, gRPC Authors +// All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +18,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // +// The canonical version of this proto can be found at +// https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto +// #pragma warning disable 1591 #region Designer generated code diff --git a/src/csharp/Grpc.IntegrationTesting/BenchmarkService.cs b/src/csharp/Grpc.IntegrationTesting/BenchmarkService.cs index 11d34c6341d..bc8c10352a1 100644 --- a/src/csharp/Grpc.IntegrationTesting/BenchmarkService.cs +++ b/src/csharp/Grpc.IntegrationTesting/BenchmarkService.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/proto/grpc/testing/benchmark_service.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/benchmark_service.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code diff --git a/src/csharp/Grpc.IntegrationTesting/Control.cs b/src/csharp/Grpc.IntegrationTesting/Control.cs index 87957289068..f3284a5390f 100644 --- a/src/csharp/Grpc.IntegrationTesting/Control.cs +++ b/src/csharp/Grpc.IntegrationTesting/Control.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/proto/grpc/testing/control.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/control.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -167,6 +169,7 @@ namespace Grpc.Testing { /// public sealed partial class PoissonParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PoissonParams()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -190,6 +193,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public PoissonParams(PoissonParams other) : this() { offeredLoad_ = other.offeredLoad_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -224,14 +228,17 @@ namespace Grpc.Testing { if (ReferenceEquals(other, this)) { return true; } - if (OfferedLoad != other.OfferedLoad) return false; - return true; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(OfferedLoad, other.OfferedLoad)) return false; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (OfferedLoad != 0D) hash ^= OfferedLoad.GetHashCode(); + if (OfferedLoad != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OfferedLoad); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -246,6 +253,9 @@ namespace Grpc.Testing { output.WriteRawTag(9); output.WriteDouble(OfferedLoad); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -254,6 +264,9 @@ namespace Grpc.Testing { if (OfferedLoad != 0D) { size += 1 + 8; } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -265,6 +278,7 @@ namespace Grpc.Testing { if (other.OfferedLoad != 0D) { OfferedLoad = other.OfferedLoad; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -273,7 +287,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 9: { OfferedLoad = input.ReadDouble(); @@ -291,6 +305,7 @@ namespace Grpc.Testing { /// public sealed partial class ClosedLoopParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClosedLoopParams()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -313,6 +328,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClosedLoopParams(ClosedLoopParams other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -333,12 +349,15 @@ namespace Grpc.Testing { if (ReferenceEquals(other, this)) { return true; } - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -349,11 +368,17 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -362,6 +387,7 @@ namespace Grpc.Testing { if (other == null) { return; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -370,7 +396,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; } } @@ -380,6 +406,7 @@ namespace Grpc.Testing { public sealed partial class LoadParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LoadParams()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -411,6 +438,7 @@ namespace Grpc.Testing { break; } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -475,7 +503,7 @@ namespace Grpc.Testing { if (!object.Equals(ClosedLoop, other.ClosedLoop)) return false; if (!object.Equals(Poisson, other.Poisson)) return false; if (LoadCase != other.LoadCase) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -484,6 +512,9 @@ namespace Grpc.Testing { if (loadCase_ == LoadOneofCase.ClosedLoop) hash ^= ClosedLoop.GetHashCode(); if (loadCase_ == LoadOneofCase.Poisson) hash ^= Poisson.GetHashCode(); hash ^= (int) loadCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -502,6 +533,9 @@ namespace Grpc.Testing { output.WriteRawTag(18); output.WriteMessage(Poisson); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -513,6 +547,9 @@ namespace Grpc.Testing { if (loadCase_ == LoadOneofCase.Poisson) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Poisson); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -536,6 +573,7 @@ namespace Grpc.Testing { break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -544,7 +582,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { global::Grpc.Testing.ClosedLoopParams subBuilder = new global::Grpc.Testing.ClosedLoopParams(); @@ -575,6 +613,7 @@ namespace Grpc.Testing { /// public sealed partial class SecurityParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SecurityParams()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -600,6 +639,7 @@ namespace Grpc.Testing { useTestCa_ = other.useTestCa_; serverHostOverride_ = other.serverHostOverride_; credType_ = other.credType_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -656,7 +696,7 @@ namespace Grpc.Testing { if (UseTestCa != other.UseTestCa) return false; if (ServerHostOverride != other.ServerHostOverride) return false; if (CredType != other.CredType) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -665,6 +705,9 @@ namespace Grpc.Testing { if (UseTestCa != false) hash ^= UseTestCa.GetHashCode(); if (ServerHostOverride.Length != 0) hash ^= ServerHostOverride.GetHashCode(); if (CredType.Length != 0) hash ^= CredType.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -687,6 +730,9 @@ namespace Grpc.Testing { output.WriteRawTag(26); output.WriteString(CredType); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -701,6 +747,9 @@ namespace Grpc.Testing { if (CredType.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(CredType); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -718,6 +767,7 @@ namespace Grpc.Testing { if (other.CredType.Length != 0) { CredType = other.CredType; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -726,7 +776,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { UseTestCa = input.ReadBool(); @@ -748,6 +798,7 @@ namespace Grpc.Testing { public sealed partial class ChannelArg : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChannelArg()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -780,6 +831,7 @@ namespace Grpc.Testing { break; } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -856,7 +908,7 @@ namespace Grpc.Testing { if (StrValue != other.StrValue) return false; if (IntValue != other.IntValue) return false; if (ValueCase != other.ValueCase) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -866,6 +918,9 @@ namespace Grpc.Testing { if (valueCase_ == ValueOneofCase.StrValue) hash ^= StrValue.GetHashCode(); if (valueCase_ == ValueOneofCase.IntValue) hash ^= IntValue.GetHashCode(); hash ^= (int) valueCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -888,6 +943,9 @@ namespace Grpc.Testing { output.WriteRawTag(24); output.WriteInt32(IntValue); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -902,6 +960,9 @@ namespace Grpc.Testing { if (valueCase_ == ValueOneofCase.IntValue) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(IntValue); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -922,6 +983,7 @@ namespace Grpc.Testing { break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -930,7 +992,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Name = input.ReadString(); @@ -952,6 +1014,7 @@ namespace Grpc.Testing { public sealed partial class ClientConfig : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientConfig()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -991,6 +1054,7 @@ namespace Grpc.Testing { threadsPerCq_ = other.threadsPerCq_; messagesPerStream_ = other.messagesPerStream_; useCoalesceApi_ = other.useCoalesceApi_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1244,7 +1308,7 @@ namespace Grpc.Testing { if (ThreadsPerCq != other.ThreadsPerCq) return false; if (MessagesPerStream != other.MessagesPerStream) return false; if (UseCoalesceApi != other.UseCoalesceApi) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1267,6 +1331,9 @@ namespace Grpc.Testing { if (ThreadsPerCq != 0) hash ^= ThreadsPerCq.GetHashCode(); if (MessagesPerStream != 0) hash ^= MessagesPerStream.GetHashCode(); if (UseCoalesceApi != false) hash ^= UseCoalesceApi.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1336,6 +1403,9 @@ namespace Grpc.Testing { output.WriteRawTag(152, 1); output.WriteBool(UseCoalesceApi); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1386,6 +1456,9 @@ namespace Grpc.Testing { if (UseCoalesceApi != false) { size += 2 + 1; } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1451,6 +1524,7 @@ namespace Grpc.Testing { if (other.UseCoalesceApi != false) { UseCoalesceApi = other.UseCoalesceApi; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1459,7 +1533,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { serverTargets_.AddEntriesFrom(input, _repeated_serverTargets_codec); @@ -1550,6 +1624,7 @@ namespace Grpc.Testing { public sealed partial class ClientStatus : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientStatus()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1573,6 +1648,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClientStatus(ClientStatus other) : this() { Stats = other.stats_ != null ? other.Stats.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1605,13 +1681,16 @@ namespace Grpc.Testing { return true; } if (!object.Equals(Stats, other.Stats)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (stats_ != null) hash ^= Stats.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1626,6 +1705,9 @@ namespace Grpc.Testing { output.WriteRawTag(10); output.WriteMessage(Stats); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1634,6 +1716,9 @@ namespace Grpc.Testing { if (stats_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Stats); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1648,6 +1733,7 @@ namespace Grpc.Testing { } Stats.MergeFrom(other.Stats); } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1656,7 +1742,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { if (stats_ == null) { @@ -1676,6 +1762,7 @@ namespace Grpc.Testing { /// public sealed partial class Mark : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Mark()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1699,6 +1786,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Mark(Mark other) : this() { reset_ = other.reset_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1734,13 +1822,16 @@ namespace Grpc.Testing { return true; } if (Reset != other.Reset) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Reset != false) hash ^= Reset.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1755,6 +1846,9 @@ namespace Grpc.Testing { output.WriteRawTag(8); output.WriteBool(Reset); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1763,6 +1857,9 @@ namespace Grpc.Testing { if (Reset != false) { size += 1 + 1; } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1774,6 +1871,7 @@ namespace Grpc.Testing { if (other.Reset != false) { Reset = other.Reset; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1782,7 +1880,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Reset = input.ReadBool(); @@ -1796,6 +1894,7 @@ namespace Grpc.Testing { public sealed partial class ClientArgs : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientArgs()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1827,6 +1926,7 @@ namespace Grpc.Testing { break; } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1891,7 +1991,7 @@ namespace Grpc.Testing { if (!object.Equals(Setup, other.Setup)) return false; if (!object.Equals(Mark, other.Mark)) return false; if (ArgtypeCase != other.ArgtypeCase) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1900,6 +2000,9 @@ namespace Grpc.Testing { if (argtypeCase_ == ArgtypeOneofCase.Setup) hash ^= Setup.GetHashCode(); if (argtypeCase_ == ArgtypeOneofCase.Mark) hash ^= Mark.GetHashCode(); hash ^= (int) argtypeCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1918,6 +2021,9 @@ namespace Grpc.Testing { output.WriteRawTag(18); output.WriteMessage(Mark); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1929,6 +2035,9 @@ namespace Grpc.Testing { if (argtypeCase_ == ArgtypeOneofCase.Mark) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Mark); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1952,6 +2061,7 @@ namespace Grpc.Testing { break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1960,7 +2070,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { global::Grpc.Testing.ClientConfig subBuilder = new global::Grpc.Testing.ClientConfig(); @@ -1988,6 +2098,7 @@ namespace Grpc.Testing { public sealed partial class ServerConfig : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerConfig()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -2021,6 +2132,7 @@ namespace Grpc.Testing { threadsPerCq_ = other.threadsPerCq_; resourceQuotaSize_ = other.resourceQuotaSize_; channelArgs_ = other.channelArgs_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2198,7 +2310,7 @@ namespace Grpc.Testing { if (ThreadsPerCq != other.ThreadsPerCq) return false; if (ResourceQuotaSize != other.ResourceQuotaSize) return false; if(!channelArgs_.Equals(other.channelArgs_)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2215,6 +2327,9 @@ namespace Grpc.Testing { if (ThreadsPerCq != 0) hash ^= ThreadsPerCq.GetHashCode(); if (ResourceQuotaSize != 0) hash ^= ResourceQuotaSize.GetHashCode(); hash ^= channelArgs_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -2263,6 +2378,9 @@ namespace Grpc.Testing { output.WriteInt32(ResourceQuotaSize); } channelArgs_.WriteTo(output, _repeated_channelArgs_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2297,6 +2415,9 @@ namespace Grpc.Testing { size += 2 + pb::CodedOutputStream.ComputeInt32Size(ResourceQuotaSize); } size += channelArgs_.CalculateSize(_repeated_channelArgs_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -2340,6 +2461,7 @@ namespace Grpc.Testing { ResourceQuotaSize = other.ResourceQuotaSize; } channelArgs_.Add(other.channelArgs_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2348,7 +2470,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { serverType_ = (global::Grpc.Testing.ServerType) input.ReadEnum(); @@ -2409,6 +2531,7 @@ namespace Grpc.Testing { public sealed partial class ServerArgs : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerArgs()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -2440,6 +2563,7 @@ namespace Grpc.Testing { break; } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2504,7 +2628,7 @@ namespace Grpc.Testing { if (!object.Equals(Setup, other.Setup)) return false; if (!object.Equals(Mark, other.Mark)) return false; if (ArgtypeCase != other.ArgtypeCase) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2513,6 +2637,9 @@ namespace Grpc.Testing { if (argtypeCase_ == ArgtypeOneofCase.Setup) hash ^= Setup.GetHashCode(); if (argtypeCase_ == ArgtypeOneofCase.Mark) hash ^= Mark.GetHashCode(); hash ^= (int) argtypeCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -2531,6 +2658,9 @@ namespace Grpc.Testing { output.WriteRawTag(18); output.WriteMessage(Mark); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2542,6 +2672,9 @@ namespace Grpc.Testing { if (argtypeCase_ == ArgtypeOneofCase.Mark) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Mark); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -2565,6 +2698,7 @@ namespace Grpc.Testing { break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2573,7 +2707,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { global::Grpc.Testing.ServerConfig subBuilder = new global::Grpc.Testing.ServerConfig(); @@ -2601,6 +2735,7 @@ namespace Grpc.Testing { public sealed partial class ServerStatus : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerStatus()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -2626,6 +2761,7 @@ namespace Grpc.Testing { Stats = other.stats_ != null ? other.Stats.Clone() : null; port_ = other.port_; cores_ = other.cores_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2688,7 +2824,7 @@ namespace Grpc.Testing { if (!object.Equals(Stats, other.Stats)) return false; if (Port != other.Port) return false; if (Cores != other.Cores) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2697,6 +2833,9 @@ namespace Grpc.Testing { if (stats_ != null) hash ^= Stats.GetHashCode(); if (Port != 0) hash ^= Port.GetHashCode(); if (Cores != 0) hash ^= Cores.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -2719,6 +2858,9 @@ namespace Grpc.Testing { output.WriteRawTag(24); output.WriteInt32(Cores); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2733,6 +2875,9 @@ namespace Grpc.Testing { if (Cores != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(Cores); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -2753,6 +2898,7 @@ namespace Grpc.Testing { if (other.Cores != 0) { Cores = other.Cores; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2761,7 +2907,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { if (stats_ == null) { @@ -2786,6 +2932,7 @@ namespace Grpc.Testing { public sealed partial class CoreRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CoreRequest()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -2808,6 +2955,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public CoreRequest(CoreRequest other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2828,12 +2976,15 @@ namespace Grpc.Testing { if (ReferenceEquals(other, this)) { return true; } - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -2844,11 +2995,17 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -2857,6 +3014,7 @@ namespace Grpc.Testing { if (other == null) { return; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2865,7 +3023,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; } } @@ -2875,6 +3033,7 @@ namespace Grpc.Testing { public sealed partial class CoreResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CoreResponse()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -2898,6 +3057,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public CoreResponse(CoreResponse other) : this() { cores_ = other.cores_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2933,13 +3093,16 @@ namespace Grpc.Testing { return true; } if (Cores != other.Cores) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Cores != 0) hash ^= Cores.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -2954,6 +3117,9 @@ namespace Grpc.Testing { output.WriteRawTag(8); output.WriteInt32(Cores); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2962,6 +3128,9 @@ namespace Grpc.Testing { if (Cores != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(Cores); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -2973,6 +3142,7 @@ namespace Grpc.Testing { if (other.Cores != 0) { Cores = other.Cores; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2981,7 +3151,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Cores = input.ReadInt32(); @@ -2995,6 +3165,7 @@ namespace Grpc.Testing { public sealed partial class Void : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Void()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -3017,6 +3188,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Void(Void other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3037,12 +3209,15 @@ namespace Grpc.Testing { if (ReferenceEquals(other, this)) { return true; } - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -3053,11 +3228,17 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -3066,6 +3247,7 @@ namespace Grpc.Testing { if (other == null) { return; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3074,7 +3256,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; } } @@ -3087,6 +3269,7 @@ namespace Grpc.Testing { /// public sealed partial class Scenario : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Scenario()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -3117,6 +3300,7 @@ namespace Grpc.Testing { warmupSeconds_ = other.warmupSeconds_; benchmarkSeconds_ = other.benchmarkSeconds_; spawnLocalWorkerCount_ = other.spawnLocalWorkerCount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3257,7 +3441,7 @@ namespace Grpc.Testing { if (WarmupSeconds != other.WarmupSeconds) return false; if (BenchmarkSeconds != other.BenchmarkSeconds) return false; if (SpawnLocalWorkerCount != other.SpawnLocalWorkerCount) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3271,6 +3455,9 @@ namespace Grpc.Testing { if (WarmupSeconds != 0) hash ^= WarmupSeconds.GetHashCode(); if (BenchmarkSeconds != 0) hash ^= BenchmarkSeconds.GetHashCode(); if (SpawnLocalWorkerCount != 0) hash ^= SpawnLocalWorkerCount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -3313,6 +3500,9 @@ namespace Grpc.Testing { output.WriteRawTag(64); output.WriteInt32(SpawnLocalWorkerCount); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3342,6 +3532,9 @@ namespace Grpc.Testing { if (SpawnLocalWorkerCount != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(SpawnLocalWorkerCount); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -3380,6 +3573,7 @@ namespace Grpc.Testing { if (other.SpawnLocalWorkerCount != 0) { SpawnLocalWorkerCount = other.SpawnLocalWorkerCount; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3388,7 +3582,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Name = input.ReadString(); @@ -3439,6 +3633,7 @@ namespace Grpc.Testing { /// public sealed partial class Scenarios : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Scenarios()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -3462,6 +3657,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Scenarios(Scenarios other) : this() { scenarios_ = other.scenarios_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3493,13 +3689,16 @@ namespace Grpc.Testing { return true; } if(!scenarios_.Equals(other.scenarios_)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; hash ^= scenarios_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -3511,12 +3710,18 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { scenarios_.WriteTo(output, _repeated_scenarios_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; size += scenarios_.CalculateSize(_repeated_scenarios_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -3526,6 +3731,7 @@ namespace Grpc.Testing { return; } scenarios_.Add(other.scenarios_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3534,7 +3740,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { scenarios_.AddEntriesFrom(input, _repeated_scenarios_codec); @@ -3552,6 +3758,7 @@ namespace Grpc.Testing { /// public sealed partial class ScenarioResultSummary : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScenarioResultSummary()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -3592,6 +3799,7 @@ namespace Grpc.Testing { serverPollsPerRequest_ = other.serverPollsPerRequest_; serverQueriesPerCpuSec_ = other.serverQueriesPerCpuSec_; clientQueriesPerCpuSec_ = other.clientQueriesPerCpuSec_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3843,48 +4051,51 @@ namespace Grpc.Testing { if (ReferenceEquals(other, this)) { return true; } - if (Qps != other.Qps) return false; - if (QpsPerServerCore != other.QpsPerServerCore) return false; - if (ServerSystemTime != other.ServerSystemTime) return false; - if (ServerUserTime != other.ServerUserTime) return false; - if (ClientSystemTime != other.ClientSystemTime) return false; - if (ClientUserTime != other.ClientUserTime) return false; - if (Latency50 != other.Latency50) return false; - if (Latency90 != other.Latency90) return false; - if (Latency95 != other.Latency95) return false; - if (Latency99 != other.Latency99) return false; - if (Latency999 != other.Latency999) return false; - if (ServerCpuUsage != other.ServerCpuUsage) return false; - if (SuccessfulRequestsPerSecond != other.SuccessfulRequestsPerSecond) return false; - if (FailedRequestsPerSecond != other.FailedRequestsPerSecond) return false; - if (ClientPollsPerRequest != other.ClientPollsPerRequest) return false; - if (ServerPollsPerRequest != other.ServerPollsPerRequest) return false; - if (ServerQueriesPerCpuSec != other.ServerQueriesPerCpuSec) return false; - if (ClientQueriesPerCpuSec != other.ClientQueriesPerCpuSec) return false; - return true; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Qps, other.Qps)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(QpsPerServerCore, other.QpsPerServerCore)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(ServerSystemTime, other.ServerSystemTime)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(ServerUserTime, other.ServerUserTime)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(ClientSystemTime, other.ClientSystemTime)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(ClientUserTime, other.ClientUserTime)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Latency50, other.Latency50)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Latency90, other.Latency90)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Latency95, other.Latency95)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Latency99, other.Latency99)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Latency999, other.Latency999)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(ServerCpuUsage, other.ServerCpuUsage)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(SuccessfulRequestsPerSecond, other.SuccessfulRequestsPerSecond)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(FailedRequestsPerSecond, other.FailedRequestsPerSecond)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(ClientPollsPerRequest, other.ClientPollsPerRequest)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(ServerPollsPerRequest, other.ServerPollsPerRequest)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(ServerQueriesPerCpuSec, other.ServerQueriesPerCpuSec)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(ClientQueriesPerCpuSec, other.ClientQueriesPerCpuSec)) return false; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Qps != 0D) hash ^= Qps.GetHashCode(); - if (QpsPerServerCore != 0D) hash ^= QpsPerServerCore.GetHashCode(); - if (ServerSystemTime != 0D) hash ^= ServerSystemTime.GetHashCode(); - if (ServerUserTime != 0D) hash ^= ServerUserTime.GetHashCode(); - if (ClientSystemTime != 0D) hash ^= ClientSystemTime.GetHashCode(); - if (ClientUserTime != 0D) hash ^= ClientUserTime.GetHashCode(); - if (Latency50 != 0D) hash ^= Latency50.GetHashCode(); - if (Latency90 != 0D) hash ^= Latency90.GetHashCode(); - if (Latency95 != 0D) hash ^= Latency95.GetHashCode(); - if (Latency99 != 0D) hash ^= Latency99.GetHashCode(); - if (Latency999 != 0D) hash ^= Latency999.GetHashCode(); - if (ServerCpuUsage != 0D) hash ^= ServerCpuUsage.GetHashCode(); - if (SuccessfulRequestsPerSecond != 0D) hash ^= SuccessfulRequestsPerSecond.GetHashCode(); - if (FailedRequestsPerSecond != 0D) hash ^= FailedRequestsPerSecond.GetHashCode(); - if (ClientPollsPerRequest != 0D) hash ^= ClientPollsPerRequest.GetHashCode(); - if (ServerPollsPerRequest != 0D) hash ^= ServerPollsPerRequest.GetHashCode(); - if (ServerQueriesPerCpuSec != 0D) hash ^= ServerQueriesPerCpuSec.GetHashCode(); - if (ClientQueriesPerCpuSec != 0D) hash ^= ClientQueriesPerCpuSec.GetHashCode(); + if (Qps != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Qps); + if (QpsPerServerCore != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(QpsPerServerCore); + if (ServerSystemTime != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ServerSystemTime); + if (ServerUserTime != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ServerUserTime); + if (ClientSystemTime != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ClientSystemTime); + if (ClientUserTime != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ClientUserTime); + if (Latency50 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Latency50); + if (Latency90 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Latency90); + if (Latency95 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Latency95); + if (Latency99 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Latency99); + if (Latency999 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Latency999); + if (ServerCpuUsage != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ServerCpuUsage); + if (SuccessfulRequestsPerSecond != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(SuccessfulRequestsPerSecond); + if (FailedRequestsPerSecond != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FailedRequestsPerSecond); + if (ClientPollsPerRequest != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ClientPollsPerRequest); + if (ServerPollsPerRequest != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ServerPollsPerRequest); + if (ServerQueriesPerCpuSec != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ServerQueriesPerCpuSec); + if (ClientQueriesPerCpuSec != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ClientQueriesPerCpuSec); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -3967,6 +4178,9 @@ namespace Grpc.Testing { output.WriteRawTag(145, 1); output.WriteDouble(ClientQueriesPerCpuSec); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4026,6 +4240,9 @@ namespace Grpc.Testing { if (ClientQueriesPerCpuSec != 0D) { size += 2 + 8; } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -4088,6 +4305,7 @@ namespace Grpc.Testing { if (other.ClientQueriesPerCpuSec != 0D) { ClientQueriesPerCpuSec = other.ClientQueriesPerCpuSec; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4096,7 +4314,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 9: { Qps = input.ReadDouble(); @@ -4181,6 +4399,7 @@ namespace Grpc.Testing { /// public sealed partial class ScenarioResult : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScenarioResult()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -4212,6 +4431,7 @@ namespace Grpc.Testing { clientSuccess_ = other.clientSuccess_.Clone(); serverSuccess_ = other.serverSuccess_.Clone(); requestResults_ = other.requestResults_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4358,7 +4578,7 @@ namespace Grpc.Testing { if(!clientSuccess_.Equals(other.clientSuccess_)) return false; if(!serverSuccess_.Equals(other.serverSuccess_)) return false; if(!requestResults_.Equals(other.requestResults_)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4373,6 +4593,9 @@ namespace Grpc.Testing { hash ^= clientSuccess_.GetHashCode(); hash ^= serverSuccess_.GetHashCode(); hash ^= requestResults_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -4401,6 +4624,9 @@ namespace Grpc.Testing { clientSuccess_.WriteTo(output, _repeated_clientSuccess_codec); serverSuccess_.WriteTo(output, _repeated_serverSuccess_codec); requestResults_.WriteTo(output, _repeated_requestResults_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4421,6 +4647,9 @@ namespace Grpc.Testing { size += clientSuccess_.CalculateSize(_repeated_clientSuccess_codec); size += serverSuccess_.CalculateSize(_repeated_serverSuccess_codec); size += requestResults_.CalculateSize(_repeated_requestResults_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -4453,6 +4682,7 @@ namespace Grpc.Testing { clientSuccess_.Add(other.clientSuccess_); serverSuccess_.Add(other.serverSuccess_); requestResults_.Add(other.requestResults_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4461,7 +4691,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { if (scenario_ == null) { diff --git a/src/csharp/Grpc.IntegrationTesting/CoreStats/Stats.cs b/src/csharp/Grpc.IntegrationTesting/CoreStats/Stats.cs index 380294e3358..4ff56cd3ec7 100644 --- a/src/csharp/Grpc.IntegrationTesting/CoreStats/Stats.cs +++ b/src/csharp/Grpc.IntegrationTesting/CoreStats/Stats.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: grpc/core/stats.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grpc/core/stats.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -43,6 +45,7 @@ namespace Grpc.Core { #region Messages public sealed partial class Bucket : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Bucket()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -67,6 +70,7 @@ namespace Grpc.Core { public Bucket(Bucket other) : this() { start_ = other.start_; count_ = other.count_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -109,16 +113,19 @@ namespace Grpc.Core { if (ReferenceEquals(other, this)) { return true; } - if (Start != other.Start) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Start, other.Start)) return false; if (Count != other.Count) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Start != 0D) hash ^= Start.GetHashCode(); + if (Start != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Start); if (Count != 0UL) hash ^= Count.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -137,6 +144,9 @@ namespace Grpc.Core { output.WriteRawTag(16); output.WriteUInt64(Count); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -148,6 +158,9 @@ namespace Grpc.Core { if (Count != 0UL) { size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Count); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -162,6 +175,7 @@ namespace Grpc.Core { if (other.Count != 0UL) { Count = other.Count; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -170,7 +184,7 @@ namespace Grpc.Core { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 9: { Start = input.ReadDouble(); @@ -188,6 +202,7 @@ namespace Grpc.Core { public sealed partial class Histogram : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Histogram()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -211,6 +226,7 @@ namespace Grpc.Core { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Histogram(Histogram other) : this() { buckets_ = other.buckets_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -242,13 +258,16 @@ namespace Grpc.Core { return true; } if(!buckets_.Equals(other.buckets_)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; hash ^= buckets_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -260,12 +279,18 @@ namespace Grpc.Core { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { buckets_.WriteTo(output, _repeated_buckets_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; size += buckets_.CalculateSize(_repeated_buckets_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -275,6 +300,7 @@ namespace Grpc.Core { return; } buckets_.Add(other.buckets_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -283,7 +309,7 @@ namespace Grpc.Core { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { buckets_.AddEntriesFrom(input, _repeated_buckets_codec); @@ -297,6 +323,7 @@ namespace Grpc.Core { public sealed partial class Metric : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Metric()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -329,6 +356,7 @@ namespace Grpc.Core { break; } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -405,7 +433,7 @@ namespace Grpc.Core { if (Count != other.Count) return false; if (!object.Equals(Histogram, other.Histogram)) return false; if (ValueCase != other.ValueCase) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -415,6 +443,9 @@ namespace Grpc.Core { if (valueCase_ == ValueOneofCase.Count) hash ^= Count.GetHashCode(); if (valueCase_ == ValueOneofCase.Histogram) hash ^= Histogram.GetHashCode(); hash ^= (int) valueCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -437,6 +468,9 @@ namespace Grpc.Core { output.WriteRawTag(90); output.WriteMessage(Histogram); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -451,6 +485,9 @@ namespace Grpc.Core { if (valueCase_ == ValueOneofCase.Histogram) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Histogram); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -474,6 +511,7 @@ namespace Grpc.Core { break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -482,7 +520,7 @@ namespace Grpc.Core { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Name = input.ReadString(); @@ -509,6 +547,7 @@ namespace Grpc.Core { public sealed partial class Stats : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Stats()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -532,6 +571,7 @@ namespace Grpc.Core { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Stats(Stats other) : this() { metrics_ = other.metrics_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -563,13 +603,16 @@ namespace Grpc.Core { return true; } if(!metrics_.Equals(other.metrics_)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; hash ^= metrics_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -581,12 +624,18 @@ namespace Grpc.Core { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { metrics_.WriteTo(output, _repeated_metrics_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; size += metrics_.CalculateSize(_repeated_metrics_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -596,6 +645,7 @@ namespace Grpc.Core { return; } metrics_.Add(other.metrics_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -604,7 +654,7 @@ namespace Grpc.Core { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { metrics_.AddEntriesFrom(input, _repeated_metrics_codec); diff --git a/src/csharp/Grpc.IntegrationTesting/EchoMessages.cs b/src/csharp/Grpc.IntegrationTesting/EchoMessages.cs index 9581aded582..39c3d76ce82 100644 --- a/src/csharp/Grpc.IntegrationTesting/EchoMessages.cs +++ b/src/csharp/Grpc.IntegrationTesting/EchoMessages.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/proto/grpc/testing/echo_messages.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/echo_messages.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -63,6 +65,7 @@ namespace Grpc.Testing { /// public sealed partial class DebugInfo : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DebugInfo()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -87,6 +90,7 @@ namespace Grpc.Testing { public DebugInfo(DebugInfo other) : this() { stackEntries_ = other.stackEntries_.Clone(); detail_ = other.detail_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -130,7 +134,7 @@ namespace Grpc.Testing { } if(!stackEntries_.Equals(other.stackEntries_)) return false; if (Detail != other.Detail) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -138,6 +142,9 @@ namespace Grpc.Testing { int hash = 1; hash ^= stackEntries_.GetHashCode(); if (Detail.Length != 0) hash ^= Detail.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -153,6 +160,9 @@ namespace Grpc.Testing { output.WriteRawTag(18); output.WriteString(Detail); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -162,6 +172,9 @@ namespace Grpc.Testing { if (Detail.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Detail); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -174,6 +187,7 @@ namespace Grpc.Testing { if (other.Detail.Length != 0) { Detail = other.Detail; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -182,7 +196,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { stackEntries_.AddEntriesFrom(input, _repeated_stackEntries_codec); @@ -203,6 +217,7 @@ namespace Grpc.Testing { /// public sealed partial class ErrorStatus : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ErrorStatus()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -228,6 +243,7 @@ namespace Grpc.Testing { code_ = other.code_; errorMessage_ = other.errorMessage_; binaryErrorDetails_ = other.binaryErrorDetails_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -284,7 +300,7 @@ namespace Grpc.Testing { if (Code != other.Code) return false; if (ErrorMessage != other.ErrorMessage) return false; if (BinaryErrorDetails != other.BinaryErrorDetails) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -293,6 +309,9 @@ namespace Grpc.Testing { if (Code != 0) hash ^= Code.GetHashCode(); if (ErrorMessage.Length != 0) hash ^= ErrorMessage.GetHashCode(); if (BinaryErrorDetails.Length != 0) hash ^= BinaryErrorDetails.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -315,6 +334,9 @@ namespace Grpc.Testing { output.WriteRawTag(26); output.WriteString(BinaryErrorDetails); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -329,6 +351,9 @@ namespace Grpc.Testing { if (BinaryErrorDetails.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(BinaryErrorDetails); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -346,6 +371,7 @@ namespace Grpc.Testing { if (other.BinaryErrorDetails.Length != 0) { BinaryErrorDetails = other.BinaryErrorDetails; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -354,7 +380,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Code = input.ReadInt32(); @@ -376,6 +402,7 @@ namespace Grpc.Testing { public sealed partial class RequestParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RequestParams()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -413,6 +440,7 @@ namespace Grpc.Testing { binaryErrorDetails_ = other.binaryErrorDetails_; ExpectedError = other.expectedError_ != null ? other.ExpectedError.Clone() : null; serverSleepUs_ = other.serverSleepUs_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -622,7 +650,7 @@ namespace Grpc.Testing { if (BinaryErrorDetails != other.BinaryErrorDetails) return false; if (!object.Equals(ExpectedError, other.ExpectedError)) return false; if (ServerSleepUs != other.ServerSleepUs) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -643,6 +671,9 @@ namespace Grpc.Testing { if (BinaryErrorDetails.Length != 0) hash ^= BinaryErrorDetails.GetHashCode(); if (expectedError_ != null) hash ^= ExpectedError.GetHashCode(); if (ServerSleepUs != 0) hash ^= ServerSleepUs.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -713,6 +744,9 @@ namespace Grpc.Testing { output.WriteRawTag(120); output.WriteInt32(ServerSleepUs); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -763,6 +797,9 @@ namespace Grpc.Testing { if (ServerSleepUs != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(ServerSleepUs); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -822,6 +859,7 @@ namespace Grpc.Testing { if (other.ServerSleepUs != 0) { ServerSleepUs = other.ServerSleepUs; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -830,7 +868,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { EchoDeadline = input.ReadBool(); @@ -906,6 +944,7 @@ namespace Grpc.Testing { public sealed partial class EchoRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EchoRequest()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -930,6 +969,7 @@ namespace Grpc.Testing { public EchoRequest(EchoRequest other) : this() { message_ = other.message_; Param = other.param_ != null ? other.Param.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -974,7 +1014,7 @@ namespace Grpc.Testing { } if (Message != other.Message) return false; if (!object.Equals(Param, other.Param)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -982,6 +1022,9 @@ namespace Grpc.Testing { int hash = 1; if (Message.Length != 0) hash ^= Message.GetHashCode(); if (param_ != null) hash ^= Param.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1000,6 +1043,9 @@ namespace Grpc.Testing { output.WriteRawTag(18); output.WriteMessage(Param); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1011,6 +1057,9 @@ namespace Grpc.Testing { if (param_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Param); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1028,6 +1077,7 @@ namespace Grpc.Testing { } Param.MergeFrom(other.Param); } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1036,7 +1086,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Message = input.ReadString(); @@ -1057,6 +1107,7 @@ namespace Grpc.Testing { public sealed partial class ResponseParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResponseParams()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1082,6 +1133,7 @@ namespace Grpc.Testing { requestDeadline_ = other.requestDeadline_; host_ = other.host_; peer_ = other.peer_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1138,7 +1190,7 @@ namespace Grpc.Testing { if (RequestDeadline != other.RequestDeadline) return false; if (Host != other.Host) return false; if (Peer != other.Peer) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1147,6 +1199,9 @@ namespace Grpc.Testing { if (RequestDeadline != 0L) hash ^= RequestDeadline.GetHashCode(); if (Host.Length != 0) hash ^= Host.GetHashCode(); if (Peer.Length != 0) hash ^= Peer.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1169,6 +1224,9 @@ namespace Grpc.Testing { output.WriteRawTag(26); output.WriteString(Peer); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1183,6 +1241,9 @@ namespace Grpc.Testing { if (Peer.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Peer); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1200,6 +1261,7 @@ namespace Grpc.Testing { if (other.Peer.Length != 0) { Peer = other.Peer; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1208,7 +1270,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { RequestDeadline = input.ReadInt64(); @@ -1230,6 +1292,7 @@ namespace Grpc.Testing { public sealed partial class EchoResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EchoResponse()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1254,6 +1317,7 @@ namespace Grpc.Testing { public EchoResponse(EchoResponse other) : this() { message_ = other.message_; Param = other.param_ != null ? other.Param.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1298,7 +1362,7 @@ namespace Grpc.Testing { } if (Message != other.Message) return false; if (!object.Equals(Param, other.Param)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1306,6 +1370,9 @@ namespace Grpc.Testing { int hash = 1; if (Message.Length != 0) hash ^= Message.GetHashCode(); if (param_ != null) hash ^= Param.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1324,6 +1391,9 @@ namespace Grpc.Testing { output.WriteRawTag(18); output.WriteMessage(Param); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1335,6 +1405,9 @@ namespace Grpc.Testing { if (param_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Param); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1352,6 +1425,7 @@ namespace Grpc.Testing { } Param.MergeFrom(other.Param); } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1360,7 +1434,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Message = input.ReadString(); diff --git a/src/csharp/Grpc.IntegrationTesting/Empty.cs b/src/csharp/Grpc.IntegrationTesting/Empty.cs index 24ffd617417..0d4c28bf7fc 100644 --- a/src/csharp/Grpc.IntegrationTesting/Empty.cs +++ b/src/csharp/Grpc.IntegrationTesting/Empty.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/proto/grpc/testing/empty.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/empty.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -45,6 +47,7 @@ namespace Grpc.Testing { /// public sealed partial class Empty : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Empty()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -67,6 +70,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Empty(Empty other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -87,12 +91,15 @@ namespace Grpc.Testing { if (ReferenceEquals(other, this)) { return true; } - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -103,11 +110,17 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -116,6 +129,7 @@ namespace Grpc.Testing { if (other == null) { return; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -124,7 +138,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; } } diff --git a/src/csharp/Grpc.IntegrationTesting/Messages.cs b/src/csharp/Grpc.IntegrationTesting/Messages.cs index 278ef662e47..b5c93babd20 100644 --- a/src/csharp/Grpc.IntegrationTesting/Messages.cs +++ b/src/csharp/Grpc.IntegrationTesting/Messages.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/proto/grpc/testing/messages.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/messages.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -95,6 +97,7 @@ namespace Grpc.Testing { /// public sealed partial class BoolValue : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoolValue()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -118,6 +121,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public BoolValue(BoolValue other) : this() { value_ = other.value_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -153,13 +157,16 @@ namespace Grpc.Testing { return true; } if (Value != other.Value) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Value != false) hash ^= Value.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -174,6 +181,9 @@ namespace Grpc.Testing { output.WriteRawTag(8); output.WriteBool(Value); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -182,6 +192,9 @@ namespace Grpc.Testing { if (Value != false) { size += 1 + 1; } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -193,6 +206,7 @@ namespace Grpc.Testing { if (other.Value != false) { Value = other.Value; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -201,7 +215,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Value = input.ReadBool(); @@ -218,6 +232,7 @@ namespace Grpc.Testing { /// public sealed partial class Payload : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Payload()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -242,6 +257,7 @@ namespace Grpc.Testing { public Payload(Payload other) : this() { type_ = other.type_; body_ = other.body_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -293,7 +309,7 @@ namespace Grpc.Testing { } if (Type != other.Type) return false; if (Body != other.Body) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -301,6 +317,9 @@ namespace Grpc.Testing { int hash = 1; if (Type != 0) hash ^= Type.GetHashCode(); if (Body.Length != 0) hash ^= Body.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -319,6 +338,9 @@ namespace Grpc.Testing { output.WriteRawTag(18); output.WriteBytes(Body); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -330,6 +352,9 @@ namespace Grpc.Testing { if (Body.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeBytesSize(Body); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -344,6 +369,7 @@ namespace Grpc.Testing { if (other.Body.Length != 0) { Body = other.Body; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -352,7 +378,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { type_ = (global::Grpc.Testing.PayloadType) input.ReadEnum(); @@ -374,6 +400,7 @@ namespace Grpc.Testing { /// public sealed partial class EchoStatus : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EchoStatus()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -398,6 +425,7 @@ namespace Grpc.Testing { public EchoStatus(EchoStatus other) : this() { code_ = other.code_; message_ = other.message_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -442,7 +470,7 @@ namespace Grpc.Testing { } if (Code != other.Code) return false; if (Message != other.Message) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -450,6 +478,9 @@ namespace Grpc.Testing { int hash = 1; if (Code != 0) hash ^= Code.GetHashCode(); if (Message.Length != 0) hash ^= Message.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -468,6 +499,9 @@ namespace Grpc.Testing { output.WriteRawTag(18); output.WriteString(Message); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -479,6 +513,9 @@ namespace Grpc.Testing { if (Message.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -493,6 +530,7 @@ namespace Grpc.Testing { if (other.Message.Length != 0) { Message = other.Message; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -501,7 +539,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Code = input.ReadInt32(); @@ -522,6 +560,7 @@ namespace Grpc.Testing { /// public sealed partial class SimpleRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SimpleRequest()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -552,6 +591,7 @@ namespace Grpc.Testing { ResponseCompressed = other.responseCompressed_ != null ? other.ResponseCompressed.Clone() : null; ResponseStatus = other.responseStatus_ != null ? other.ResponseStatus.Clone() : null; ExpectCompressed = other.expectCompressed_ != null ? other.ExpectCompressed.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -697,7 +737,7 @@ namespace Grpc.Testing { if (!object.Equals(ResponseCompressed, other.ResponseCompressed)) return false; if (!object.Equals(ResponseStatus, other.ResponseStatus)) return false; if (!object.Equals(ExpectCompressed, other.ExpectCompressed)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -711,6 +751,9 @@ namespace Grpc.Testing { if (responseCompressed_ != null) hash ^= ResponseCompressed.GetHashCode(); if (responseStatus_ != null) hash ^= ResponseStatus.GetHashCode(); if (expectCompressed_ != null) hash ^= ExpectCompressed.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -753,6 +796,9 @@ namespace Grpc.Testing { output.WriteRawTag(66); output.WriteMessage(ExpectCompressed); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -782,6 +828,9 @@ namespace Grpc.Testing { if (expectCompressed_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExpectCompressed); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -826,6 +875,7 @@ namespace Grpc.Testing { } ExpectCompressed.MergeFrom(other.ExpectCompressed); } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -834,7 +884,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { responseType_ = (global::Grpc.Testing.PayloadType) input.ReadEnum(); @@ -891,6 +941,7 @@ namespace Grpc.Testing { /// public sealed partial class SimpleResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SimpleResponse()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -916,6 +967,7 @@ namespace Grpc.Testing { Payload = other.payload_ != null ? other.Payload.Clone() : null; username_ = other.username_; oauthScope_ = other.oauthScope_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -982,7 +1034,7 @@ namespace Grpc.Testing { if (!object.Equals(Payload, other.Payload)) return false; if (Username != other.Username) return false; if (OauthScope != other.OauthScope) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -991,6 +1043,9 @@ namespace Grpc.Testing { if (payload_ != null) hash ^= Payload.GetHashCode(); if (Username.Length != 0) hash ^= Username.GetHashCode(); if (OauthScope.Length != 0) hash ^= OauthScope.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1013,6 +1068,9 @@ namespace Grpc.Testing { output.WriteRawTag(26); output.WriteString(OauthScope); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1027,6 +1085,9 @@ namespace Grpc.Testing { if (OauthScope.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(OauthScope); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1047,6 +1108,7 @@ namespace Grpc.Testing { if (other.OauthScope.Length != 0) { OauthScope = other.OauthScope; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1055,7 +1117,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { if (payload_ == null) { @@ -1083,6 +1145,7 @@ namespace Grpc.Testing { /// public sealed partial class StreamingInputCallRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingInputCallRequest()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1107,6 +1170,7 @@ namespace Grpc.Testing { public StreamingInputCallRequest(StreamingInputCallRequest other) : this() { Payload = other.payload_ != null ? other.Payload.Clone() : null; ExpectCompressed = other.expectCompressed_ != null ? other.ExpectCompressed.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1160,7 +1224,7 @@ namespace Grpc.Testing { } if (!object.Equals(Payload, other.Payload)) return false; if (!object.Equals(ExpectCompressed, other.ExpectCompressed)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1168,6 +1232,9 @@ namespace Grpc.Testing { int hash = 1; if (payload_ != null) hash ^= Payload.GetHashCode(); if (expectCompressed_ != null) hash ^= ExpectCompressed.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1186,6 +1253,9 @@ namespace Grpc.Testing { output.WriteRawTag(18); output.WriteMessage(ExpectCompressed); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1197,6 +1267,9 @@ namespace Grpc.Testing { if (expectCompressed_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExpectCompressed); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1217,6 +1290,7 @@ namespace Grpc.Testing { } ExpectCompressed.MergeFrom(other.ExpectCompressed); } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1225,7 +1299,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { if (payload_ == null) { @@ -1252,6 +1326,7 @@ namespace Grpc.Testing { /// public sealed partial class StreamingInputCallResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingInputCallResponse()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1275,6 +1350,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingInputCallResponse(StreamingInputCallResponse other) : this() { aggregatedPayloadSize_ = other.aggregatedPayloadSize_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1310,13 +1386,16 @@ namespace Grpc.Testing { return true; } if (AggregatedPayloadSize != other.AggregatedPayloadSize) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (AggregatedPayloadSize != 0) hash ^= AggregatedPayloadSize.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1331,6 +1410,9 @@ namespace Grpc.Testing { output.WriteRawTag(8); output.WriteInt32(AggregatedPayloadSize); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1339,6 +1421,9 @@ namespace Grpc.Testing { if (AggregatedPayloadSize != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregatedPayloadSize); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1350,6 +1435,7 @@ namespace Grpc.Testing { if (other.AggregatedPayloadSize != 0) { AggregatedPayloadSize = other.AggregatedPayloadSize; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1358,7 +1444,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { AggregatedPayloadSize = input.ReadInt32(); @@ -1375,6 +1461,7 @@ namespace Grpc.Testing { /// public sealed partial class ResponseParameters : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResponseParameters()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1400,6 +1487,7 @@ namespace Grpc.Testing { size_ = other.size_; intervalUs_ = other.intervalUs_; Compressed = other.compressed_ != null ? other.Compressed.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1469,7 +1557,7 @@ namespace Grpc.Testing { if (Size != other.Size) return false; if (IntervalUs != other.IntervalUs) return false; if (!object.Equals(Compressed, other.Compressed)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1478,6 +1566,9 @@ namespace Grpc.Testing { if (Size != 0) hash ^= Size.GetHashCode(); if (IntervalUs != 0) hash ^= IntervalUs.GetHashCode(); if (compressed_ != null) hash ^= Compressed.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1500,6 +1591,9 @@ namespace Grpc.Testing { output.WriteRawTag(26); output.WriteMessage(Compressed); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1514,6 +1608,9 @@ namespace Grpc.Testing { if (compressed_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Compressed); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1534,6 +1631,7 @@ namespace Grpc.Testing { } Compressed.MergeFrom(other.Compressed); } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1542,7 +1640,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Size = input.ReadInt32(); @@ -1570,6 +1668,7 @@ namespace Grpc.Testing { /// public sealed partial class StreamingOutputCallRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingOutputCallRequest()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1596,6 +1695,7 @@ namespace Grpc.Testing { responseParameters_ = other.responseParameters_.Clone(); Payload = other.payload_ != null ? other.Payload.Clone() : null; ResponseStatus = other.responseStatus_ != null ? other.ResponseStatus.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1679,7 +1779,7 @@ namespace Grpc.Testing { if(!responseParameters_.Equals(other.responseParameters_)) return false; if (!object.Equals(Payload, other.Payload)) return false; if (!object.Equals(ResponseStatus, other.ResponseStatus)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1689,6 +1789,9 @@ namespace Grpc.Testing { hash ^= responseParameters_.GetHashCode(); if (payload_ != null) hash ^= Payload.GetHashCode(); if (responseStatus_ != null) hash ^= ResponseStatus.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1712,6 +1815,9 @@ namespace Grpc.Testing { output.WriteRawTag(58); output.WriteMessage(ResponseStatus); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1727,6 +1833,9 @@ namespace Grpc.Testing { if (responseStatus_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(ResponseStatus); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1751,6 +1860,7 @@ namespace Grpc.Testing { } ResponseStatus.MergeFrom(other.ResponseStatus); } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1759,7 +1869,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { responseType_ = (global::Grpc.Testing.PayloadType) input.ReadEnum(); @@ -1794,6 +1904,7 @@ namespace Grpc.Testing { /// public sealed partial class StreamingOutputCallResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingOutputCallResponse()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1817,6 +1928,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingOutputCallResponse(StreamingOutputCallResponse other) : this() { Payload = other.payload_ != null ? other.Payload.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1852,13 +1964,16 @@ namespace Grpc.Testing { return true; } if (!object.Equals(Payload, other.Payload)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (payload_ != null) hash ^= Payload.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1873,6 +1988,9 @@ namespace Grpc.Testing { output.WriteRawTag(10); output.WriteMessage(Payload); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1881,6 +1999,9 @@ namespace Grpc.Testing { if (payload_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1895,6 +2016,7 @@ namespace Grpc.Testing { } Payload.MergeFrom(other.Payload); } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1903,7 +2025,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { if (payload_ == null) { @@ -1924,6 +2046,7 @@ namespace Grpc.Testing { /// public sealed partial class ReconnectParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReconnectParams()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1947,6 +2070,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ReconnectParams(ReconnectParams other) : this() { maxReconnectBackoffMs_ = other.maxReconnectBackoffMs_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1979,13 +2103,16 @@ namespace Grpc.Testing { return true; } if (MaxReconnectBackoffMs != other.MaxReconnectBackoffMs) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (MaxReconnectBackoffMs != 0) hash ^= MaxReconnectBackoffMs.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -2000,6 +2127,9 @@ namespace Grpc.Testing { output.WriteRawTag(8); output.WriteInt32(MaxReconnectBackoffMs); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2008,6 +2138,9 @@ namespace Grpc.Testing { if (MaxReconnectBackoffMs != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxReconnectBackoffMs); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -2019,6 +2152,7 @@ namespace Grpc.Testing { if (other.MaxReconnectBackoffMs != 0) { MaxReconnectBackoffMs = other.MaxReconnectBackoffMs; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2027,7 +2161,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { MaxReconnectBackoffMs = input.ReadInt32(); @@ -2046,6 +2180,7 @@ namespace Grpc.Testing { /// public sealed partial class ReconnectInfo : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReconnectInfo()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -2070,6 +2205,7 @@ namespace Grpc.Testing { public ReconnectInfo(ReconnectInfo other) : this() { passed_ = other.passed_; backoffMs_ = other.backoffMs_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2113,7 +2249,7 @@ namespace Grpc.Testing { } if (Passed != other.Passed) return false; if(!backoffMs_.Equals(other.backoffMs_)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2121,6 +2257,9 @@ namespace Grpc.Testing { int hash = 1; if (Passed != false) hash ^= Passed.GetHashCode(); hash ^= backoffMs_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -2136,6 +2275,9 @@ namespace Grpc.Testing { output.WriteBool(Passed); } backoffMs_.WriteTo(output, _repeated_backoffMs_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2145,6 +2287,9 @@ namespace Grpc.Testing { size += 1 + 1; } size += backoffMs_.CalculateSize(_repeated_backoffMs_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -2157,6 +2302,7 @@ namespace Grpc.Testing { Passed = other.Passed; } backoffMs_.Add(other.backoffMs_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2165,7 +2311,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Passed = input.ReadBool(); diff --git a/src/csharp/Grpc.IntegrationTesting/Metrics.cs b/src/csharp/Grpc.IntegrationTesting/Metrics.cs index 84eb09af4fb..b5d8b87a680 100644 --- a/src/csharp/Grpc.IntegrationTesting/Metrics.cs +++ b/src/csharp/Grpc.IntegrationTesting/Metrics.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/proto/grpc/testing/metrics.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/metrics.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -48,6 +50,7 @@ namespace Grpc.Testing { /// public sealed partial class GaugeResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GaugeResponse()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -83,6 +86,7 @@ namespace Grpc.Testing { break; } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -169,10 +173,10 @@ namespace Grpc.Testing { } if (Name != other.Name) return false; if (LongValue != other.LongValue) return false; - if (DoubleValue != other.DoubleValue) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleValue, other.DoubleValue)) return false; if (StringValue != other.StringValue) return false; if (ValueCase != other.ValueCase) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -180,9 +184,12 @@ namespace Grpc.Testing { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); if (valueCase_ == ValueOneofCase.LongValue) hash ^= LongValue.GetHashCode(); - if (valueCase_ == ValueOneofCase.DoubleValue) hash ^= DoubleValue.GetHashCode(); + if (valueCase_ == ValueOneofCase.DoubleValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleValue); if (valueCase_ == ValueOneofCase.StringValue) hash ^= StringValue.GetHashCode(); hash ^= (int) valueCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -209,6 +216,9 @@ namespace Grpc.Testing { output.WriteRawTag(34); output.WriteString(StringValue); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -226,6 +236,9 @@ namespace Grpc.Testing { if (valueCase_ == ValueOneofCase.StringValue) { size += 1 + pb::CodedOutputStream.ComputeStringSize(StringValue); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -249,6 +262,7 @@ namespace Grpc.Testing { break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -257,7 +271,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Name = input.ReadString(); @@ -286,6 +300,7 @@ namespace Grpc.Testing { /// public sealed partial class GaugeRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GaugeRequest()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -309,6 +324,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public GaugeRequest(GaugeRequest other) : this() { name_ = other.name_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -341,13 +357,16 @@ namespace Grpc.Testing { return true; } if (Name != other.Name) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -362,6 +381,9 @@ namespace Grpc.Testing { output.WriteRawTag(10); output.WriteString(Name); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -370,6 +392,9 @@ namespace Grpc.Testing { if (Name.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -381,6 +406,7 @@ namespace Grpc.Testing { if (other.Name.Length != 0) { Name = other.Name; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -389,7 +415,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Name = input.ReadString(); @@ -403,6 +429,7 @@ namespace Grpc.Testing { public sealed partial class EmptyMessage : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EmptyMessage()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -425,6 +452,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public EmptyMessage(EmptyMessage other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -445,12 +473,15 @@ namespace Grpc.Testing { if (ReferenceEquals(other, this)) { return true; } - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -461,11 +492,17 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -474,6 +511,7 @@ namespace Grpc.Testing { if (other == null) { return; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -482,7 +520,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; } } diff --git a/src/csharp/Grpc.IntegrationTesting/Payloads.cs b/src/csharp/Grpc.IntegrationTesting/Payloads.cs index fca8cda6f6c..25f34ff05ed 100644 --- a/src/csharp/Grpc.IntegrationTesting/Payloads.cs +++ b/src/csharp/Grpc.IntegrationTesting/Payloads.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/proto/grpc/testing/payloads.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/payloads.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -46,6 +48,7 @@ namespace Grpc.Testing { #region Messages public sealed partial class ByteBufferParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ByteBufferParams()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -70,6 +73,7 @@ namespace Grpc.Testing { public ByteBufferParams(ByteBufferParams other) : this() { reqSize_ = other.reqSize_; respSize_ = other.respSize_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -114,7 +118,7 @@ namespace Grpc.Testing { } if (ReqSize != other.ReqSize) return false; if (RespSize != other.RespSize) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -122,6 +126,9 @@ namespace Grpc.Testing { int hash = 1; if (ReqSize != 0) hash ^= ReqSize.GetHashCode(); if (RespSize != 0) hash ^= RespSize.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -140,6 +147,9 @@ namespace Grpc.Testing { output.WriteRawTag(16); output.WriteInt32(RespSize); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -151,6 +161,9 @@ namespace Grpc.Testing { if (RespSize != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(RespSize); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -165,6 +178,7 @@ namespace Grpc.Testing { if (other.RespSize != 0) { RespSize = other.RespSize; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -173,7 +187,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { ReqSize = input.ReadInt32(); @@ -191,6 +205,7 @@ namespace Grpc.Testing { public sealed partial class SimpleProtoParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SimpleProtoParams()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -215,6 +230,7 @@ namespace Grpc.Testing { public SimpleProtoParams(SimpleProtoParams other) : this() { reqSize_ = other.reqSize_; respSize_ = other.respSize_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -259,7 +275,7 @@ namespace Grpc.Testing { } if (ReqSize != other.ReqSize) return false; if (RespSize != other.RespSize) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -267,6 +283,9 @@ namespace Grpc.Testing { int hash = 1; if (ReqSize != 0) hash ^= ReqSize.GetHashCode(); if (RespSize != 0) hash ^= RespSize.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -285,6 +304,9 @@ namespace Grpc.Testing { output.WriteRawTag(16); output.WriteInt32(RespSize); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -296,6 +318,9 @@ namespace Grpc.Testing { if (RespSize != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(RespSize); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -310,6 +335,7 @@ namespace Grpc.Testing { if (other.RespSize != 0) { RespSize = other.RespSize; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -318,7 +344,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { ReqSize = input.ReadInt32(); @@ -340,6 +366,7 @@ namespace Grpc.Testing { /// public sealed partial class ComplexProtoParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexProtoParams()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -362,6 +389,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ComplexProtoParams(ComplexProtoParams other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -382,12 +410,15 @@ namespace Grpc.Testing { if (ReferenceEquals(other, this)) { return true; } - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -398,11 +429,17 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -411,6 +448,7 @@ namespace Grpc.Testing { if (other == null) { return; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -419,7 +457,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; } } @@ -429,6 +467,7 @@ namespace Grpc.Testing { public sealed partial class PayloadConfig : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PayloadConfig()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -463,6 +502,7 @@ namespace Grpc.Testing { break; } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -540,7 +580,7 @@ namespace Grpc.Testing { if (!object.Equals(SimpleParams, other.SimpleParams)) return false; if (!object.Equals(ComplexParams, other.ComplexParams)) return false; if (PayloadCase != other.PayloadCase) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -550,6 +590,9 @@ namespace Grpc.Testing { if (payloadCase_ == PayloadOneofCase.SimpleParams) hash ^= SimpleParams.GetHashCode(); if (payloadCase_ == PayloadOneofCase.ComplexParams) hash ^= ComplexParams.GetHashCode(); hash ^= (int) payloadCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -572,6 +615,9 @@ namespace Grpc.Testing { output.WriteRawTag(26); output.WriteMessage(ComplexParams); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -586,6 +632,9 @@ namespace Grpc.Testing { if (payloadCase_ == PayloadOneofCase.ComplexParams) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(ComplexParams); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -615,6 +664,7 @@ namespace Grpc.Testing { break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -623,7 +673,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { global::Grpc.Testing.ByteBufferParams subBuilder = new global::Grpc.Testing.ByteBufferParams(); diff --git a/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioService.cs b/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioService.cs index b82cb52e300..707c443497b 100644 --- a/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioService.cs +++ b/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioService.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/proto/grpc/testing/report_qps_scenario_service.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/report_qps_scenario_service.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code diff --git a/src/csharp/Grpc.IntegrationTesting/Stats.cs b/src/csharp/Grpc.IntegrationTesting/Stats.cs index e082ae7719a..8160646215a 100644 --- a/src/csharp/Grpc.IntegrationTesting/Stats.cs +++ b/src/csharp/Grpc.IntegrationTesting/Stats.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/proto/grpc/testing/stats.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/stats.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -55,6 +57,7 @@ namespace Grpc.Testing { #region Messages public sealed partial class ServerStats : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerStats()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -84,6 +87,7 @@ namespace Grpc.Testing { idleCpuTime_ = other.idleCpuTime_; cqPollCount_ = other.cqPollCount_; CoreStats = other.coreStats_ != null ? other.CoreStats.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -203,26 +207,29 @@ namespace Grpc.Testing { if (ReferenceEquals(other, this)) { return true; } - if (TimeElapsed != other.TimeElapsed) return false; - if (TimeUser != other.TimeUser) return false; - if (TimeSystem != other.TimeSystem) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TimeElapsed, other.TimeElapsed)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TimeUser, other.TimeUser)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TimeSystem, other.TimeSystem)) return false; if (TotalCpuTime != other.TotalCpuTime) return false; if (IdleCpuTime != other.IdleCpuTime) return false; if (CqPollCount != other.CqPollCount) return false; if (!object.Equals(CoreStats, other.CoreStats)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (TimeElapsed != 0D) hash ^= TimeElapsed.GetHashCode(); - if (TimeUser != 0D) hash ^= TimeUser.GetHashCode(); - if (TimeSystem != 0D) hash ^= TimeSystem.GetHashCode(); + if (TimeElapsed != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TimeElapsed); + if (TimeUser != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TimeUser); + if (TimeSystem != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TimeSystem); if (TotalCpuTime != 0UL) hash ^= TotalCpuTime.GetHashCode(); if (IdleCpuTime != 0UL) hash ^= IdleCpuTime.GetHashCode(); if (CqPollCount != 0UL) hash ^= CqPollCount.GetHashCode(); if (coreStats_ != null) hash ^= CoreStats.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -261,6 +268,9 @@ namespace Grpc.Testing { output.WriteRawTag(58); output.WriteMessage(CoreStats); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -287,6 +297,9 @@ namespace Grpc.Testing { if (coreStats_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(CoreStats); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -319,6 +332,7 @@ namespace Grpc.Testing { } CoreStats.MergeFrom(other.CoreStats); } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -327,7 +341,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 9: { TimeElapsed = input.ReadDouble(); @@ -371,6 +385,7 @@ namespace Grpc.Testing { /// public sealed partial class HistogramParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HistogramParams()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -395,6 +410,7 @@ namespace Grpc.Testing { public HistogramParams(HistogramParams other) : this() { resolution_ = other.resolution_; maxPossible_ = other.maxPossible_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -443,16 +459,19 @@ namespace Grpc.Testing { if (ReferenceEquals(other, this)) { return true; } - if (Resolution != other.Resolution) return false; - if (MaxPossible != other.MaxPossible) return false; - return true; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Resolution, other.Resolution)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(MaxPossible, other.MaxPossible)) return false; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Resolution != 0D) hash ^= Resolution.GetHashCode(); - if (MaxPossible != 0D) hash ^= MaxPossible.GetHashCode(); + if (Resolution != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Resolution); + if (MaxPossible != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(MaxPossible); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -471,6 +490,9 @@ namespace Grpc.Testing { output.WriteRawTag(17); output.WriteDouble(MaxPossible); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -482,6 +504,9 @@ namespace Grpc.Testing { if (MaxPossible != 0D) { size += 1 + 8; } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -496,6 +521,7 @@ namespace Grpc.Testing { if (other.MaxPossible != 0D) { MaxPossible = other.MaxPossible; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -504,7 +530,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 9: { Resolution = input.ReadDouble(); @@ -525,6 +551,7 @@ namespace Grpc.Testing { /// public sealed partial class HistogramData : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HistogramData()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -553,6 +580,7 @@ namespace Grpc.Testing { sum_ = other.sum_; sumOfSquares_ = other.sumOfSquares_; count_ = other.count_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -639,23 +667,26 @@ namespace Grpc.Testing { return true; } if(!bucket_.Equals(other.bucket_)) return false; - if (MinSeen != other.MinSeen) return false; - if (MaxSeen != other.MaxSeen) return false; - if (Sum != other.Sum) return false; - if (SumOfSquares != other.SumOfSquares) return false; - if (Count != other.Count) return false; - return true; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(MinSeen, other.MinSeen)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(MaxSeen, other.MaxSeen)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Sum, other.Sum)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(SumOfSquares, other.SumOfSquares)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Count, other.Count)) return false; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; hash ^= bucket_.GetHashCode(); - if (MinSeen != 0D) hash ^= MinSeen.GetHashCode(); - if (MaxSeen != 0D) hash ^= MaxSeen.GetHashCode(); - if (Sum != 0D) hash ^= Sum.GetHashCode(); - if (SumOfSquares != 0D) hash ^= SumOfSquares.GetHashCode(); - if (Count != 0D) hash ^= Count.GetHashCode(); + if (MinSeen != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(MinSeen); + if (MaxSeen != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(MaxSeen); + if (Sum != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Sum); + if (SumOfSquares != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(SumOfSquares); + if (Count != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Count); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -687,6 +718,9 @@ namespace Grpc.Testing { output.WriteRawTag(49); output.WriteDouble(Count); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -708,6 +742,9 @@ namespace Grpc.Testing { if (Count != 0D) { size += 1 + 8; } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -732,6 +769,7 @@ namespace Grpc.Testing { if (other.Count != 0D) { Count = other.Count; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -740,7 +778,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: case 8: { @@ -775,6 +813,7 @@ namespace Grpc.Testing { public sealed partial class RequestResultCount : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RequestResultCount()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -799,6 +838,7 @@ namespace Grpc.Testing { public RequestResultCount(RequestResultCount other) : this() { statusCode_ = other.statusCode_; count_ = other.count_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -843,7 +883,7 @@ namespace Grpc.Testing { } if (StatusCode != other.StatusCode) return false; if (Count != other.Count) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -851,6 +891,9 @@ namespace Grpc.Testing { int hash = 1; if (StatusCode != 0) hash ^= StatusCode.GetHashCode(); if (Count != 0L) hash ^= Count.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -869,6 +912,9 @@ namespace Grpc.Testing { output.WriteRawTag(16); output.WriteInt64(Count); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -880,6 +926,9 @@ namespace Grpc.Testing { if (Count != 0L) { size += 1 + pb::CodedOutputStream.ComputeInt64Size(Count); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -894,6 +943,7 @@ namespace Grpc.Testing { if (other.Count != 0L) { Count = other.Count; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -902,7 +952,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { StatusCode = input.ReadInt32(); @@ -920,6 +970,7 @@ namespace Grpc.Testing { public sealed partial class ClientStats : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientStats()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -949,6 +1000,7 @@ namespace Grpc.Testing { requestResults_ = other.requestResults_.Clone(); cqPollCount_ = other.cqPollCount_; CoreStats = other.coreStats_ != null ? other.CoreStats.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1061,25 +1113,28 @@ namespace Grpc.Testing { return true; } if (!object.Equals(Latencies, other.Latencies)) return false; - if (TimeElapsed != other.TimeElapsed) return false; - if (TimeUser != other.TimeUser) return false; - if (TimeSystem != other.TimeSystem) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TimeElapsed, other.TimeElapsed)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TimeUser, other.TimeUser)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TimeSystem, other.TimeSystem)) return false; if(!requestResults_.Equals(other.requestResults_)) return false; if (CqPollCount != other.CqPollCount) return false; if (!object.Equals(CoreStats, other.CoreStats)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (latencies_ != null) hash ^= Latencies.GetHashCode(); - if (TimeElapsed != 0D) hash ^= TimeElapsed.GetHashCode(); - if (TimeUser != 0D) hash ^= TimeUser.GetHashCode(); - if (TimeSystem != 0D) hash ^= TimeSystem.GetHashCode(); + if (TimeElapsed != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TimeElapsed); + if (TimeUser != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TimeUser); + if (TimeSystem != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TimeSystem); hash ^= requestResults_.GetHashCode(); if (CqPollCount != 0UL) hash ^= CqPollCount.GetHashCode(); if (coreStats_ != null) hash ^= CoreStats.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1115,6 +1170,9 @@ namespace Grpc.Testing { output.WriteRawTag(58); output.WriteMessage(CoreStats); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1139,6 +1197,9 @@ namespace Grpc.Testing { if (coreStats_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(CoreStats); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1172,6 +1233,7 @@ namespace Grpc.Testing { } CoreStats.MergeFrom(other.CoreStats); } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1180,7 +1242,7 @@ namespace Grpc.Testing { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { if (latencies_ == null) { diff --git a/src/csharp/Grpc.IntegrationTesting/Test.cs b/src/csharp/Grpc.IntegrationTesting/Test.cs index d2fa9f8013a..03f92c7657b 100644 --- a/src/csharp/Grpc.IntegrationTesting/Test.cs +++ b/src/csharp/Grpc.IntegrationTesting/Test.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/proto/grpc/testing/test.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/test.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code diff --git a/src/csharp/Grpc.IntegrationTesting/WorkerService.cs b/src/csharp/Grpc.IntegrationTesting/WorkerService.cs index 7c829545aa7..6de3193d82a 100644 --- a/src/csharp/Grpc.IntegrationTesting/WorkerService.cs +++ b/src/csharp/Grpc.IntegrationTesting/WorkerService.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/proto/grpc/testing/worker_service.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/proto/grpc/testing/worker_service.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code diff --git a/src/csharp/Grpc.Reflection/Reflection.cs b/src/csharp/Grpc.Reflection/Reflection.cs index 60090e53649..84b2a0a8421 100644 --- a/src/csharp/Grpc.Reflection/Reflection.cs +++ b/src/csharp/Grpc.Reflection/Reflection.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: grpc/reflection/v1alpha/reflection.proto +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grpc/reflection/v1alpha/reflection.proto +// #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -74,6 +76,7 @@ namespace Grpc.Reflection.V1Alpha { /// public sealed partial class ServerReflectionRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerReflectionRequest()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -115,6 +118,7 @@ namespace Grpc.Reflection.V1Alpha { break; } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -256,7 +260,7 @@ namespace Grpc.Reflection.V1Alpha { if (AllExtensionNumbersOfType != other.AllExtensionNumbersOfType) return false; if (ListServices != other.ListServices) return false; if (MessageRequestCase != other.MessageRequestCase) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -269,6 +273,9 @@ namespace Grpc.Reflection.V1Alpha { if (messageRequestCase_ == MessageRequestOneofCase.AllExtensionNumbersOfType) hash ^= AllExtensionNumbersOfType.GetHashCode(); if (messageRequestCase_ == MessageRequestOneofCase.ListServices) hash ^= ListServices.GetHashCode(); hash ^= (int) messageRequestCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -303,6 +310,9 @@ namespace Grpc.Reflection.V1Alpha { output.WriteRawTag(58); output.WriteString(ListServices); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -326,6 +336,9 @@ namespace Grpc.Reflection.V1Alpha { if (messageRequestCase_ == MessageRequestOneofCase.ListServices) { size += 1 + pb::CodedOutputStream.ComputeStringSize(ListServices); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -358,6 +371,7 @@ namespace Grpc.Reflection.V1Alpha { break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -366,7 +380,7 @@ namespace Grpc.Reflection.V1Alpha { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Host = input.ReadString(); @@ -409,6 +423,7 @@ namespace Grpc.Reflection.V1Alpha { /// public sealed partial class ExtensionRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExtensionRequest()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -433,6 +448,7 @@ namespace Grpc.Reflection.V1Alpha { public ExtensionRequest(ExtensionRequest other) : this() { containingType_ = other.containingType_; extensionNumber_ = other.extensionNumber_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -480,7 +496,7 @@ namespace Grpc.Reflection.V1Alpha { } if (ContainingType != other.ContainingType) return false; if (ExtensionNumber != other.ExtensionNumber) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -488,6 +504,9 @@ namespace Grpc.Reflection.V1Alpha { int hash = 1; if (ContainingType.Length != 0) hash ^= ContainingType.GetHashCode(); if (ExtensionNumber != 0) hash ^= ExtensionNumber.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -506,6 +525,9 @@ namespace Grpc.Reflection.V1Alpha { output.WriteRawTag(16); output.WriteInt32(ExtensionNumber); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -517,6 +539,9 @@ namespace Grpc.Reflection.V1Alpha { if (ExtensionNumber != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(ExtensionNumber); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -531,6 +556,7 @@ namespace Grpc.Reflection.V1Alpha { if (other.ExtensionNumber != 0) { ExtensionNumber = other.ExtensionNumber; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -539,7 +565,7 @@ namespace Grpc.Reflection.V1Alpha { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { ContainingType = input.ReadString(); @@ -560,6 +586,7 @@ namespace Grpc.Reflection.V1Alpha { /// public sealed partial class ServerReflectionResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerReflectionResponse()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -599,6 +626,7 @@ namespace Grpc.Reflection.V1Alpha { break; } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -730,7 +758,7 @@ namespace Grpc.Reflection.V1Alpha { if (!object.Equals(ListServicesResponse, other.ListServicesResponse)) return false; if (!object.Equals(ErrorResponse, other.ErrorResponse)) return false; if (MessageResponseCase != other.MessageResponseCase) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -743,6 +771,9 @@ namespace Grpc.Reflection.V1Alpha { if (messageResponseCase_ == MessageResponseOneofCase.ListServicesResponse) hash ^= ListServicesResponse.GetHashCode(); if (messageResponseCase_ == MessageResponseOneofCase.ErrorResponse) hash ^= ErrorResponse.GetHashCode(); hash ^= (int) messageResponseCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -777,6 +808,9 @@ namespace Grpc.Reflection.V1Alpha { output.WriteRawTag(58); output.WriteMessage(ErrorResponse); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -800,6 +834,9 @@ namespace Grpc.Reflection.V1Alpha { if (messageResponseCase_ == MessageResponseOneofCase.ErrorResponse) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(ErrorResponse); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -844,6 +881,7 @@ namespace Grpc.Reflection.V1Alpha { break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -852,7 +890,7 @@ namespace Grpc.Reflection.V1Alpha { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { ValidHost = input.ReadString(); @@ -914,6 +952,7 @@ namespace Grpc.Reflection.V1Alpha { /// public sealed partial class FileDescriptorResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorResponse()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -937,6 +976,7 @@ namespace Grpc.Reflection.V1Alpha { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public FileDescriptorResponse(FileDescriptorResponse other) : this() { fileDescriptorProto_ = other.fileDescriptorProto_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -973,13 +1013,16 @@ namespace Grpc.Reflection.V1Alpha { return true; } if(!fileDescriptorProto_.Equals(other.fileDescriptorProto_)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; hash ^= fileDescriptorProto_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -991,12 +1034,18 @@ namespace Grpc.Reflection.V1Alpha { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { fileDescriptorProto_.WriteTo(output, _repeated_fileDescriptorProto_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; size += fileDescriptorProto_.CalculateSize(_repeated_fileDescriptorProto_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1006,6 +1055,7 @@ namespace Grpc.Reflection.V1Alpha { return; } fileDescriptorProto_.Add(other.fileDescriptorProto_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1014,7 +1064,7 @@ namespace Grpc.Reflection.V1Alpha { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { fileDescriptorProto_.AddEntriesFrom(input, _repeated_fileDescriptorProto_codec); @@ -1032,6 +1082,7 @@ namespace Grpc.Reflection.V1Alpha { /// public sealed partial class ExtensionNumberResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExtensionNumberResponse()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1056,6 +1107,7 @@ namespace Grpc.Reflection.V1Alpha { public ExtensionNumberResponse(ExtensionNumberResponse other) : this() { baseTypeName_ = other.baseTypeName_; extensionNumber_ = other.extensionNumber_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1103,7 +1155,7 @@ namespace Grpc.Reflection.V1Alpha { } if (BaseTypeName != other.BaseTypeName) return false; if(!extensionNumber_.Equals(other.extensionNumber_)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1111,6 +1163,9 @@ namespace Grpc.Reflection.V1Alpha { int hash = 1; if (BaseTypeName.Length != 0) hash ^= BaseTypeName.GetHashCode(); hash ^= extensionNumber_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1126,6 +1181,9 @@ namespace Grpc.Reflection.V1Alpha { output.WriteString(BaseTypeName); } extensionNumber_.WriteTo(output, _repeated_extensionNumber_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1135,6 +1193,9 @@ namespace Grpc.Reflection.V1Alpha { size += 1 + pb::CodedOutputStream.ComputeStringSize(BaseTypeName); } size += extensionNumber_.CalculateSize(_repeated_extensionNumber_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1147,6 +1208,7 @@ namespace Grpc.Reflection.V1Alpha { BaseTypeName = other.BaseTypeName; } extensionNumber_.Add(other.extensionNumber_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1155,7 +1217,7 @@ namespace Grpc.Reflection.V1Alpha { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { BaseTypeName = input.ReadString(); @@ -1177,6 +1239,7 @@ namespace Grpc.Reflection.V1Alpha { /// public sealed partial class ListServiceResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ListServiceResponse()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1200,6 +1263,7 @@ namespace Grpc.Reflection.V1Alpha { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ListServiceResponse(ListServiceResponse other) : this() { service_ = other.service_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1235,13 +1299,16 @@ namespace Grpc.Reflection.V1Alpha { return true; } if(!service_.Equals(other.service_)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; hash ^= service_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1253,12 +1320,18 @@ namespace Grpc.Reflection.V1Alpha { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { service_.WriteTo(output, _repeated_service_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; size += service_.CalculateSize(_repeated_service_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1268,6 +1341,7 @@ namespace Grpc.Reflection.V1Alpha { return; } service_.Add(other.service_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1276,7 +1350,7 @@ namespace Grpc.Reflection.V1Alpha { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { service_.AddEntriesFrom(input, _repeated_service_codec); @@ -1294,6 +1368,7 @@ namespace Grpc.Reflection.V1Alpha { /// public sealed partial class ServiceResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServiceResponse()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1317,6 +1392,7 @@ namespace Grpc.Reflection.V1Alpha { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ServiceResponse(ServiceResponse other) : this() { name_ = other.name_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1353,13 +1429,16 @@ namespace Grpc.Reflection.V1Alpha { return true; } if (Name != other.Name) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1374,6 +1453,9 @@ namespace Grpc.Reflection.V1Alpha { output.WriteRawTag(10); output.WriteString(Name); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1382,6 +1464,9 @@ namespace Grpc.Reflection.V1Alpha { if (Name.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1393,6 +1478,7 @@ namespace Grpc.Reflection.V1Alpha { if (other.Name.Length != 0) { Name = other.Name; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1401,7 +1487,7 @@ namespace Grpc.Reflection.V1Alpha { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Name = input.ReadString(); @@ -1418,6 +1504,7 @@ namespace Grpc.Reflection.V1Alpha { /// public sealed partial class ErrorResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ErrorResponse()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } @@ -1442,6 +1529,7 @@ namespace Grpc.Reflection.V1Alpha { public ErrorResponse(ErrorResponse other) : this() { errorCode_ = other.errorCode_; errorMessage_ = other.errorMessage_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1489,7 +1577,7 @@ namespace Grpc.Reflection.V1Alpha { } if (ErrorCode != other.ErrorCode) return false; if (ErrorMessage != other.ErrorMessage) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1497,6 +1585,9 @@ namespace Grpc.Reflection.V1Alpha { int hash = 1; if (ErrorCode != 0) hash ^= ErrorCode.GetHashCode(); if (ErrorMessage.Length != 0) hash ^= ErrorMessage.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -1515,6 +1606,9 @@ namespace Grpc.Reflection.V1Alpha { output.WriteRawTag(18); output.WriteString(ErrorMessage); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1526,6 +1620,9 @@ namespace Grpc.Reflection.V1Alpha { if (ErrorMessage.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(ErrorMessage); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -1540,6 +1637,7 @@ namespace Grpc.Reflection.V1Alpha { if (other.ErrorMessage.Length != 0) { ErrorMessage = other.ErrorMessage; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1548,7 +1646,7 @@ namespace Grpc.Reflection.V1Alpha { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { ErrorCode = input.ReadInt32(); From d8306ec14251bd4459a059ea1cca24754da3f905 Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Wed, 2 May 2018 12:05:49 -0700 Subject: [PATCH 141/165] update ruby --- src/ruby/pb/grpc/health/v1/health_services_pb.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ruby/pb/grpc/health/v1/health_services_pb.rb b/src/ruby/pb/grpc/health/v1/health_services_pb.rb index 520f8e7ec5b..c905f17136c 100644 --- a/src/ruby/pb/grpc/health/v1/health_services_pb.rb +++ b/src/ruby/pb/grpc/health/v1/health_services_pb.rb @@ -1,7 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # Source: grpc/health/v1/health.proto for package 'grpc.health.v1' # Original file comments: -# Copyright 2015 gRPC authors. +# Copyright 2015, gRPC Authors +# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,6 +16,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# The canonical version of this proto can be found at +# https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto +# require 'grpc' require 'grpc/health/v1/health_pb' From 86d65ce29032840349b165d63fbee213fb2612d8 Mon Sep 17 00:00:00 2001 From: Ben Sykes Date: Wed, 2 May 2018 13:23:33 -0700 Subject: [PATCH 142/165] cleanup formatting with clang_format_code.sh --- src/compiler/node_generator.cc | 9 ++++++--- src/compiler/node_generator.h | 3 ++- src/compiler/node_plugin.cc | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/compiler/node_generator.cc b/src/compiler/node_generator.cc index 36ee60a198f..a430628dbc6 100644 --- a/src/compiler/node_generator.cc +++ b/src/compiler/node_generator.cc @@ -120,7 +120,8 @@ grpc::string NodeObjectPath(const Descriptor* descriptor) { } // Prints out the message serializer and deserializer functions -void PrintMessageTransformer(const Descriptor* descriptor, Printer* out, const Parameters& params) { +void PrintMessageTransformer(const Descriptor* descriptor, Printer* out, + const Parameters& params) { map template_vars; grpc::string full_name = descriptor->full_name(); template_vars["identifier_name"] = MessageIdentifierName(full_name); @@ -225,7 +226,8 @@ void PrintImports(const FileDescriptor* file, Printer* out) { out->Print("\n"); } -void PrintTransformers(const FileDescriptor* file, Printer* out, const Parameters& params) { +void PrintTransformers(const FileDescriptor* file, Printer* out, + const Parameters& params) { map messages = GetAllMessages(file); for (std::map::iterator it = messages.begin(); @@ -242,7 +244,8 @@ void PrintServices(const FileDescriptor* file, Printer* out) { } } // namespace -grpc::string GenerateFile(const FileDescriptor* file, const Parameters& params) { +grpc::string GenerateFile(const FileDescriptor* file, + const Parameters& params) { grpc::string output; { StringOutputStream output_stream(&output); diff --git a/src/compiler/node_generator.h b/src/compiler/node_generator.h index 6906f2f450d..f3a531597a1 100644 --- a/src/compiler/node_generator.h +++ b/src/compiler/node_generator.h @@ -29,7 +29,8 @@ struct Parameters { int minimum_node_version; }; -grpc::string GenerateFile(const grpc::protobuf::FileDescriptor* file, const Parameters& params); +grpc::string GenerateFile(const grpc::protobuf::FileDescriptor* file, + const Parameters& params); } // namespace grpc_node_generator diff --git a/src/compiler/node_plugin.cc b/src/compiler/node_plugin.cc index a224ac89d08..0d19d8e9820 100644 --- a/src/compiler/node_plugin.cc +++ b/src/compiler/node_plugin.cc @@ -36,7 +36,6 @@ class NodeGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { const grpc::string& parameter, grpc::protobuf::compiler::GeneratorContext* context, grpc::string* error) const { - grpc_node_generator::Parameters generator_parameters; generator_parameters.minimum_node_version = 4; @@ -48,7 +47,8 @@ class NodeGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { std::vector param = grpc_generator::tokenize(*parameter_string, "="); if (param[0] == "minimum_node_version") { - sscanf(param[1].c_str(), "%d", &generator_parameters.minimum_node_version); + sscanf(param[1].c_str(), "%d", + &generator_parameters.minimum_node_version); } else { *error = grpc::string("Unknown parameter: ") + *parameter_string; return false; From bccd32dafa1ed60e745c958a55960cf75c56d7d2 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Wed, 2 May 2018 23:35:00 +0000 Subject: [PATCH 143/165] Add grpc.Channel.close --- src/python/grpcio/grpc/__init__.py | 17 +- src/python/grpcio/grpc/_channel.py | 23 +++ src/python/grpcio/grpc/_interceptor.py | 13 ++ .../grpc_testing/_channel/_channel.py | 15 ++ src/python/grpcio_tests/tests/tests.json | 1 + .../tests/unit/_channel_close_test.py | 185 ++++++++++++++++++ 6 files changed, 253 insertions(+), 1 deletion(-) create mode 100644 src/python/grpcio_tests/tests/unit/_channel_close_test.py diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py index 7fa73036914..b7ed0c85635 100644 --- a/src/python/grpcio/grpc/__init__.py +++ b/src/python/grpcio/grpc/__init__.py @@ -813,7 +813,11 @@ class StreamStreamMultiCallable(six.with_metaclass(abc.ABCMeta)): class Channel(six.with_metaclass(abc.ABCMeta)): - """Affords RPC invocation via generic methods on client-side.""" + """Affords RPC invocation via generic methods on client-side. + + Channel objects implement the Context Manager type, although they need not + support being entered and exited multiple times. + """ @abc.abstractmethod def subscribe(self, callback, try_to_connect=False): @@ -926,6 +930,17 @@ class Channel(six.with_metaclass(abc.ABCMeta)): """ raise NotImplementedError() + @abc.abstractmethod + def close(self): + """Closes this Channel and releases all resources held by it. + + Closing the Channel will immediately terminate all RPCs active with the + Channel and it is not valid to invoke new RPCs with the Channel. + + This method is idempotent. + """ + raise NotImplementedError() + ########################## Service-Side Context ############################## diff --git a/src/python/grpcio/grpc/_channel.py b/src/python/grpcio/grpc/_channel.py index 6604f8f35c0..3a4585a5115 100644 --- a/src/python/grpcio/grpc/_channel.py +++ b/src/python/grpcio/grpc/_channel.py @@ -909,5 +909,28 @@ class Channel(grpc.Channel): self._channel, _channel_managed_call_management(self._call_state), _common.encode(method), request_serializer, response_deserializer) + def _close(self): + self._channel.close(cygrpc.StatusCode.cancelled, 'Channel closed!') + _moot(self._connectivity_state) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self._close() + return False + + def close(self): + self._close() + def __del__(self): + # TODO(https://github.com/grpc/grpc/issues/12531): Several releases + # after 1.12 (1.16 or thereabouts?) add a "self._channel.close" call + # here (or more likely, call self._close() here). We don't do this today + # because many valid use cases today allow the channel to be deleted + # immediately after stubs are created. After a sufficient period of time + # has passed for all users to be trusted to hang out to their channels + # for as long as they are in use and to close them after using them, + # then deletion of this grpc._channel.Channel instance can be made to + # effect closure of the underlying cygrpc.Channel instance. _moot(self._connectivity_state) diff --git a/src/python/grpcio/grpc/_interceptor.py b/src/python/grpcio/grpc/_interceptor.py index d029472c687..f465e35a9c3 100644 --- a/src/python/grpcio/grpc/_interceptor.py +++ b/src/python/grpcio/grpc/_interceptor.py @@ -334,6 +334,19 @@ class _Channel(grpc.Channel): else: return thunk(method) + def _close(self): + self._channel.close() + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self._close() + return False + + def close(self): + self._channel.close() + def intercept_channel(channel, *interceptors): for interceptor in reversed(list(interceptors)): diff --git a/src/python/grpcio_testing/grpc_testing/_channel/_channel.py b/src/python/grpcio_testing/grpc_testing/_channel/_channel.py index b015b8d7388..0c1941e6bea 100644 --- a/src/python/grpcio_testing/grpc_testing/_channel/_channel.py +++ b/src/python/grpcio_testing/grpc_testing/_channel/_channel.py @@ -56,6 +56,21 @@ class TestingChannel(grpc_testing.Channel): response_deserializer=None): return _multi_callable.StreamStream(method, self._state) + def _close(self): + # TODO(https://github.com/grpc/grpc/issues/12531): Decide what + # action to take here, if any? + pass + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self._close() + return False + + def close(self): + self._close() + def take_unary_unary(self, method_descriptor): return _channel_rpc.unary_unary(self._state, method_descriptor) diff --git a/src/python/grpcio_tests/tests/tests.json b/src/python/grpcio_tests/tests/tests.json index d38ee517f09..2fae27a220c 100644 --- a/src/python/grpcio_tests/tests/tests.json +++ b/src/python/grpcio_tests/tests/tests.json @@ -25,6 +25,7 @@ "unit._auth_test.AccessTokenAuthMetadataPluginTest", "unit._auth_test.GoogleCallCredentialsTest", "unit._channel_args_test.ChannelArgsTest", + "unit._channel_close_test.ChannelCloseTest", "unit._channel_connectivity_test.ChannelConnectivityTest", "unit._channel_ready_future_test.ChannelReadyFutureTest", "unit._compression_test.CompressionTest", diff --git a/src/python/grpcio_tests/tests/unit/_channel_close_test.py b/src/python/grpcio_tests/tests/unit/_channel_close_test.py new file mode 100644 index 00000000000..af3a9ee1ee1 --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/_channel_close_test.py @@ -0,0 +1,185 @@ +# Copyright 2018 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. +"""Tests server and client side compression.""" + +import threading +import time +import unittest + +import grpc + +from tests.unit import test_common +from tests.unit.framework.common import test_constants + +_BEAT = 0.5 +_SOME_TIME = 5 +_MORE_TIME = 10 + + +class _MethodHandler(grpc.RpcMethodHandler): + + request_streaming = True + response_streaming = True + request_deserializer = None + response_serializer = None + + def stream_stream(self, request_iterator, servicer_context): + for request in request_iterator: + yield request * 2 + + +_METHOD_HANDLER = _MethodHandler() + + +class _GenericHandler(grpc.GenericRpcHandler): + + def service(self, handler_call_details): + return _METHOD_HANDLER + + +_GENERIC_HANDLER = _GenericHandler() + + +class _Pipe(object): + + def __init__(self, values): + self._condition = threading.Condition() + self._values = list(values) + self._open = True + + def __iter__(self): + return self + + def _next(self): + with self._condition: + while not self._values and self._open: + self._condition.wait() + if self._values: + return self._values.pop(0) + else: + raise StopIteration() + + def next(self): + return self._next() + + def __next__(self): + return self._next() + + def add(self, value): + with self._condition: + self._values.append(value) + self._condition.notify() + + def close(self): + with self._condition: + self._open = False + self._condition.notify() + + def __enter__(self): + return self + + def __exit__(self, type, value, traceback): + self.close() + + +class ChannelCloseTest(unittest.TestCase): + + def setUp(self): + self._server = test_common.test_server( + max_workers=test_constants.THREAD_CONCURRENCY) + self._server.add_generic_rpc_handlers((_GENERIC_HANDLER,)) + self._port = self._server.add_insecure_port('[::]:0') + self._server.start() + + def tearDown(self): + self._server.stop(None) + + def test_close_immediately_after_call_invocation(self): + channel = grpc.insecure_channel('localhost:{}'.format(self._port)) + multi_callable = channel.stream_stream('Meffod') + request_iterator = _Pipe(()) + response_iterator = multi_callable(request_iterator) + channel.close() + request_iterator.close() + + self.assertIs(response_iterator.code(), grpc.StatusCode.CANCELLED) + + def test_close_while_call_active(self): + channel = grpc.insecure_channel('localhost:{}'.format(self._port)) + multi_callable = channel.stream_stream('Meffod') + request_iterator = _Pipe((b'abc',)) + response_iterator = multi_callable(request_iterator) + next(response_iterator) + channel.close() + request_iterator.close() + + self.assertIs(response_iterator.code(), grpc.StatusCode.CANCELLED) + + def test_context_manager_close_while_call_active(self): + with grpc.insecure_channel('localhost:{}'.format( + self._port)) as channel: # pylint: disable=bad-continuation + multi_callable = channel.stream_stream('Meffod') + request_iterator = _Pipe((b'abc',)) + response_iterator = multi_callable(request_iterator) + next(response_iterator) + request_iterator.close() + + self.assertIs(response_iterator.code(), grpc.StatusCode.CANCELLED) + + def test_context_manager_close_while_many_calls_active(self): + with grpc.insecure_channel('localhost:{}'.format( + self._port)) as channel: # pylint: disable=bad-continuation + multi_callable = channel.stream_stream('Meffod') + request_iterators = tuple( + _Pipe((b'abc',)) + for _ in range(test_constants.THREAD_CONCURRENCY)) + response_iterators = [] + for request_iterator in request_iterators: + response_iterator = multi_callable(request_iterator) + next(response_iterator) + response_iterators.append(response_iterator) + for request_iterator in request_iterators: + request_iterator.close() + + for response_iterator in response_iterators: + self.assertIs(response_iterator.code(), grpc.StatusCode.CANCELLED) + + def test_many_concurrent_closes(self): + channel = grpc.insecure_channel('localhost:{}'.format(self._port)) + multi_callable = channel.stream_stream('Meffod') + request_iterator = _Pipe((b'abc',)) + response_iterator = multi_callable(request_iterator) + next(response_iterator) + start = time.time() + end = start + _MORE_TIME + + def sleep_some_time_then_close(): + time.sleep(_SOME_TIME) + channel.close() + + for _ in range(test_constants.THREAD_CONCURRENCY): + close_thread = threading.Thread(target=sleep_some_time_then_close) + close_thread.start() + while True: + request_iterator.add(b'def') + time.sleep(_BEAT) + if end < time.time(): + break + request_iterator.close() + + self.assertIs(response_iterator.code(), grpc.StatusCode.CANCELLED) + + +if __name__ == '__main__': + unittest.main(verbosity=2) From e51aa63752f813813e7f202896b0da2ad5286c08 Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Wed, 2 May 2018 17:23:03 -0700 Subject: [PATCH 144/165] Make copyright check slightly more flexible --- tools/distrib/check_copyright.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/distrib/check_copyright.py b/tools/distrib/check_copyright.py index 66acc733e50..c2d6ce47562 100755 --- a/tools/distrib/check_copyright.py +++ b/tools/distrib/check_copyright.py @@ -98,7 +98,7 @@ _EXEMPT = frozenset(( 'src/android/test/interop/gradlew.bat', )) -RE_YEAR = r'Copyright (?P[0-9]+\-)?(?P[0-9]+) gRPC authors.' +RE_YEAR = r'Copyright (?P[0-9]+\-)?(?P[0-9]+) gRPC (a|A)uthors(\.|)' RE_LICENSE = dict( (k, r'\n'.join(LICENSE_PREFIX[k] + (RE_YEAR if re.search(RE_YEAR, line) else re.escape(line)) From e216754277e74bdc86d53d0eb656d29779b9a8f6 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 2 May 2018 22:48:50 -0700 Subject: [PATCH 145/165] Update g_stands_for --- doc/g_stands_for.md | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/doc/g_stands_for.md b/doc/g_stands_for.md index ee8a8276448..8b9cf91d3ec 100644 --- a/doc/g_stands_for.md +++ b/doc/g_stands_for.md @@ -1,18 +1,15 @@ -Each version of gRPC gets a new description of what the 'g' stands for, since -we've never really been able to figure it out. +'g' stands for something different every gRPC release: -Below is a list of already-used definitions (that should not be repeated in the -future), and the corresponding version numbers that used them: - -- 1.0 'g' stands for 'gRPC' -- 1.1 'g' stands for 'good' -- 1.2 'g' stands for 'green' -- 1.3 'g' stands for 'gentle' -- 1.4 'g' stands for 'gregarious' -- 1.6 'g' stands for 'garcia' -- 1.7 'g' stands for 'gambit' -- 1.8 'g' stands for 'generous' -- 1.9 'g' stands for 'glossy' -- 1.10 'g' stands for 'glamorous' -- 1.11 'g' stands for 'gorgeous' -- 1.12 'g' stands for 'glorious' +- 1.0 'g' stands for ['gRPC'](https://github.com/grpc/grpc/tree/v1.0.x) +- 1.1 'g' stands for ['good'](https://github.com/grpc/grpc/tree/v1.1.x) +- 1.2 'g' stands for ['green'](https://github.com/grpc/grpc/tree/v1.2.x) +- 1.3 'g' stands for ['gentle'](https://github.com/grpc/grpc/tree/v1.3.x) +- 1.4 'g' stands for ['gregarious'](https://github.com/grpc/grpc/tree/v1.4.x) +- 1.6 'g' stands for ['garcia'](https://github.com/grpc/grpc/tree/v1.6.x) +- 1.7 'g' stands for ['gambit'](https://github.com/grpc/grpc/tree/v1.7.x) +- 1.8 'g' stands for ['generous'](https://github.com/grpc/grpc/tree/v1.8.x) +- 1.9 'g' stands for ['glossy'](https://github.com/grpc/grpc/tree/v1.9.x) +- 1.10 'g' stands for ['glamorous'](https://github.com/grpc/grpc/tree/v1.10.x) +- 1.11 'g' stands for ['gorgeous'](https://github.com/grpc/grpc/tree/v1.11.x) +- 1.12 'g' stands for ['glorious'](https://github.com/grpc/grpc/tree/v1.12.x) +- 1.13 'g' stands for ['gloriosa'](https://github.com/grpc/grpc/tree/master) From 7af3e81c9a2df32d1d451dcdd09a1f49cf4b84a4 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 2 May 2018 22:49:04 -0700 Subject: [PATCH 146/165] Bump master to v1.13.0-dev --- BUILD | 4 ++-- build.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BUILD b/BUILD index 241f7c220d5..df5344821cb 100644 --- a/BUILD +++ b/BUILD @@ -64,11 +64,11 @@ config_setting( ) # This should be updated along with build.yaml -g_stands_for = "glorious" +g_stands_for = "gloriosa" core_version = "6.0.0-dev" -version = "1.12.0-dev" +version = "1.13.0-dev" GPR_PUBLIC_HDRS = [ "include/grpc/support/alloc.h", diff --git a/build.yaml b/build.yaml index c63ca5de5ba..d8df33a3eb9 100644 --- a/build.yaml +++ b/build.yaml @@ -13,8 +13,8 @@ settings: '#09': Per-language overrides are possible with (eg) ruby_version tag here '#10': See the expand_version.py for all the quirks here core_version: 6.0.0-dev - g_stands_for: glorious - version: 1.12.0-dev + g_stands_for: gloriosa + version: 1.13.0-dev filegroups: - name: alts_proto headers: From 2d43a45ad1540f554d89503676d2db2bc25776db Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 2 May 2018 22:49:52 -0700 Subject: [PATCH 147/165] Regenerate projects --- CMakeLists.txt | 2 +- Makefile | 4 ++-- gRPC-C++.podspec | 4 ++-- gRPC-Core.podspec | 2 +- gRPC-ProtoRPC.podspec | 2 +- gRPC-RxLibrary.podspec | 2 +- gRPC.podspec | 2 +- package.xml | 4 ++-- src/core/lib/surface/version.cc | 2 +- src/cpp/common/version_cc.cc | 2 +- src/csharp/Grpc.Core/Version.csproj.include | 2 +- src/csharp/Grpc.Core/VersionInfo.cs | 4 ++-- src/csharp/build_packages_dotnetcli.bat | 2 +- src/csharp/build_packages_dotnetcli.sh | 4 ++-- src/objective-c/!ProtoCompiler-gRPCPlugin.podspec | 2 +- src/objective-c/GRPCClient/private/version.h | 2 +- src/objective-c/tests/version.h | 2 +- src/php/composer.json | 2 +- src/php/ext/grpc/version.h | 2 +- src/python/grpcio/grpc/_grpcio_metadata.py | 2 +- src/python/grpcio/grpc_version.py | 2 +- src/python/grpcio_health_checking/grpc_version.py | 2 +- src/python/grpcio_reflection/grpc_version.py | 2 +- src/python/grpcio_testing/grpc_version.py | 2 +- src/python/grpcio_tests/grpc_version.py | 2 +- src/ruby/lib/grpc/version.rb | 2 +- src/ruby/tools/version.rb | 2 +- tools/distrib/python/grpcio_tools/grpc_version.py | 2 +- tools/doxygen/Doxyfile.c++ | 2 +- tools/doxygen/Doxyfile.c++.internal | 2 +- 30 files changed, 35 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e64d2efbc4..8db941239ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 2.8) set(PACKAGE_NAME "grpc") -set(PACKAGE_VERSION "1.12.0-dev") +set(PACKAGE_VERSION "1.13.0-dev") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") diff --git a/Makefile b/Makefile index 76fa95b4191..0b2024996d5 100644 --- a/Makefile +++ b/Makefile @@ -421,8 +421,8 @@ Q = @ endif CORE_VERSION = 6.0.0-dev -CPP_VERSION = 1.12.0-dev -CSHARP_VERSION = 1.12.0-dev +CPP_VERSION = 1.13.0-dev +CSHARP_VERSION = 1.13.0-dev CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 990b0a4f9d1..f673dd69dc7 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-C++' # TODO (mxyan): use version that match gRPC version when pod is stabilized - # version = '1.12.0-dev' + # version = '1.13.0-dev' version = '0.0.2' s.version = version s.summary = 'gRPC C++ library' @@ -31,7 +31,7 @@ Pod::Spec.new do |s| s.license = 'Apache License, Version 2.0' s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' } - grpc_version = '1.12.0-dev' + grpc_version = '1.13.0-dev' s.source = { :git => 'https://github.com/grpc/grpc.git', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index a1e0fd2ca1a..49ad7ef6d6a 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -22,7 +22,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.12.0-dev' + version = '1.13.0-dev' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'https://grpc.io' diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index e98dee4a3c8..17e650c2642 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.12.0-dev' + version = '1.13.0-dev' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'https://grpc.io' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index 3bba14b695e..b9288afd806 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.12.0-dev' + version = '1.13.0-dev' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'https://grpc.io' diff --git a/gRPC.podspec b/gRPC.podspec index bf73ffd22e6..afc4581091d 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.12.0-dev' + version = '1.13.0-dev' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'https://grpc.io' diff --git a/package.xml b/package.xml index b9cb22b647c..7dcfa302ae2 100644 --- a/package.xml +++ b/package.xml @@ -13,8 +13,8 @@ 2018-01-19 - 1.12.0dev - 1.12.0dev + 1.13.0dev + 1.13.0dev beta diff --git a/src/core/lib/surface/version.cc b/src/core/lib/surface/version.cc index a712e10037d..306b7c395ea 100644 --- a/src/core/lib/surface/version.cc +++ b/src/core/lib/surface/version.cc @@ -25,4 +25,4 @@ const char* grpc_version_string(void) { return "6.0.0-dev"; } -const char* grpc_g_stands_for(void) { return "glorious"; } +const char* grpc_g_stands_for(void) { return "gloriosa"; } diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc index d669ea21a9e..54cd2076ec0 100644 --- a/src/cpp/common/version_cc.cc +++ b/src/cpp/common/version_cc.cc @@ -22,5 +22,5 @@ #include namespace grpc { -grpc::string Version() { return "1.12.0-dev"; } +grpc::string Version() { return "1.13.0-dev"; } } // namespace grpc diff --git a/src/csharp/Grpc.Core/Version.csproj.include b/src/csharp/Grpc.Core/Version.csproj.include index 6e28c11df27..f5d63b77f05 100755 --- a/src/csharp/Grpc.Core/Version.csproj.include +++ b/src/csharp/Grpc.Core/Version.csproj.include @@ -1,7 +1,7 @@ - 1.12.0-dev + 1.13.0-dev 3.5.1 diff --git a/src/csharp/Grpc.Core/VersionInfo.cs b/src/csharp/Grpc.Core/VersionInfo.cs index 06a0396c348..87edddae3fc 100644 --- a/src/csharp/Grpc.Core/VersionInfo.cs +++ b/src/csharp/Grpc.Core/VersionInfo.cs @@ -33,11 +33,11 @@ namespace Grpc.Core /// /// Current AssemblyFileVersion of gRPC C# assemblies /// - public const string CurrentAssemblyFileVersion = "1.12.0.0"; + public const string CurrentAssemblyFileVersion = "1.13.0.0"; /// /// Current version of gRPC C# /// - public const string CurrentVersion = "1.12.0-dev"; + public const string CurrentVersion = "1.13.0-dev"; } } diff --git a/src/csharp/build_packages_dotnetcli.bat b/src/csharp/build_packages_dotnetcli.bat index 0d657486976..924d7b16974 100755 --- a/src/csharp/build_packages_dotnetcli.bat +++ b/src/csharp/build_packages_dotnetcli.bat @@ -13,7 +13,7 @@ @rem limitations under the License. @rem Current package versions -set VERSION=1.12.0-dev +set VERSION=1.13.0-dev @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe diff --git a/src/csharp/build_packages_dotnetcli.sh b/src/csharp/build_packages_dotnetcli.sh index 66aba360891..5c73a8f95fd 100755 --- a/src/csharp/build_packages_dotnetcli.sh +++ b/src/csharp/build_packages_dotnetcli.sh @@ -45,7 +45,7 @@ dotnet pack --configuration Release Grpc.Auth --output ../../../artifacts dotnet pack --configuration Release Grpc.HealthCheck --output ../../../artifacts dotnet pack --configuration Release Grpc.Reflection --output ../../../artifacts -nuget pack Grpc.nuspec -Version "1.12.0-dev" -OutputDirectory ../../artifacts -nuget pack Grpc.Tools.nuspec -Version "1.12.0-dev" -OutputDirectory ../../artifacts +nuget pack Grpc.nuspec -Version "1.13.0-dev" -OutputDirectory ../../artifacts +nuget pack Grpc.Tools.nuspec -Version "1.13.0-dev" -OutputDirectory ../../artifacts (cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg) diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index f06312bea95..515dc917d1a 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.12.0-dev' + v = '1.13.0-dev' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index 1298e7e1913..6fe4a7d051e 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -22,4 +22,4 @@ // instead. This file can be regenerated from the template by running // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.12.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.13.0-dev" diff --git a/src/objective-c/tests/version.h b/src/objective-c/tests/version.h index d36545fced6..e9637099d9f 100644 --- a/src/objective-c/tests/version.h +++ b/src/objective-c/tests/version.h @@ -22,5 +22,5 @@ // instead. This file can be regenerated from the template by running // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.12.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.13.0-dev" #define GRPC_C_VERSION_STRING @"6.0.0-dev" diff --git a/src/php/composer.json b/src/php/composer.json index 57d911db790..03dffb40ab8 100644 --- a/src/php/composer.json +++ b/src/php/composer.json @@ -2,7 +2,7 @@ "name": "grpc/grpc-dev", "description": "gRPC library for PHP - for Developement use only", "license": "Apache-2.0", - "version": "1.12.0", + "version": "1.13.0", "require": { "php": ">=5.5.0", "google/protobuf": "^v3.3.0" diff --git a/src/php/ext/grpc/version.h b/src/php/ext/grpc/version.h index 37df2768bfe..407d6347e6b 100644 --- a/src/php/ext/grpc/version.h +++ b/src/php/ext/grpc/version.h @@ -20,6 +20,6 @@ #ifndef VERSION_H #define VERSION_H -#define PHP_GRPC_VERSION "1.12.0dev" +#define PHP_GRPC_VERSION "1.13.0dev" #endif /* VERSION_H */ diff --git a/src/python/grpcio/grpc/_grpcio_metadata.py b/src/python/grpcio/grpc/_grpcio_metadata.py index cb5da72f1fe..ad53f60ad36 100644 --- a/src/python/grpcio/grpc/_grpcio_metadata.py +++ b/src/python/grpcio/grpc/_grpcio_metadata.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!! -__version__ = """1.12.0.dev0""" +__version__ = """1.13.0.dev0""" diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index de5a780abdc..57dc26dbeb7 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION = '1.12.0.dev0' +VERSION = '1.13.0.dev0' diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py index afcd316e5cb..ba0d4a3b6de 100644 --- a/src/python/grpcio_health_checking/grpc_version.py +++ b/src/python/grpcio_health_checking/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! -VERSION = '1.12.0.dev0' +VERSION = '1.13.0.dev0' diff --git a/src/python/grpcio_reflection/grpc_version.py b/src/python/grpcio_reflection/grpc_version.py index 824b73201d2..ea2878d9ee4 100644 --- a/src/python/grpcio_reflection/grpc_version.py +++ b/src/python/grpcio_reflection/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! -VERSION = '1.12.0.dev0' +VERSION = '1.13.0.dev0' diff --git a/src/python/grpcio_testing/grpc_version.py b/src/python/grpcio_testing/grpc_version.py index 5b1f4c4cc0f..02f19f22830 100644 --- a/src/python/grpcio_testing/grpc_version.py +++ b/src/python/grpcio_testing/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!! -VERSION = '1.12.0.dev0' +VERSION = '1.13.0.dev0' diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py index 382f95018ef..9d2e41644e1 100644 --- a/src/python/grpcio_tests/grpc_version.py +++ b/src/python/grpcio_tests/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!! -VERSION = '1.12.0.dev0' +VERSION = '1.13.0.dev0' diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index 2cb7c4be53a..15f375100a2 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -14,5 +14,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '1.12.0.dev' + VERSION = '1.13.0.dev' end diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb index 822f70eb0ac..09d5c826747 100644 --- a/src/ruby/tools/version.rb +++ b/src/ruby/tools/version.rb @@ -14,6 +14,6 @@ module GRPC module Tools - VERSION = '1.12.0.dev' + VERSION = '1.13.0.dev' end end diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py index e71f836f6d4..f0367e2af42 100644 --- a/tools/distrib/python/grpcio_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION = '1.12.0.dev0' +VERSION = '1.13.0.dev0' diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 22f225ec549..884eabb956b 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.12.0-dev +PROJECT_NUMBER = 1.13.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 63d238d741d..66796bae57d 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.12.0-dev +PROJECT_NUMBER = 1.13.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a From 219354fb5a581f2c79c63dae527134aff7226a31 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 2 May 2018 23:39:53 -0700 Subject: [PATCH 148/165] Revert "Provide protocol for initializer of generated messages" --- src/compiler/objective_c_generator.cc | 2 +- src/objective-c/ProtoRPC/ProtoService.h | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc index 7d4d4d1f5a4..39f68cb9565 100644 --- a/src/compiler/objective_c_generator.cc +++ b/src/compiler/objective_c_generator.cc @@ -248,7 +248,7 @@ void PrintMethodImplementations(Printer* printer, " */\n"); printer.Print(vars, "@interface $service_class$ :" - " GRPCProtoService<$service_class$, GRPCProtoServiceInit>\n"); + " GRPCProtoService<$service_class$>\n"); printer.Print( "- (instancetype)initWithHost:(NSString *)host" " NS_DESIGNATED_INITIALIZER;\n"); diff --git a/src/objective-c/ProtoRPC/ProtoService.h b/src/objective-c/ProtoRPC/ProtoService.h index c411bed60f0..29c4e9be360 100644 --- a/src/objective-c/ProtoRPC/ProtoService.h +++ b/src/objective-c/ProtoRPC/ProtoService.h @@ -22,12 +22,6 @@ @protocol GRXWriteable; @class GRXWriter; -@protocol GRPCProtoServiceInit - -- (instancetype)initWithHost:(NSString *)host; - -@end - __attribute__((deprecated("Please use GRPCProtoService."))) @interface ProtoService : NSObject - (instancetype)initWithHost : (NSString *)host packageName From e6d6a1b97806828db2534c6427c8f5814dd0e048 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Thu, 3 May 2018 10:05:48 -0700 Subject: [PATCH 149/165] Revert "Revert "Provide protocol for initializer of generated messages"" --- src/compiler/objective_c_generator.cc | 2 +- src/objective-c/ProtoRPC/ProtoService.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc index 39f68cb9565..7d4d4d1f5a4 100644 --- a/src/compiler/objective_c_generator.cc +++ b/src/compiler/objective_c_generator.cc @@ -248,7 +248,7 @@ void PrintMethodImplementations(Printer* printer, " */\n"); printer.Print(vars, "@interface $service_class$ :" - " GRPCProtoService<$service_class$>\n"); + " GRPCProtoService<$service_class$, GRPCProtoServiceInit>\n"); printer.Print( "- (instancetype)initWithHost:(NSString *)host" " NS_DESIGNATED_INITIALIZER;\n"); diff --git a/src/objective-c/ProtoRPC/ProtoService.h b/src/objective-c/ProtoRPC/ProtoService.h index 29c4e9be360..c411bed60f0 100644 --- a/src/objective-c/ProtoRPC/ProtoService.h +++ b/src/objective-c/ProtoRPC/ProtoService.h @@ -22,6 +22,12 @@ @protocol GRXWriteable; @class GRXWriter; +@protocol GRPCProtoServiceInit + +- (instancetype)initWithHost:(NSString *)host; + +@end + __attribute__((deprecated("Please use GRPCProtoService."))) @interface ProtoService : NSObject - (instancetype)initWithHost : (NSString *)host packageName From dcb05c16c67e1473880482fff0581f11edd3da1b Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Thu, 3 May 2018 10:16:34 -0700 Subject: [PATCH 150/165] Fix generater --- src/compiler/objective_c_generator.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc index 7d4d4d1f5a4..2294615a280 100644 --- a/src/compiler/objective_c_generator.cc +++ b/src/compiler/objective_c_generator.cc @@ -222,7 +222,7 @@ void PrintMethodImplementations(Printer* printer, map< ::grpc::string, ::grpc::string> vars = { {"service_class", ServiceClassName(service)}}; - printer.Print(vars, "@protocol $service_class$ \n\n"); + printer.Print(vars, "@protocol $service_class$ \n\n"); for (int i = 0; i < service->method_count(); i++) { PrintMethodDeclarations(&printer, service->method(i)); } @@ -248,7 +248,7 @@ void PrintMethodImplementations(Printer* printer, " */\n"); printer.Print(vars, "@interface $service_class$ :" - " GRPCProtoService<$service_class$, GRPCProtoServiceInit>\n"); + " GRPCProtoService<$service_class$>\n"); printer.Print( "- (instancetype)initWithHost:(NSString *)host" " NS_DESIGNATED_INITIALIZER;\n"); From ee7c77666efd723309a3052d2b0858e0163a0f39 Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Thu, 3 May 2018 10:25:24 -0700 Subject: [PATCH 151/165] add The support --- tools/distrib/check_copyright.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/distrib/check_copyright.py b/tools/distrib/check_copyright.py index c2d6ce47562..09eecf471b7 100755 --- a/tools/distrib/check_copyright.py +++ b/tools/distrib/check_copyright.py @@ -98,7 +98,7 @@ _EXEMPT = frozenset(( 'src/android/test/interop/gradlew.bat', )) -RE_YEAR = r'Copyright (?P[0-9]+\-)?(?P[0-9]+) gRPC (a|A)uthors(\.|)' +RE_YEAR = r'Copyright (?P[0-9]+\-)?(?P[0-9]+) ([Tt]he )?gRPC [Aa]uthors(\.|)' RE_LICENSE = dict( (k, r'\n'.join(LICENSE_PREFIX[k] + (RE_YEAR if re.search(RE_YEAR, line) else re.escape(line)) From 77933b1897af206fc7722c53a07833d947ca45f3 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Thu, 3 May 2018 10:36:11 -0700 Subject: [PATCH 152/165] clang-format --- src/compiler/objective_c_generator.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc index 2294615a280..e97494f64cf 100644 --- a/src/compiler/objective_c_generator.cc +++ b/src/compiler/objective_c_generator.cc @@ -222,7 +222,8 @@ void PrintMethodImplementations(Printer* printer, map< ::grpc::string, ::grpc::string> vars = { {"service_class", ServiceClassName(service)}}; - printer.Print(vars, "@protocol $service_class$ \n\n"); + printer.Print( + vars, "@protocol $service_class$ \n\n"); for (int i = 0; i < service->method_count(); i++) { PrintMethodDeclarations(&printer, service->method(i)); } From 83714b0373b4c61836ce68b24387f41be2610c35 Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Thu, 3 May 2018 12:30:35 -0700 Subject: [PATCH 153/165] match copyright --- src/proto/grpc/health/v1/health.proto | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/proto/grpc/health/v1/health.proto b/src/proto/grpc/health/v1/health.proto index bcc02f8ac83..4b4677b8a4d 100644 --- a/src/proto/grpc/health/v1/health.proto +++ b/src/proto/grpc/health/v1/health.proto @@ -1,5 +1,4 @@ -// Copyright 2015, gRPC Authors -// All rights reserved. +// Copyright 2015 The gRPC Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 95fbb06ca87b6381f4331bda2eb333a0538a6113 Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Thu, 3 May 2018 12:33:25 -0700 Subject: [PATCH 154/165] regenerate pbs --- src/csharp/Grpc.HealthCheck/HealthGrpc.cs | 3 +-- src/ruby/pb/grpc/health/v1/health_services_pb.rb | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs index b22bd8444d6..a26f483981c 100644 --- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs +++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs @@ -3,8 +3,7 @@ // source: grpc/health/v1/health.proto // // Original file comments: -// Copyright 2015, gRPC Authors -// All rights reserved. +// Copyright 2015 The gRPC Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/ruby/pb/grpc/health/v1/health_services_pb.rb b/src/ruby/pb/grpc/health/v1/health_services_pb.rb index c905f17136c..169e160f90f 100644 --- a/src/ruby/pb/grpc/health/v1/health_services_pb.rb +++ b/src/ruby/pb/grpc/health/v1/health_services_pb.rb @@ -1,8 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # Source: grpc/health/v1/health.proto for package 'grpc.health.v1' # Original file comments: -# Copyright 2015, gRPC Authors -# All rights reserved. +# Copyright 2015 The gRPC Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 7392f053217bf202841a416a15c57b1103bd7a42 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Thu, 3 May 2018 16:59:13 -0700 Subject: [PATCH 155/165] Fix bad_ping end2end test flakiness --- test/core/end2end/tests/bad_ping.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/core/end2end/tests/bad_ping.cc b/test/core/end2end/tests/bad_ping.cc index 22481d1be75..98d893f64d9 100644 --- a/test/core/end2end/tests/bad_ping.cc +++ b/test/core/end2end/tests/bad_ping.cc @@ -355,6 +355,11 @@ static void test_pings_without_data(grpc_end2end_test_config config) { grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead)); CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1); + + // Also expect the previously blocked pings to complete with an error + CQ_EXPECT_COMPLETION(cqv, tag(200 + MAX_PING_STRIKES + 1), 0); + CQ_EXPECT_COMPLETION(cqv, tag(200 + MAX_PING_STRIKES + 2), 0); + cq_verify(cqv); grpc_call_unref(s); From 32c3b2d5931a32aaad9476fa21cf22844e4602bc Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Mon, 30 Apr 2018 16:32:55 -0700 Subject: [PATCH 156/165] Remove unnecessary exec ctx flush --- src/core/lib/iomgr/fork_posix.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/lib/iomgr/fork_posix.cc b/src/core/lib/iomgr/fork_posix.cc index f8645ab157e..6c506eb5c98 100644 --- a/src/core/lib/iomgr/fork_posix.cc +++ b/src/core/lib/iomgr/fork_posix.cc @@ -74,7 +74,6 @@ void grpc_postfork_child() { grpc_timer_manager_set_threading(true); grpc_core::ExecCtx exec_ctx; grpc_executor_set_threading(true); - grpc_core::ExecCtx::Get()->Flush(); } } From 392dad7134ebd0239425289a2c555f24109ee12a Mon Sep 17 00:00:00 2001 From: Yihua Zhang Date: Thu, 3 May 2018 20:12:20 -0700 Subject: [PATCH 157/165] incorporate alts to google default creds --- BUILD | 3 + build.yaml | 3 + gRPC-C++.podspec | 1 + gRPC-Core.podspec | 2 + grpc.gemspec | 1 + package.xml | 1 + .../client_channel/lb_policy/grpclb/grpclb.cc | 19 +++- .../client_channel/lb_policy/grpclb/grpclb.h | 36 +++++++ .../lib/security/credentials/credentials.h | 1 + .../google_default_credentials.cc | 98 +++++++++++++++---- .../google_default_credentials.h | 6 ++ test/core/security/credentials_test.cc | 10 +- tools/doxygen/Doxyfile.core.internal | 1 + .../generated/sources_and_headers.json | 6 ++ 14 files changed, 163 insertions(+), 25 deletions(-) create mode 100644 src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h diff --git a/BUILD b/BUILD index df5344821cb..80b40338c34 100644 --- a/BUILD +++ b/BUILD @@ -1183,6 +1183,7 @@ grpc_cc_library( ], hdrs = [ "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h", + "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h", @@ -1211,6 +1212,7 @@ grpc_cc_library( ], hdrs = [ "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h", + "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h", @@ -1386,6 +1388,7 @@ grpc_cc_library( "src/core/lib/surface/init_secure.cc", ], hdrs = [ + "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", "src/core/lib/security/context/security_context.h", "src/core/lib/security/credentials/alts/alts_credentials.h", "src/core/lib/security/credentials/composite/composite_credentials.h", diff --git a/build.yaml b/build.yaml index d8df33a3eb9..af8de14e619 100644 --- a/build.yaml +++ b/build.yaml @@ -628,6 +628,7 @@ filegroups: - name: grpc_lb_policy_grpclb headers: - src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h + - src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h - src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h - src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h - src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h @@ -648,6 +649,7 @@ filegroups: - name: grpc_lb_policy_grpclb_secure headers: - src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h + - src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h - src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h - src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h - src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h @@ -744,6 +746,7 @@ filegroups: public_headers: - include/grpc/grpc_security.h headers: + - src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h - src/core/lib/security/context/security_context.h - src/core/lib/security/credentials/alts/alts_credentials.h - src/core/lib/security/credentials/composite/composite_credentials.h diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index f673dd69dc7..fe082ef3af8 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -260,6 +260,7 @@ Pod::Spec.new do |s| 'src/core/ext/filters/http/client/http_client_filter.h', 'src/core/ext/filters/http/message_compress/message_compress_filter.h', 'src/core/ext/filters/http/server/http_server_filter.h', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h', 'src/core/lib/security/context/security_context.h', 'src/core/lib/security/credentials/alts/alts_credentials.h', 'src/core/lib/security/credentials/composite/composite_credentials.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 49ad7ef6d6a..e893eb9990c 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -270,6 +270,7 @@ Pod::Spec.new do |s| 'src/core/ext/filters/http/client/http_client_filter.h', 'src/core/ext/filters/http/message_compress/message_compress_filter.h', 'src/core/ext/filters/http/server/http_server_filter.h', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h', 'src/core/lib/security/context/security_context.h', 'src/core/lib/security/credentials/alts/alts_credentials.h', 'src/core/lib/security/credentials/composite/composite_credentials.h', @@ -849,6 +850,7 @@ Pod::Spec.new do |s| 'src/core/ext/filters/http/client/http_client_filter.h', 'src/core/ext/filters/http/message_compress/message_compress_filter.h', 'src/core/ext/filters/http/server/http_server_filter.h', + 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h', 'src/core/lib/security/context/security_context.h', 'src/core/lib/security/credentials/alts/alts_credentials.h', 'src/core/lib/security/credentials/composite/composite_credentials.h', diff --git a/grpc.gemspec b/grpc.gemspec index 16810335292..bb40a3ba027 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -201,6 +201,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/http/client/http_client_filter.h ) s.files += %w( src/core/ext/filters/http/message_compress/message_compress_filter.h ) s.files += %w( src/core/ext/filters/http/server/http_server_filter.h ) + s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h ) s.files += %w( src/core/lib/security/context/security_context.h ) s.files += %w( src/core/lib/security/credentials/alts/alts_credentials.h ) s.files += %w( src/core/lib/security/credentials/composite/composite_credentials.h ) diff --git a/package.xml b/package.xml index 7dcfa302ae2..75a69931a49 100644 --- a/package.xml +++ b/package.xml @@ -208,6 +208,7 @@ + diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 1a675476f07..70a91b25677 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -76,6 +76,7 @@ #include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/ext/filters/client_channel/client_channel_factory.h" #include "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h" +#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h" #include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h" #include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h" #include "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h" @@ -1003,6 +1004,9 @@ grpc_channel_args* BuildBalancerChannelArgs( // address updates into the LB channel. grpc_core::FakeResolverResponseGenerator::MakeChannelArg( response_generator), + // A channel arg indicating the target is a grpclb load balancer. + grpc_channel_arg_integer_create( + const_cast(GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER), 1), }; // Construct channel args. grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove( @@ -1698,9 +1702,11 @@ void GrpcLb::CreateRoundRobinPolicyLocked(const Args& args) { grpc_channel_args* GrpcLb::CreateRoundRobinPolicyArgsLocked() { grpc_lb_addresses* addresses; + bool is_backend_from_grpclb_load_balancer = false; if (serverlist_ != nullptr) { GPR_ASSERT(serverlist_->num_servers > 0); addresses = ProcessServerlist(serverlist_); + is_backend_from_grpclb_load_balancer = true; } else { // If CreateOrUpdateRoundRobinPolicyLocked() is invoked when we haven't // received any serverlist from the balancer, we use the fallback backends @@ -1714,9 +1720,18 @@ grpc_channel_args* GrpcLb::CreateRoundRobinPolicyArgsLocked() { // Replace the LB addresses in the channel args that we pass down to // the subchannel. static const char* keys_to_remove[] = {GRPC_ARG_LB_ADDRESSES}; - const grpc_arg arg = grpc_lb_addresses_create_channel_arg(addresses); + const grpc_arg args_to_add[] = { + grpc_lb_addresses_create_channel_arg(addresses), + // A channel arg indicating if the target is a backend inferred from a + // grpclb load balancer. + grpc_channel_arg_integer_create( + const_cast( + GRPC_ARG_ADDRESS_IS_BACKEND_FROM_GRPCLB_LOAD_BALANCER), + is_backend_from_grpclb_load_balancer), + }; grpc_channel_args* args = grpc_channel_args_copy_and_add_and_remove( - args_, keys_to_remove, GPR_ARRAY_SIZE(keys_to_remove), &arg, 1); + args_, keys_to_remove, GPR_ARRAY_SIZE(keys_to_remove), args_to_add, + GPR_ARRAY_SIZE(args_to_add)); grpc_lb_addresses_destroy(addresses); return args; } diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h new file mode 100644 index 00000000000..4d39c4d504b --- /dev/null +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h @@ -0,0 +1,36 @@ +/* + * + * Copyright 2018 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_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H +#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H + +#include + +/** Channel arg indicating if a target corresponding to the address is grpclb + * loadbalancer. The type of this arg is an integer and the value is treated as + * a bool. */ +#define GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER \ + "grpc.address_is_grpclb_load_balancer" +/** Channel arg indicating if a target corresponding to the address is a backend + * received from a balancer. The type of this arg is an integer and the value is + * treated as a bool. */ +#define GRPC_ARG_ADDRESS_IS_BACKEND_FROM_GRPCLB_LOAD_BALANCER \ + "grpc.address_is_backend_from_grpclb_load_balancer" + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H \ + */ diff --git a/src/core/lib/security/credentials/credentials.h b/src/core/lib/security/credentials/credentials.h index b1421e83c5f..b486d25ab2e 100644 --- a/src/core/lib/security/credentials/credentials.h +++ b/src/core/lib/security/credentials/credentials.h @@ -45,6 +45,7 @@ typedef enum { #define GRPC_CHANNEL_CREDENTIALS_TYPE_SSL "Ssl" #define GRPC_CHANNEL_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY \ "FakeTransportSecurity" +#define GRPC_CHANNEL_CREDENTIALS_TYPE_GOOGLE_DEFAULT "GoogleDefault" #define GRPC_CALL_CREDENTIALS_TYPE_OAUTH2 "Oauth2" #define GRPC_CALL_CREDENTIALS_TYPE_JWT "Jwt" diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.cc b/src/core/lib/security/credentials/google_default/google_default_credentials.cc index 70d4c3ea51a..4b267afe3f9 100644 --- a/src/core/lib/security/credentials/google_default/google_default_credentials.cc +++ b/src/core/lib/security/credentials/google_default/google_default_credentials.cc @@ -26,12 +26,15 @@ #include #include +#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h" +#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/gpr/env.h" #include "src/core/lib/gpr/string.h" #include "src/core/lib/http/httpcli.h" #include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/load_file.h" #include "src/core/lib/iomgr/polling_entity.h" +#include "src/core/lib/security/credentials/alts/alts_credentials.h" #include "src/core/lib/security/credentials/google_default/google_default_credentials.h" #include "src/core/lib/security/credentials/jwt/jwt_credentials.h" #include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h" @@ -45,8 +48,8 @@ /* -- Default credentials. -- */ -static grpc_channel_credentials* default_credentials = nullptr; -static int compute_engine_detection_done = 0; +static grpc_channel_credentials* g_default_credentials = nullptr; +static int g_compute_engine_detection_done = 0; static gpr_mu g_state_mu; static gpr_mu* g_polling_mu; static gpr_once g_once = GPR_ONCE_INIT; @@ -60,6 +63,52 @@ typedef struct { grpc_http_response response; } compute_engine_detector; +static void google_default_credentials_destruct( + grpc_channel_credentials* creds) { + grpc_google_default_channel_credentials* c = + reinterpret_cast(creds); + grpc_channel_credentials_unref(c->alts_creds); + grpc_channel_credentials_unref(c->ssl_creds); +} + +static grpc_security_status google_default_create_security_connector( + grpc_channel_credentials* creds, grpc_call_credentials* call_creds, + const char* target, const grpc_channel_args* args, + grpc_channel_security_connector** sc, grpc_channel_args** new_args) { + grpc_google_default_channel_credentials* c = + reinterpret_cast(creds); + bool is_grpclb_load_balancer = grpc_channel_arg_get_bool( + grpc_channel_args_find(args, GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER), + false); + bool is_backend_from_grpclb_load_balancer = grpc_channel_arg_get_bool( + grpc_channel_args_find( + args, GRPC_ARG_ADDRESS_IS_BACKEND_FROM_GRPCLB_LOAD_BALANCER), + false); + bool use_alts = + is_grpclb_load_balancer || is_backend_from_grpclb_load_balancer; + grpc_security_status status = GRPC_SECURITY_ERROR; + status = use_alts ? c->alts_creds->vtable->create_security_connector( + c->alts_creds, call_creds, target, args, sc, new_args) + : c->ssl_creds->vtable->create_security_connector( + c->ssl_creds, call_creds, target, args, sc, new_args); + /* grpclb-specific channel args are removed from the channel args set + * to ensure backends and fallback adresses will have the same set of channel + * args. By doing that, it guarantees the connections to backends will not be + * torn down and re-connected when switching in and out of fallback mode. + */ + static const char* args_to_remove[] = { + GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER, + GRPC_ARG_ADDRESS_IS_BACKEND_FROM_GRPCLB_LOAD_BALANCER, + }; + *new_args = grpc_channel_args_copy_and_add_and_remove( + args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), nullptr, 0); + return status; +} + +static grpc_channel_credentials_vtable google_default_credentials_vtable = { + google_default_credentials_destruct, + google_default_create_security_connector, nullptr}; + static void on_compute_engine_detection_http_response(void* user_data, grpc_error* error) { compute_engine_detector* detector = @@ -234,8 +283,8 @@ grpc_channel_credentials* grpc_google_default_credentials_create(void) { gpr_mu_lock(&g_state_mu); - if (default_credentials != nullptr) { - result = grpc_channel_credentials_ref(default_credentials); + if (g_default_credentials != nullptr) { + result = grpc_channel_credentials_ref(g_default_credentials); goto end; } @@ -253,9 +302,9 @@ grpc_channel_credentials* grpc_google_default_credentials_create(void) { /* At last try to see if we're on compute engine (do the detection only once since it requires a network test). */ - if (!compute_engine_detection_done) { + if (!g_compute_engine_detection_done) { int need_compute_engine_creds = is_stack_running_on_compute_engine(); - compute_engine_detection_done = 1; + g_compute_engine_detection_done = 1; if (need_compute_engine_creds) { call_creds = grpc_google_compute_engine_credentials_create(nullptr); if (call_creds == nullptr) { @@ -269,18 +318,25 @@ grpc_channel_credentials* grpc_google_default_credentials_create(void) { end: if (result == nullptr) { if (call_creds != nullptr) { - /* Blend with default ssl credentials and add a global reference so that - it - can be cached and re-served. */ - grpc_channel_credentials* ssl_creds = - grpc_ssl_credentials_create(nullptr, nullptr, nullptr); - default_credentials = grpc_channel_credentials_ref( - grpc_composite_channel_credentials_create(ssl_creds, call_creds, - nullptr)); - GPR_ASSERT(default_credentials != nullptr); - grpc_channel_credentials_unref(ssl_creds); + /* Create google default credentials. */ + auto creds = static_cast( + gpr_zalloc(sizeof(grpc_google_default_channel_credentials))); + creds->base.vtable = &google_default_credentials_vtable; + creds->base.type = GRPC_CHANNEL_CREDENTIALS_TYPE_GOOGLE_DEFAULT; + gpr_ref_init(&creds->base.refcount, 1); + creds->ssl_creds = grpc_ssl_credentials_create(nullptr, nullptr, nullptr); + GPR_ASSERT(creds->ssl_creds != nullptr); + grpc_alts_credentials_options* options = + grpc_alts_credentials_client_options_create(); + creds->alts_creds = grpc_alts_credentials_create(options); + grpc_alts_credentials_options_destroy(options); + /* Add a global reference so that it can be cached and re-served. */ + g_default_credentials = grpc_composite_channel_credentials_create( + &creds->base, call_creds, nullptr); + GPR_ASSERT(g_default_credentials != nullptr); + grpc_channel_credentials_unref(&creds->base); grpc_call_credentials_unref(call_creds); - result = default_credentials; + result = grpc_channel_credentials_ref(g_default_credentials); } else { gpr_log(GPR_ERROR, "Could not create google default credentials."); } @@ -299,11 +355,11 @@ void grpc_flush_cached_google_default_credentials(void) { grpc_core::ExecCtx exec_ctx; gpr_once_init(&g_once, init_default_credentials); gpr_mu_lock(&g_state_mu); - if (default_credentials != nullptr) { - grpc_channel_credentials_unref(default_credentials); - default_credentials = nullptr; + if (g_default_credentials != nullptr) { + grpc_channel_credentials_unref(g_default_credentials); + g_default_credentials = nullptr; } - compute_engine_detection_done = 0; + g_compute_engine_detection_done = 0; gpr_mu_unlock(&g_state_mu); } diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.h b/src/core/lib/security/credentials/google_default/google_default_credentials.h index b163e486310..9b4063c7750 100644 --- a/src/core/lib/security/credentials/google_default/google_default_credentials.h +++ b/src/core/lib/security/credentials/google_default/google_default_credentials.h @@ -39,6 +39,12 @@ "/" GRPC_GOOGLE_WELL_KNOWN_CREDENTIALS_FILE #endif +typedef struct { + grpc_channel_credentials base; + grpc_channel_credentials* alts_creds; + grpc_channel_credentials* ssl_creds; +} grpc_google_default_channel_credentials; + void grpc_flush_cached_google_default_credentials(void); #endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_GOOGLE_DEFAULT_GOOGLE_DEFAULT_CREDENTIALS_H \ diff --git a/test/core/security/credentials_test.cc b/test/core/security/credentials_test.cc index ce92e21d733..2b90939ab8f 100644 --- a/test/core/security/credentials_test.cc +++ b/test/core/security/credentials_test.cc @@ -867,6 +867,7 @@ static void set_google_default_creds_env_var_with_file_contents( static void test_google_default_creds_auth_key(void) { grpc_core::ExecCtx exec_ctx; grpc_service_account_jwt_access_credentials* jwt; + grpc_google_default_channel_credentials* default_creds; grpc_composite_channel_credentials* creds; char* json_key = test_json_key_str(); grpc_flush_cached_google_default_credentials(); @@ -875,7 +876,9 @@ static void test_google_default_creds_auth_key(void) { gpr_free(json_key); creds = reinterpret_cast( grpc_google_default_credentials_create()); - GPR_ASSERT(creds != nullptr); + default_creds = reinterpret_cast( + creds->inner_creds); + GPR_ASSERT(default_creds->ssl_creds != nullptr); jwt = reinterpret_cast( creds->call_creds); GPR_ASSERT( @@ -889,13 +892,16 @@ static void test_google_default_creds_auth_key(void) { static void test_google_default_creds_refresh_token(void) { grpc_core::ExecCtx exec_ctx; grpc_google_refresh_token_credentials* refresh; + grpc_google_default_channel_credentials* default_creds; grpc_composite_channel_credentials* creds; grpc_flush_cached_google_default_credentials(); set_google_default_creds_env_var_with_file_contents( "refresh_token_google_default_creds", test_refresh_token_str); creds = reinterpret_cast( grpc_google_default_credentials_create()); - GPR_ASSERT(creds != nullptr); + default_creds = reinterpret_cast( + creds->inner_creds); + GPR_ASSERT(default_creds->ssl_creds != nullptr); refresh = reinterpret_cast( creds->call_creds); GPR_ASSERT(strcmp(refresh->refresh_token.client_id, diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index b28641156fa..82b47695440 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -885,6 +885,7 @@ src/core/ext/filters/client_channel/lb_policy.h \ src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc \ +src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 6659724fb4c..abb70053272 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -9794,6 +9794,7 @@ ], "headers": [ "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h", + "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h", @@ -9806,6 +9807,7 @@ "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc", "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc", + "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc", @@ -9829,6 +9831,7 @@ ], "headers": [ "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h", + "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h", @@ -9841,6 +9844,7 @@ "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc", "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc", + "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc", @@ -10026,6 +10030,7 @@ ], "headers": [ "include/grpc/grpc_security.h", + "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", "src/core/lib/security/context/security_context.h", "src/core/lib/security/credentials/alts/alts_credentials.h", "src/core/lib/security/credentials/composite/composite_credentials.h", @@ -10053,6 +10058,7 @@ "name": "grpc_secure", "src": [ "include/grpc/grpc_security.h", + "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", "src/core/lib/http/httpcli_security_connector.cc", "src/core/lib/security/context/security_context.cc", "src/core/lib/security/context/security_context.h", From 11c1739a104d5270e514fc8addb93fb1fe3c35ea Mon Sep 17 00:00:00 2001 From: Alexander Polcyn Date: Thu, 3 May 2018 23:00:30 -0700 Subject: [PATCH 158/165] Provide a way to run C++ interop server with custom ServerBuilderOptions --- test/cpp/interop/interop_server.cc | 22 +++++++++++++++++++++- test/cpp/interop/server_helper.h | 24 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index 6526e0535bd..de875d8e783 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -318,12 +318,27 @@ class TestServiceImpl : public TestService::Service { void grpc::testing::interop::RunServer( std::shared_ptr creds) { - RunServer(creds, FLAGS_port, nullptr); + RunServer(creds, FLAGS_port, nullptr, nullptr); +} + +void grpc::testing::interop::RunServer( + std::shared_ptr creds, + std::unique_ptr>> + server_options) { + RunServer(creds, FLAGS_port, nullptr, std::move(server_options)); } void grpc::testing::interop::RunServer( std::shared_ptr creds, const int port, ServerStartedCondition* server_started_condition) { + RunServer(creds, FLAGS_port, server_started_condition, nullptr); +} + +void grpc::testing::interop::RunServer( + std::shared_ptr creds, const int port, + ServerStartedCondition* server_started_condition, + std::unique_ptr>> + server_options) { GPR_ASSERT(port != 0); std::ostringstream server_address; server_address << "0.0.0.0:" << port; @@ -335,6 +350,11 @@ void grpc::testing::interop::RunServer( ServerBuilder builder; builder.RegisterService(&service); builder.AddListeningPort(server_address.str(), creds); + if (server_options != nullptr) { + for (size_t i = 0; i < server_options->size(); i++) { + builder.SetOption(std::move((*server_options)[i])); + } + } if (FLAGS_max_send_message_size >= 0) { builder.SetMaxSendMessageSize(FLAGS_max_send_message_size); } diff --git a/test/cpp/interop/server_helper.h b/test/cpp/interop/server_helper.h index 3004e7ff817..265874df707 100644 --- a/test/cpp/interop/server_helper.h +++ b/test/cpp/interop/server_helper.h @@ -26,6 +26,8 @@ #include #include +#include +#include #include namespace grpc { @@ -72,6 +74,28 @@ void RunServer(std::shared_ptr creds); void RunServer(std::shared_ptr creds, int port, ServerStartedCondition* server_started_condition); +/// Run gRPC interop server. +/// +/// \param creds The credentials associated with the server. +/// \param server_options List of options to set when building the server. +void RunServer( + std::shared_ptr creds, + std::unique_ptr>> + server_options); + +/// Run gRPC interop server. +/// +/// \param creds The credentials associated with the server. +/// \param port Port to use for the server. +/// \param server_options List of options to set when building the server. +/// \param server_started_condition (optional) Struct holding mutex, condition +// variable, and condition used to notify when the server has started. +void RunServer( + std::shared_ptr creds, const int port, + ServerStartedCondition* server_started_condition, + std::unique_ptr>> + server_options); + } // namespace interop } // namespace testing } // namespace grpc From fcd04ec121664de621ceb874c44eab5fbdc6bbd7 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Fri, 4 May 2018 12:00:25 -0700 Subject: [PATCH 159/165] Remove the fallback when creating Python virtual env See https://github.com/grpc/grpc/issues/15253 for more context. The original behavior when running Python tests is to try to create a virtual env with the specifed Python version. If there is an issue with that, fallback to the system's default Python version. This leads to misleading test results, so removing the fallback and failing the test when virtual env fails to instantiate the specified Python version is the new behavior. --- .../test/python_jessie_x64/Dockerfile.template | 4 ++++ .../dockerfile/test/python_jessie_x64/Dockerfile | 4 ++++ tools/run_tests/helper_scripts/build_python.sh | 15 +++------------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/templates/tools/dockerfile/test/python_jessie_x64/Dockerfile.template b/templates/tools/dockerfile/test/python_jessie_x64/Dockerfile.template index dba6a227f2b..e73b839a284 100644 --- a/templates/tools/dockerfile/test/python_jessie_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/python_jessie_x64/Dockerfile.template @@ -19,6 +19,10 @@ <%include file="../../apt_get_basic.include"/> <%include file="../../gcp_api_libraries.include"/> <%include file="../../python_deps.include"/> + # Install pip and virtualenv for Python 3.4 + RUN curl https://bootstrap.pypa.io/get-pip.py | python3.4 + RUN python3.4 -m pip install virtualenv + <%include file="../../run_tests_addons.include"/> # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/test/python_jessie_x64/Dockerfile b/tools/dockerfile/test/python_jessie_x64/Dockerfile index 41b670c06c6..bd9d55ed8a2 100644 --- a/tools/dockerfile/test/python_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/python_jessie_x64/Dockerfile @@ -68,6 +68,10 @@ RUN pip install --upgrade pip==10.0.1 RUN pip install virtualenv RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0 +# Install pip and virtualenv for Python 3.4 +RUN curl https://bootstrap.pypa.io/get-pip.py | python3.4 +RUN python3.4 -m pip install virtualenv + # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc RUN ln -s /usr/bin/ccache /usr/local/bin/g++ diff --git a/tools/run_tests/helper_scripts/build_python.sh b/tools/run_tests/helper_scripts/build_python.sh index b0a6f0f4d4d..cdcb2aa116e 100755 --- a/tools/run_tests/helper_scripts/build_python.sh +++ b/tools/run_tests/helper_scripts/build_python.sh @@ -112,10 +112,6 @@ export CFLAGS="-I$ROOT/include -std=gnu99 -fno-wrapv $CFLAGS" export GRPC_PYTHON_BUILD_WITH_CYTHON=1 export LANG=en_US.UTF-8 -# Default python on the host to fall back to when instantiating e.g. the -# virtualenv. -HOST_PYTHON=${HOST_PYTHON:-python} - # If ccache is available on Linux, use it. if [ "$(is_linux)" ]; then # We're not on Darwin (Mac OS X) @@ -132,14 +128,9 @@ fi # Perform build operations # ############################ -# Instantiate the virtualenv, preferring to do so from the relevant python -# version. Even if these commands fail (e.g. on Windows due to name conflicts) -# it's possible that the virtualenv is still usable and we trust the tester to -# be able to 'figure it out' instead of us e.g. doing potentially expensive and -# unnecessary error recovery by `rm -rf`ing the virtualenv. -($PYTHON -m virtualenv "$VENV" || - $HOST_PYTHON -m virtualenv -p "$PYTHON" "$VENV" || - true) +# Instantiate the virtualenv from the Python version passed in. +$PYTHON -m pip install virtualenv +$PYTHON -m virtualenv "$VENV" VENV_PYTHON=$(script_realpath "$VENV/$VENV_RELATIVE_PYTHON") # See https://github.com/grpc/grpc/issues/14815 for more context. We cannot rely From cd1172c9dd3b346d261835bb7c6fdd94556a53b2 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 7 May 2018 10:31:41 -0700 Subject: [PATCH 160/165] Revert recent changes to node interop build script --- .../interoptest/grpc_interop_node/build_interop.sh | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh index 21fdd0b490f..c16efc1d354 100755 --- a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh @@ -17,23 +17,12 @@ set -e mkdir -p /var/local/git - git clone /var/local/jenkins/grpc-node /var/local/git/grpc-node # clone gRPC submodules, use data from locally cloned submodules where possible (cd /var/local/jenkins/grpc-node/ && git submodule foreach 'cd /var/local/git/grpc-node \ && git submodule update --init --recursive --reference /var/local/jenkins/grpc-node/${name} \ ${name}') -# Use the pending c-core changes if possible -if [ -d "/var/local/jenkins/grpc" ]; then - cd /var/local/jenkins/grpc - CURRENT_COMMIT="$(git rev-parse --verify HEAD)" - cd /var/local/git/grpc-node/packages/grpc-native-core/deps/grpc/ - git fetch --tags --progress https://github.com/grpc/grpc.git +refs/pull/*:refs/remotes/origin/pr/* - git checkout $CURRENT_COMMIT - git submodule update --init --recursive --reference /var/local/jenkins/grpc -fi - # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true From 5792c052dd839ae24cb0924077634cb794617b37 Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Mon, 7 May 2018 11:17:47 -0700 Subject: [PATCH 161/165] Update test jobs to 800 and set runs_per_test back to 2 to detect flakes. --- tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh | 2 +- tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh | 2 +- tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh index d38356c9669..4e0937c37b5 100755 --- a/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh @@ -37,7 +37,7 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc # TODO(adelez): implement size for test targets and change test_timeout back "${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ - test --jobs="200" \ + test --jobs="800" \ --test_output=errors \ --verbose_failures=true \ --keep_going \ diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh index 882e4df21b5..ed5caa40230 100644 --- a/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh @@ -13,6 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -EXTRA_FLAGS="-c dbg --test_timeout=300,450,1200,3600 --runs_per_test_detects_flakes --runs_per_test=1" +EXTRA_FLAGS="-c dbg --test_timeout=300,450,1200,3600 --runs_per_test_detects_flakes --runs_per_test=2" github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}" diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh index 85f69537bd4..66f02a82ff9 100644 --- a/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh @@ -13,5 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -EXTRA_FLAGS="-c opt --test_timeout=300,450,1200,3600 --runs_per_test_detects_flakes --runs_per_test=1" +EXTRA_FLAGS="-c opt --test_timeout=300,450,1200,3600 --runs_per_test_detects_flakes --runs_per_test=2" github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}" From 52b95cf1fb10c6b76ea3527b3b45c8446901d9ba Mon Sep 17 00:00:00 2001 From: ZhouyihaiDing Date: Tue, 31 Oct 2017 18:09:59 -0700 Subject: [PATCH 162/165] gRPC PHP Client Interceptor implementation and tests move InterceptorChannel to Internal subdir; change year --- src/php/lib/Grpc/BaseStub.php | 389 ++++++++++++---- src/php/lib/Grpc/Interceptor.php | 86 ++++ .../lib/Grpc/Internal/InterceptorChannel.php | 76 ++++ src/php/tests/unit_tests/InterceptorTest.php | 427 ++++++++++++++++++ 4 files changed, 888 insertions(+), 90 deletions(-) create mode 100644 src/php/lib/Grpc/Interceptor.php create mode 100644 src/php/lib/Grpc/Internal/InterceptorChannel.php create mode 100644 src/php/tests/unit_tests/InterceptorTest.php diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php index 5f3a96feaa3..7860233ca2c 100644 --- a/src/php/lib/Grpc/BaseStub.php +++ b/src/php/lib/Grpc/BaseStub.php @@ -38,12 +38,13 @@ class BaseStub * - 'update_metadata': (optional) a callback function which takes in a * metadata array, and returns an updated metadata array * - 'grpc.primary_user_agent': (optional) a user-agent string - * @param Channel $channel An already created Channel object (optional) + * @param Channel|InterceptorChannel $channel An already created Channel or InterceptorChannel object (optional) */ - public function __construct($hostname, $opts, Channel $channel = null) + public function __construct($hostname, $opts, $channel = null) { $ssl_roots = file_get_contents( - dirname(__FILE__).'/../../../../etc/roots.pem'); + dirname(__FILE__).'/../../../../etc/roots.pem' + ); ChannelCredentials::setDefaultRootsPem($ssl_roots); $this->hostname = $hostname; @@ -58,16 +59,20 @@ class BaseStub $this->hostname_override = $opts['grpc.ssl_target_name_override']; } if ($channel) { - if (!is_a($channel, 'Grpc\Channel')) { - throw new \Exception('The channel argument is not a'. - 'Channel object'); + if (!is_a($channel, 'Grpc\Channel') && + !is_a($channel, 'Grpc\InterceptorChannel')) { + throw new \Exception('The channel argument is not a Channel object '. + 'or an InterceptorChannel object created by '. + 'Interceptor::intercept($channel, Interceptor|Interceptor[] $interceptors)'); } $this->channel = $channel; return; } $package_config = json_decode( - file_get_contents(dirname(__FILE__).'/../../composer.json'), true); + file_get_contents(dirname(__FILE__).'/../../composer.json'), + true + ); if (!empty($opts['grpc.primary_user_agent'])) { $opts['grpc.primary_user_agent'] .= ' '; } else { @@ -77,8 +82,8 @@ class BaseStub 'grpc-php/'.$package_config['version']; if (!array_key_exists('credentials', $opts)) { throw new \Exception("The opts['credentials'] key is now ". - 'required. Please see one of the '. - 'ChannelCredentials::create methods'); + 'required. Please see one of the '. + 'ChannelCredentials::create methods'); } $this->channel = new Channel($hostname, $opts); } @@ -169,7 +174,8 @@ class BaseStub $last_slash_idx = strrpos($method, '/'); if ($last_slash_idx === false) { throw new \InvalidArgumentException( - 'service name must have a slash'); + 'service name must have a slash' + ); } $service_name = substr($method, 0, $last_slash_idx); @@ -197,7 +203,8 @@ class BaseStub if (!preg_match('/^[A-Za-z\d_-]+$/', $key)) { throw new \InvalidArgumentException( 'Metadata keys must be nonempty strings containing only '. - 'alphanumeric characters, hyphens and underscores'); + 'alphanumeric characters, hyphens and underscores' + ); } $metadata_copy[strtolower($key)] = $value; } @@ -205,9 +212,255 @@ class BaseStub return $metadata_copy; } + /** + * Create a function which can be used to create UnaryCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _GrpcUnaryUnary($channel, $deserialize) + { + return function ($method, + $argument, + array $metadata = [], + array $options = []) use ($channel, $deserialize) { + $call = new UnaryCall( + $channel, + $method, + $deserialize, + $options + ); + $jwt_aud_uri = $this->_get_jwt_aud_uri($method); + if (is_callable($this->update_metadata)) { + $metadata = call_user_func( + $this->update_metadata, + $metadata, + $jwt_aud_uri + ); + } + $metadata = $this->_validate_and_normalize_metadata( + $metadata + ); + $call->start($argument, $metadata, $options); + return $call; + }; + } + + /** + * Create a function which can be used to create ServerStreamingCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _GrpcStreamUnary($channel, $deserialize) + { + return function ($method, + array $metadata = [], + array $options = []) use ($channel, $deserialize) { + $call = new ClientStreamingCall( + $channel, + $method, + $deserialize, + $options + ); + $jwt_aud_uri = $this->_get_jwt_aud_uri($method); + if (is_callable($this->update_metadata)) { + $metadata = call_user_func( + $this->update_metadata, + $metadata, + $jwt_aud_uri + ); + } + $metadata = $this->_validate_and_normalize_metadata( + $metadata + ); + $call->start($metadata); + return $call; + }; + } + + /** + * Create a function which can be used to create ClientStreamingCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _GrpcUnaryStream($channel, $deserialize) + { + return function ($method, + $argument, + array $metadata = [], + array $options = []) use ($channel, $deserialize) { + $call = new ServerStreamingCall( + $channel, + $method, + $deserialize, + $options + ); + $jwt_aud_uri = $this->_get_jwt_aud_uri($method); + if (is_callable($this->update_metadata)) { + $metadata = call_user_func( + $this->update_metadata, + $metadata, + $jwt_aud_uri + ); + } + $metadata = $this->_validate_and_normalize_metadata( + $metadata + ); + $call->start($argument, $metadata, $options); + return $call; + }; + } + + /** + * Create a function which can be used to create BidiStreamingCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _GrpcStreamStream($channel, $deserialize) + { + return function ($method, + array $metadata = [], + array $options = []) use ($channel ,$deserialize) { + $call = new BidiStreamingCall( + $channel, + $method, + $deserialize, + $options + ); + $jwt_aud_uri = $this->_get_jwt_aud_uri($method); + if (is_callable($this->update_metadata)) { + $metadata = call_user_func( + $this->update_metadata, + $metadata, + $jwt_aud_uri + ); + } + $metadata = $this->_validate_and_normalize_metadata( + $metadata + ); + $call->start($metadata); + + return $call; + }; + } + + /** + * Create a function which can be used to create UnaryCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _UnaryUnaryCallFactory($channel, $deserialize) + { + if (is_a($channel, 'Grpc\InterceptorChannel')) { + return function ($method, + $argument, + array $metadata = [], + array $options = []) use ($channel, $deserialize) { + return $channel->getInterceptor()->interceptUnaryUnary( + $method, + $argument, + $metadata, + $options, + $this->_UnaryUnaryCallFactory($channel->getNext(), $deserialize) + ); + }; + } + return $this->_GrpcUnaryUnary($channel, $deserialize); + } + + /** + * Create a function which can be used to create ServerStreamingCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _UnaryStreamCallFactory($channel, $deserialize) + { + if (is_a($channel, 'Grpc\InterceptorChannel')) { + return function ($method, + $argument, + array $metadata = [], + array $options = []) use ($channel, $deserialize) { + return $channel->getInterceptor()->interceptUnaryStream( + $method, + $argument, + $metadata, + $options, + $this->_UnaryStreamCallFactory($channel->getNext(), $deserialize) + ); + }; + } + return $this->_GrpcUnaryStream($channel, $deserialize); + } + + /** + * Create a function which can be used to create ClientStreamingCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _StreamUnaryCallFactory($channel, $deserialize) + { + if (is_a($channel, 'Grpc\InterceptorChannel')) { + return function ($method, + array $metadata = [], + array $options = []) use ($channel, $deserialize) { + return $channel->getInterceptor()->interceptStreamUnary( + $method, + $metadata, + $options, + $this->_StreamUnaryCallFactory($channel->getNext(), $deserialize) + ); + }; + } + return $this->_GrpcStreamUnary($channel, $deserialize); + } + + /** + * Create a function which can be used to create BidiStreamingCall + * + * @param Channel|InterceptorChannel $channel + * @param callable $deserialize A function that deserializes the response + * + * @return \Closure + */ + private function _StreamStreamCallFactory($channel, $deserialize) + { + if (is_a($channel, 'Grpc\InterceptorChannel')) { + return function ($method, + array $metadata = [], + array $options = []) use ($channel, $deserialize) { + return $channel->getInterceptor()->interceptStreamStream( + $method, + $metadata, + $options, + $this->_StreamStreamCallFactory($channel->getNext(), $deserialize) + ); + }; + } + return $this->_GrpcStreamStream($channel, $deserialize); + } + /* This class is intended to be subclassed by generated code, so * all functions begin with "_" to avoid name collisions. */ - /** * Call a remote method that takes a single argument and has a * single output. @@ -221,26 +474,15 @@ class BaseStub * * @return UnaryCall The active call object */ - protected function _simpleRequest($method, - $argument, - $deserialize, - array $metadata = [], - array $options = []) - { - $call = new UnaryCall($this->channel, - $method, - $deserialize, - $options); - $jwt_aud_uri = $this->_get_jwt_aud_uri($method); - if (is_callable($this->update_metadata)) { - $metadata = call_user_func($this->update_metadata, - $metadata, - $jwt_aud_uri); - } - $metadata = $this->_validate_and_normalize_metadata( - $metadata); - $call->start($argument, $metadata, $options); - + protected function _simpleRequest( + $method, + $argument, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $call_factory = $this->_UnaryUnaryCallFactory($this->channel, $deserialize); + $call = $call_factory($method, $argument, $metadata, $options); return $call; } @@ -256,25 +498,14 @@ class BaseStub * * @return ClientStreamingCall The active call object */ - protected function _clientStreamRequest($method, - $deserialize, - array $metadata = [], - array $options = []) - { - $call = new ClientStreamingCall($this->channel, - $method, - $deserialize, - $options); - $jwt_aud_uri = $this->_get_jwt_aud_uri($method); - if (is_callable($this->update_metadata)) { - $metadata = call_user_func($this->update_metadata, - $metadata, - $jwt_aud_uri); - } - $metadata = $this->_validate_and_normalize_metadata( - $metadata); - $call->start($metadata); - + protected function _clientStreamRequest( + $method, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $call_factory = $this->_StreamUnaryCallFactory($this->channel, $deserialize); + $call = $call_factory($method, $metadata, $options); return $call; } @@ -291,26 +522,15 @@ class BaseStub * * @return ServerStreamingCall The active call object */ - protected function _serverStreamRequest($method, - $argument, - $deserialize, - array $metadata = [], - array $options = []) - { - $call = new ServerStreamingCall($this->channel, - $method, - $deserialize, - $options); - $jwt_aud_uri = $this->_get_jwt_aud_uri($method); - if (is_callable($this->update_metadata)) { - $metadata = call_user_func($this->update_metadata, - $metadata, - $jwt_aud_uri); - } - $metadata = $this->_validate_and_normalize_metadata( - $metadata); - $call->start($argument, $metadata, $options); - + protected function _serverStreamRequest( + $method, + $argument, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $call_factory = $this->_UnaryStreamCallFactory($this->channel, $deserialize); + $call = $call_factory($method, $argument, $metadata, $options); return $call; } @@ -325,25 +545,14 @@ class BaseStub * * @return BidiStreamingCall The active call object */ - protected function _bidiRequest($method, - $deserialize, - array $metadata = [], - array $options = []) - { - $call = new BidiStreamingCall($this->channel, - $method, - $deserialize, - $options); - $jwt_aud_uri = $this->_get_jwt_aud_uri($method); - if (is_callable($this->update_metadata)) { - $metadata = call_user_func($this->update_metadata, - $metadata, - $jwt_aud_uri); - } - $metadata = $this->_validate_and_normalize_metadata( - $metadata); - $call->start($metadata); - + protected function _bidiRequest( + $method, + $deserialize, + array $metadata = [], + array $options = [] + ) { + $call_factory = $this->_StreamStreamCallFactory($this->channel, $deserialize); + $call = $call_factory($method, $metadata, $options); return $call; } } diff --git a/src/php/lib/Grpc/Interceptor.php b/src/php/lib/Grpc/Interceptor.php new file mode 100644 index 00000000000..9c1b5616f25 --- /dev/null +++ b/src/php/lib/Grpc/Interceptor.php @@ -0,0 +1,86 @@ += 0; $i--) { + $channel = new InterceptorChannel($channel, $interceptors[$i]); + } + } else { + $channel = new InterceptorChannel($channel, $interceptors); + } + return $channel; + } +} + diff --git a/src/php/lib/Grpc/Internal/InterceptorChannel.php b/src/php/lib/Grpc/Internal/InterceptorChannel.php new file mode 100644 index 00000000000..9ac05748f34 --- /dev/null +++ b/src/php/lib/Grpc/Internal/InterceptorChannel.php @@ -0,0 +1,76 @@ +interceptor = $interceptor; + $this->next = $channel; + } + + public function getNext() + { + return $this->next; + } + + public function getInterceptor() + { + return $this->interceptor; + } + + public function getTarget() + { + return $this->getNext()->getTarget(); + } + + public function watchConnectivityState($new_state, $deadline) + { + return $this->getNext()->watchConnectivityState($new_state, $deadline); + } + + public function getConnectivityState($try_to_connect = false) + { + return $this->getNext()->getConnectivityState($try_to_connect); + } + + public function close() + { + return $this->getNext()->close(); + } +} diff --git a/src/php/tests/unit_tests/InterceptorTest.php b/src/php/tests/unit_tests/InterceptorTest.php new file mode 100644 index 00000000000..08f5abbb211 --- /dev/null +++ b/src/php/tests/unit_tests/InterceptorTest.php @@ -0,0 +1,427 @@ +data = $data; + } + public function setData($data) + { + $this->data = $data; + } + public function serializeToString() + { + return $this->data; + } +} + +class InterceptorClient extends Grpc\BaseStub +{ + + /** + * @param string $hostname hostname + * @param array $opts channel options + * @param Channel|InterceptorChannel $channel (optional) re-use channel object + */ + public function __construct($hostname, $opts, $channel = null) + { + parent::__construct($hostname, $opts, $channel); + } + + /** + * A simple RPC. + * @param \Routeguide\Point $argument input argument + * @param array $metadata metadata + * @param array $options call options + */ + public function UnaryCall( + SimpleRequest $argument, + $metadata = [], + $options = [] + ) { + return $this->_simpleRequest( + '/dummy_method', + $argument, + [], + $metadata, + $options + ); + } + + /** + * A client-to-server streaming RPC. + * @param array $metadata metadata + * @param array $options call options + */ + public function StreamCall( + $metadata = [], + $options = [] + ) { + return $this->_clientStreamRequest('/dummy_method', [], $metadata, $options); + } +} + + +class ChangeMetadataInterceptor extends Grpc\Interceptor +{ + public function interceptUnaryUnary($method, + $argument, + array $metadata = [], + array $options = [], + $continuation) + { + $metadata["foo"] = array('interceptor_from_unary_request'); + return $continuation($method, $argument, $metadata, $options); + } + public function interceptStreamUnary($method, array $metadata = [], array $options = [], $continuation) + { + $metadata["foo"] = array('interceptor_from_stream_request'); + return $continuation($method, $metadata, $options); + } +} + +class ChangeMetadataInterceptor2 extends Grpc\Interceptor +{ + public function interceptUnaryUnary($method, + $argument, + array $metadata = [], + array $options = [], + $continuation) + { + if (array_key_exists('foo', $metadata)) { + $metadata['bar'] = array('ChangeMetadataInterceptor should be executed first'); + } else { + $metadata["bar"] = array('interceptor_from_unary_request'); + } + return $continuation($method, $argument, $metadata, $options); + } + public function interceptStreamUnary($method, + array $metadata = [], + array $options = [], + $continuation) + { + if (array_key_exists('foo', $metadata)) { + $metadata['bar'] = array('ChangeMetadataInterceptor should be executed first'); + } else { + $metadata["bar"] = array('interceptor_from_stream_request'); + } + return $continuation($method, $metadata, $options); + } +} + +class ChangeRequestCall +{ + private $call; + + public function __construct($call) + { + $this->call = $call; + } + public function getCall() + { + return $this->call; + } + + public function write($request) + { + $request->setData('intercepted_stream_request'); + $this->getCall()->write($request); + } + + public function wait() + { + return $this->getCall()->wait(); + } +} + +class ChangeRequestInterceptor extends Grpc\Interceptor +{ + public function interceptUnaryUnary($method, + $argument, + array $metadata = [], + array $options = [], + $continuation) + { + $argument->setData('intercepted_unary_request'); + return $continuation($method, $argument, $metadata, $options); + } + public function interceptStreamUnary($method, array $metadata = [], array $options = [], $continuation) + { + return new ChangeRequestCall( + $continuation($method, $metadata, $options) + ); + } +} + +class StopCallInterceptor extends Grpc\Interceptor +{ + public function interceptUnaryUnary($method, + $argument, + array $metadata = [], + array $options = [], + $continuation) + { + $metadata["foo"] = array('interceptor_from_request_response'); + } + public function interceptStreamUnary($method, + array $metadata = [], + array $options = [], + $continuation) + { + $metadata["foo"] = array('interceptor_from_request_response'); + } +} + +class InterceptorTest extends PHPUnit_Framework_TestCase +{ + public function setUp() + { + $this->server = new Grpc\Server([]); + $this->port = $this->server->addHttp2Port('0.0.0.0:0'); + $this->channel = new Grpc\Channel('localhost:'.$this->port, ['credentials' => Grpc\ChannelCredentials::createInsecure()]); + $this->server->start(); + } + + public function tearDown() + { + $this->channel->close(); + } + + + public function testClientChangeMetadataOneInterceptor() + { + $req_text = 'client_request'; + $channel_matadata_interceptor = new ChangeMetadataInterceptor(); + $intercept_channel = Grpc\Interceptor::intercept($this->channel, $channel_matadata_interceptor); + echo "create Client\n"; + $client = new InterceptorClient('localhost:'.$this->port, [ + 'credentials' => Grpc\ChannelCredentials::createInsecure(), + ], $intercept_channel); + echo "create Call\n"; + $req = new SimpleRequest($req_text); + echo "Call created\n"; + $unary_call = $client->UnaryCall($req); + echo "start call\n"; + $event = $this->server->requestCall(); + $this->assertSame('/dummy_method', $event->method); + $this->assertSame(['interceptor_from_unary_request'], $event->metadata['foo']); + + $stream_call = $client->StreamCall(); + $stream_call->write($req); + $event = $this->server->requestCall(); + $this->assertSame('/dummy_method', $event->method); + $this->assertSame(['interceptor_from_stream_request'], $event->metadata['foo']); + + unset($unary_call); + unset($stream_call); + unset($server_call); + } + + public function testClientChangeMetadataTwoInterceptor() + { + $req_text = 'client_request'; + $channel_matadata_interceptor = new ChangeMetadataInterceptor(); + $channel_matadata_intercepto2 = new ChangeMetadataInterceptor2(); + // test intercept separately. + $intercept_channel1 = Grpc\Interceptor::intercept($this->channel, $channel_matadata_interceptor); + $intercept_channel2 = Grpc\Interceptor::intercept($intercept_channel1, $channel_matadata_intercepto2); + $client = new InterceptorClient('localhost:'.$this->port, [ + 'credentials' => Grpc\ChannelCredentials::createInsecure(), + ], $intercept_channel2); + + $req = new SimpleRequest($req_text); + $unary_call = $client->UnaryCall($req); + $event = $this->server->requestCall(); + $this->assertSame('/dummy_method', $event->method); + $this->assertSame(['interceptor_from_unary_request'], $event->metadata['foo']); + $this->assertSame(['interceptor_from_unary_request'], $event->metadata['bar']); + + $stream_call = $client->StreamCall(); + $stream_call->write($req); + $event = $this->server->requestCall(); + $this->assertSame('/dummy_method', $event->method); + $this->assertSame(['interceptor_from_stream_request'], $event->metadata['foo']); + $this->assertSame(['interceptor_from_stream_request'], $event->metadata['bar']); + + unset($unary_call); + unset($stream_call); + unset($server_call); + + // test intercept by array. + $intercept_channel3 = Grpc\Interceptor::intercept($this->channel, + [$channel_matadata_intercepto2, $channel_matadata_interceptor]); + $client = new InterceptorClient('localhost:'.$this->port, [ + 'credentials' => Grpc\ChannelCredentials::createInsecure(), + ], $intercept_channel3); + + $req = new SimpleRequest($req_text); + $unary_call = $client->UnaryCall($req); + $event = $this->server->requestCall(); + $this->assertSame('/dummy_method', $event->method); + $this->assertSame(['interceptor_from_unary_request'], $event->metadata['foo']); + $this->assertSame(['interceptor_from_unary_request'], $event->metadata['bar']); + + $stream_call = $client->StreamCall(); + $stream_call->write($req); + $event = $this->server->requestCall(); + $this->assertSame('/dummy_method', $event->method); + $this->assertSame(['interceptor_from_stream_request'], $event->metadata['foo']); + $this->assertSame(['interceptor_from_stream_request'], $event->metadata['bar']); + + unset($unary_call); + unset($stream_call); + unset($server_call); + } + + public function testClientChangeRequestInterceptor() + { + $req_text = 'client_request'; + $change_request_interceptor = new ChangeRequestInterceptor(); + $intercept_channel = Grpc\Interceptor::intercept($this->channel, + $change_request_interceptor); + $client = new InterceptorClient('localhost:'.$this->port, [ + 'credentials' => Grpc\ChannelCredentials::createInsecure(), + ], $intercept_channel); + + $req = new SimpleRequest($req_text); + $unary_call = $client->UnaryCall($req); + + $event = $this->server->requestCall(); + $this->assertSame('/dummy_method', $event->method); + $server_call = $event->call; + $event = $server_call->startBatch([ + Grpc\OP_SEND_INITIAL_METADATA => [], + Grpc\OP_SEND_STATUS_FROM_SERVER => [ + 'metadata' => [], + 'code' => Grpc\STATUS_OK, + 'details' => '', + ], + Grpc\OP_RECV_MESSAGE => true, + Grpc\OP_RECV_CLOSE_ON_SERVER => true, + ]); + $this->assertSame('intercepted_unary_request', $event->message); + + $stream_call = $client->StreamCall(); + $stream_call->write($req); + $event = $this->server->requestCall(); + $this->assertSame('/dummy_method', $event->method); + $server_call = $event->call; + $event = $server_call->startBatch([ + Grpc\OP_SEND_INITIAL_METADATA => [], + Grpc\OP_SEND_STATUS_FROM_SERVER => [ + 'metadata' => [], + 'code' => Grpc\STATUS_OK, + 'details' => '', + ], + Grpc\OP_RECV_MESSAGE => true, + Grpc\OP_RECV_CLOSE_ON_SERVER => true, + ]); + $this->assertSame('intercepted_stream_request', $event->message); + + unset($unary_call); + unset($stream_call); + unset($server_call); + } + + public function testClientChangeStopCallInterceptor() + { + $req_text = 'client_request'; + $channel_request_interceptor = new StopCallInterceptor(); + $intercept_channel = Grpc\Interceptor::intercept($this->channel, + $channel_request_interceptor); + $client = new InterceptorClient('localhost:'.$this->port, [ + 'credentials' => Grpc\ChannelCredentials::createInsecure(), + ], $intercept_channel); + + $req = new SimpleRequest($req_text); + $unary_call = $client->UnaryCall($req); + $this->assertNull($unary_call); + + + $stream_call = $client->StreamCall(); + $this->assertNull($stream_call); + + unset($unary_call); + unset($stream_call); + unset($server_call); + } + + public function testGetInterceptorChannelConnectivityState() + { + $channel = new Grpc\Channel( + 'localhost:0', + ['credentials' => Grpc\ChannelCredentials::createInsecure()] + ); + $interceptor_channel = Grpc\Interceptor::intercept($channel, new Grpc\Interceptor()); + $state = $interceptor_channel->getConnectivityState(); + $this->assertEquals(0, $state); + $channel->close(); + } + + public function testInterceptorChannelWatchConnectivityState() + { + $channel = new Grpc\Channel( + 'localhost:0', + ['credentials' => Grpc\ChannelCredentials::createInsecure()] + ); + $interceptor_channel = Grpc\Interceptor::intercept($channel, new Grpc\Interceptor()); + $now = Grpc\Timeval::now(); + $deadline = $now->add(new Grpc\Timeval(100*1000)); + $state = $interceptor_channel->watchConnectivityState(1, $deadline); + $this->assertTrue($state); + unset($time); + unset($deadline); + $channel->close(); + } + + public function testInterceptorChannelClose() + { + $channel = new Grpc\Channel( + 'localhost:0', + ['credentials' => Grpc\ChannelCredentials::createInsecure()] + ); + $interceptor_channel = Grpc\Interceptor::intercept($channel, new Grpc\Interceptor()); + $this->assertNotNull($interceptor_channel); + $channel->close(); + } + + public function testInterceptorChannelGetTarget() + { + $channel = new Grpc\Channel( + 'localhost:8888', + ['credentials' => Grpc\ChannelCredentials::createInsecure()] + ); + $interceptor_channel = Grpc\Interceptor::intercept($channel, new Grpc\Interceptor()); + $target = $interceptor_channel->getTarget(); + $this->assertTrue(is_string($target)); + $channel->close(); + } +} From add5840ec44679fb1887b0c806f51f28c3a386ae Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 8 May 2018 11:37:09 +0200 Subject: [PATCH 163/165] gcov: dont run large json_run_localhost scenarios --- test/cpp/qps/gen_build_yaml.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/cpp/qps/gen_build_yaml.py b/test/cpp/qps/gen_build_yaml.py index 1ef8f65b0bf..776283c25a8 100755 --- a/test/cpp/qps/gen_build_yaml.py +++ b/test/cpp/qps/gen_build_yaml.py @@ -63,6 +63,11 @@ def guess_cpu(scenario_json, is_tsan): return (scenario_json['num_clients'] * client + scenario_json['num_servers'] * server) +def maybe_exclude_gcov(scenario_json): + if scenario_json['client_config']['client_channels'] > 100: + return ['gcov'] + return [] + print yaml.dump({ 'tests': [ { @@ -76,7 +81,7 @@ print yaml.dump({ 'boringssl': True, 'defaults': 'boringssl', 'cpu_cost': guess_cpu(scenario_json, False), - 'exclude_configs': ['tsan', 'asan'], + 'exclude_configs': ['tsan', 'asan'] + maybe_exclude_gcov(scenario_json), 'timeout_seconds': 2*60, 'excluded_poll_engines': scenario_json.get('EXCLUDED_POLL_ENGINES', []), 'auto_timeout_scaling': False From 13c903552b2228c30e9fa6db1d8703a75a167eb8 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 8 May 2018 11:57:22 +0200 Subject: [PATCH 164/165] regenerate projects --- tools/run_tests/generated/tests.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 8eb5303e823..e2a79075d95 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -58026,7 +58026,8 @@ "defaults": "boringssl", "exclude_configs": [ "tsan", - "asan" + "asan", + "gcov" ], "excluded_poll_engines": [], "flaky": false, From 0491cd2872c6ee7898f814834b110116f614547c Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 8 May 2018 12:55:42 +0200 Subject: [PATCH 165/165] disable unwanted dotnet options --- tools/internal_ci/helper_scripts/prepare_build_macos_rc | 5 +++++ tools/internal_ci/helper_scripts/prepare_build_windows.bat | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tools/internal_ci/helper_scripts/prepare_build_macos_rc b/tools/internal_ci/helper_scripts/prepare_build_macos_rc index d84bebd4ea0..d2b77691d42 100644 --- a/tools/internal_ci/helper_scripts/prepare_build_macos_rc +++ b/tools/internal_ci/helper_scripts/prepare_build_macos_rc @@ -69,6 +69,11 @@ export PYTHONPATH=/Library/Python/3.4/site-packages # set xcode version for Obj-C tests sudo xcode-select -switch /Applications/Xcode_9.2.app/Contents/Developer/ +# Disable some unwanted dotnet options +export NUGET_XMLDOC_MODE=skip +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true +export DOTNET_CLI_TELEMETRY_OPTOUT=true + # TODO(jtattermusch): better debugging of clock skew, remove once not needed date diff --git a/tools/internal_ci/helper_scripts/prepare_build_windows.bat b/tools/internal_ci/helper_scripts/prepare_build_windows.bat index 9fa68602264..f987f8a8cb5 100644 --- a/tools/internal_ci/helper_scripts/prepare_build_windows.bat +++ b/tools/internal_ci/helper_scripts/prepare_build_windows.bat @@ -34,4 +34,9 @@ netsh interface ip add dnsservers "Local Area Connection 8" 8.8.4.4 index=3 @rem Needed for big_query_utils python -m pip install google-api-python-client +@rem Disable some unwanted dotnet options +set NUGET_XMLDOC_MODE=skip +set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true +set DOTNET_CLI_TELEMETRY_OPTOUT=true + git submodule update --init