diff options
-rw-r--r-- | src/core/support/thd_win32.c | 2 | ||||
-rwxr-xr-x | src/php/bin/generate_proto_php.sh | 40 | ||||
-rw-r--r-- | src/php/ext/grpc/call.c | 11 | ||||
-rw-r--r-- | src/php/ext/grpc/channel.c | 1 | ||||
-rw-r--r-- | test/cpp/qps/driver.cc | 8 | ||||
-rw-r--r-- | test/cpp/qps/driver.h | 5 | ||||
-rw-r--r-- | test/cpp/qps/qps_driver.cc | 8 | ||||
-rwxr-xr-x | tools/distpackages/build_deb_packages.sh | 8 |
8 files changed, 71 insertions, 12 deletions
diff --git a/src/core/support/thd_win32.c b/src/core/support/thd_win32.c index f92fb64a5c..3cc798293a 100644 --- a/src/core/support/thd_win32.c +++ b/src/core/support/thd_win32.c @@ -61,7 +61,7 @@ struct thd_info { static thread_local struct thd_info *g_thd_info; /* Destroys a thread info */ -static destroy_thread(struct thd_info *t) { +static void destroy_thread(struct thd_info *t) { if (t->joinable) CloseHandle(t->join_event); gpr_free(t); } diff --git a/src/php/bin/generate_proto_php.sh b/src/php/bin/generate_proto_php.sh new file mode 100755 index 0000000000..16f93747ab --- /dev/null +++ b/src/php/bin/generate_proto_php.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# Copyright 2015, Google 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 Google 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 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. + + +set +e +cd $(dirname $0) + +gen_code='../tests/generated_code' +interop='../tests/interop' + +protoc-gen-php -i $gen_code -o $gen_code $gen_code/math.proto + +protoc-gen-php -i $interop -o $interop $interop/test.proto diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 6bc65b5367..b1525e9246 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -443,8 +443,9 @@ PHP_METHOD(Call, startBatch) { add_property_bool(result, "send_status", true); break; case GRPC_OP_RECV_INITIAL_METADATA: - add_property_zval(result, "metadata", - grpc_parse_metadata_array(&recv_metadata)); + array = grpc_parse_metadata_array(&recv_metadata); + add_property_zval(result, "metadata", array); + Z_DELREF_P(array); break; case GRPC_OP_RECV_MESSAGE: byte_buffer_to_string(message, &message_str, &message_len); @@ -458,11 +459,13 @@ PHP_METHOD(Call, startBatch) { case GRPC_OP_RECV_STATUS_ON_CLIENT: MAKE_STD_ZVAL(recv_status); object_init(recv_status); - add_property_zval(recv_status, "metadata", - grpc_parse_metadata_array(&recv_trailing_metadata)); + array = grpc_parse_metadata_array(&recv_trailing_metadata); + add_property_zval(recv_status, "metadata", array); + Z_DELREF_P(array); add_property_long(recv_status, "code", status); add_property_string(recv_status, "details", status_details, true); add_property_zval(result, "status", recv_status); + Z_DELREF_P(recv_status); break; case GRPC_OP_RECV_CLOSE_ON_SERVER: add_property_bool(result, "cancelled", cancelled); diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 51a3eae0f4..b8262db162 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -62,6 +62,7 @@ void free_wrapped_grpc_channel(void *object TSRMLS_DC) { if (channel->wrapped != NULL) { grpc_channel_destroy(channel->wrapped); } + efree(channel->target); efree(channel); } diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index 64a53496ae..f44883783d 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -74,7 +74,9 @@ static vector<string> get_hosts(const string& name) { ScenarioResult RunScenario(const ClientConfig& initial_client_config, size_t num_clients, const ServerConfig& server_config, - size_t num_servers) { + size_t num_servers, + int warmup_seconds, + int benchmark_seconds) { // ClientContext allocator (all are destroyed at scope exit) list<ClientContext> contexts; auto alloc_context = [&contexts]() { @@ -146,7 +148,7 @@ ScenarioResult RunScenario(const ClientConfig& initial_client_config, // Let everything warmup gpr_log(GPR_INFO, "Warming up"); gpr_timespec start = gpr_now(); - gpr_sleep_until(gpr_time_add(start, gpr_time_from_seconds(5))); + gpr_sleep_until(gpr_time_add(start, gpr_time_from_seconds(warmup_seconds))); // Start a run gpr_log(GPR_INFO, "Starting"); @@ -171,7 +173,7 @@ ScenarioResult RunScenario(const ClientConfig& initial_client_config, // Wait some time gpr_log(GPR_INFO, "Running"); - gpr_sleep_until(gpr_time_add(start, gpr_time_from_seconds(15))); + gpr_sleep_until(gpr_time_add(start, gpr_time_from_seconds(benchmark_seconds))); // Finish a run ScenarioResult result; diff --git a/test/cpp/qps/driver.h b/test/cpp/qps/driver.h index d87e80dc55..7a81b701c4 100644 --- a/test/cpp/qps/driver.h +++ b/test/cpp/qps/driver.h @@ -54,7 +54,10 @@ struct ScenarioResult { ScenarioResult RunScenario(const grpc::testing::ClientConfig& client_config, size_t num_clients, const grpc::testing::ServerConfig& server_config, - size_t num_servers); + size_t num_servers, + int warmup_seconds, + int benchmark_seconds); + } // namespace testing } // namespace grpc diff --git a/test/cpp/qps/qps_driver.cc b/test/cpp/qps/qps_driver.cc index f7aa8e2aba..f42d538b16 100644 --- a/test/cpp/qps/qps_driver.cc +++ b/test/cpp/qps/qps_driver.cc @@ -40,6 +40,9 @@ DEFINE_int32(num_clients, 1, "Number of client binaries"); DEFINE_int32(num_servers, 1, "Number of server binaries"); +DEFINE_int32(warmup_seconds, 5, "Warmup time (in seconds)"); +DEFINE_int32(benchmark_seconds, 30, "Benchmark time (in seconds)"); + // Common config DEFINE_bool(enable_ssl, false, "Use SSL"); DEFINE_string(rpc_type, "UNARY", "Type of RPC: UNARY or STREAMING"); @@ -98,8 +101,9 @@ int main(int argc, char** argv) { server_config.set_threads(FLAGS_server_threads); server_config.set_enable_ssl(FLAGS_enable_ssl); - auto result = RunScenario(client_config, FLAGS_num_clients, server_config, - FLAGS_num_servers); + auto result = RunScenario(client_config, FLAGS_num_clients, + server_config, FLAGS_num_servers, + FLAGS_warmup_seconds, FLAGS_benchmark_seconds); gpr_log(GPR_INFO, "QPS: %.1f", result.latencies.Count() / diff --git a/tools/distpackages/build_deb_packages.sh b/tools/distpackages/build_deb_packages.sh index 366a5184c8..0beb41ed0a 100755 --- a/tools/distpackages/build_deb_packages.sh +++ b/tools/distpackages/build_deb_packages.sh @@ -45,7 +45,13 @@ if [ -f /version.txt ]; then pkg_version=$(cat /version.txt) fi version="${pkg_version}.0" -echo "Target release => $pkg_version" +release_tag="release-${pkg_version//./_}" +echo "Target release => $pkg_version, will checkout tag $release_tag" + +# Switch grpc_root to the release tag +pushd $grpc_root +git checkout $release_tag || { echo "bad release tag ${release_tag}"; exit 1; } +popd if [ -f /.dockerinit ]; then # We're in Docker where uname -p returns "unknown". |