diff options
-rw-r--r-- | src/core/lib/security/credentials/oauth2/oauth2_credentials.cc | 2 | ||||
-rw-r--r-- | src/cpp/client/create_channel.cc | 3 | ||||
-rw-r--r-- | tools/debug/core/error_ref_leak.py | 47 | ||||
-rwxr-xr-x | tools/internal_ci/linux/grpc_interop_matrix.sh | 2 |
4 files changed, 50 insertions, 4 deletions
diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc index f52a424e36..7867105f56 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc @@ -262,7 +262,7 @@ static bool oauth2_token_fetcher_get_request_metadata( grpc_mdelem cached_access_token_md = GRPC_MDNULL; gpr_mu_lock(&c->mu); if (!GRPC_MDISNULL(c->access_token_md) && - (c->token_expiration + grpc_exec_ctx_now(exec_ctx) > refresh_threshold)) { + (c->token_expiration - grpc_exec_ctx_now(exec_ctx) > refresh_threshold)) { cached_access_token_md = GRPC_MDELEM_REF(c->access_token_md); } if (!GRPC_MDISNULL(cached_access_token_md)) { diff --git a/src/cpp/client/create_channel.cc b/src/cpp/client/create_channel.cc index e2893c8f3c..de67281dd4 100644 --- a/src/cpp/client/create_channel.cc +++ b/src/cpp/client/create_channel.cc @@ -38,8 +38,7 @@ std::shared_ptr<Channel> CreateCustomChannel( const grpc::string& target, const std::shared_ptr<ChannelCredentials>& creds, const ChannelArguments& args) { - internal::GrpcLibrary - init_lib; // We need to call init in case of a bad creds. + GrpcLibraryCodegen init_lib; // We need to call init in case of a bad creds. return creds ? creds->CreateChannel(target, args) : CreateChannelInternal("", grpc_lame_client_channel_create( diff --git a/tools/debug/core/error_ref_leak.py b/tools/debug/core/error_ref_leak.py new file mode 100644 index 0000000000..6582328a5b --- /dev/null +++ b/tools/debug/core/error_ref_leak.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python2.7 +# +# 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. + +# Reads stdin to find error_refcount log lines, and prints reference leaks +# to stdout + +# usege: python error_ref_leak < logfile.txt + +import sys +import re + +data = sys.stdin.readlines() + +errs = [] +for line in data: + # if we care about the line + if re.search(r'error.cc', line): + # str manip to cut off left part of log line + line = line.partition('error.cc:')[-1] + line = re.sub(r'\d+] ', r'', line) + line = line.strip().split() + err = line[0].strip(":") + if line[1] == "create": + assert(err not in errs) + errs.append(err) + elif line[0] == "realloc": + errs.remove(line[1]) + errs.append(line[3]) + # explicitly look for the last dereference + elif line[1] == "1" and line[3] == "0": + assert(err in errs) + errs.remove(err) + +print "leaked:", errs diff --git a/tools/internal_ci/linux/grpc_interop_matrix.sh b/tools/internal_ci/linux/grpc_interop_matrix.sh index 6a9c38705a..4c24c43488 100755 --- a/tools/internal_ci/linux/grpc_interop_matrix.sh +++ b/tools/internal_ci/linux/grpc_interop_matrix.sh @@ -22,4 +22,4 @@ cd $(dirname $0)/../../.. source tools/internal_ci/helper_scripts/prepare_build_linux_rc -tools/interop_matrix/run_interop_matrix_tests.py --language=all --release=all --report_file=sponge_log.xml --bq_result_table interop_results $@ +tools/interop_matrix/run_interop_matrix_tests.py --language=all --release=all --allow_flakes --report_file=sponge_log.xml --bq_result_table interop_results $@ |