Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
nanahpang committed May 13, 2019
2 parents 87d75d2 + 661663f commit e4d9b57
Show file tree
Hide file tree
Showing 64 changed files with 916 additions and 584 deletions.
5 changes: 3 additions & 2 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ config_setting(
)

# This should be updated along with build.yaml
g_stands_for = "gandalf"
g_stands_for = "gale"

core_version = "7.0.0"

version = "1.21.0-dev"
version = "1.22.0-dev"

GPR_PUBLIC_HDRS = [
"include/grpc/support/alloc.h",
Expand Down Expand Up @@ -997,6 +997,7 @@ grpc_cc_library(
"src/core/lib/slice/slice_hash_table.h",
"src/core/lib/slice/slice_internal.h",
"src/core/lib/slice/slice_string_helpers.h",
"src/core/lib/slice/slice_utils.h",
"src/core/lib/slice/slice_weak_hash_table.h",
"src/core/lib/surface/api_trace.h",
"src/core/lib/surface/call.h",
Expand Down
2 changes: 2 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ config("grpc_config") {
"src/core/lib/slice/slice_internal.h",
"src/core/lib/slice/slice_string_helpers.cc",
"src/core/lib/slice/slice_string_helpers.h",
"src/core/lib/slice/slice_utils.h",
"src/core/lib/slice/slice_weak_hash_table.h",
"src/core/lib/surface/api_trace.cc",
"src/core/lib/surface/api_trace.h",
Expand Down Expand Up @@ -1283,6 +1284,7 @@ config("grpc_config") {
"src/core/lib/slice/slice_hash_table.h",
"src/core/lib/slice/slice_internal.h",
"src/core/lib/slice/slice_string_helpers.h",
"src/core/lib/slice/slice_utils.h",
"src/core/lib/slice/slice_weak_hash_table.h",
"src/core/lib/surface/api_trace.h",
"src/core/lib/surface/call.h",
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
cmake_minimum_required(VERSION 2.8)

set(PACKAGE_NAME "grpc")
set(PACKAGE_VERSION "1.21.0-dev")
set(PACKAGE_VERSION "1.22.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/")
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ Q = @
endif

CORE_VERSION = 7.0.0
CPP_VERSION = 1.21.0-dev
CSHARP_VERSION = 1.21.0-dev
CPP_VERSION = 1.22.0-dev
CSHARP_VERSION = 1.22.0-dev

CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
Expand Down
5 changes: 3 additions & 2 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 7.0.0
g_stands_for: gandalf
version: 1.21.0-dev
g_stands_for: gale
version: 1.22.0-dev
filegroups:
- name: alts_proto
headers:
Expand Down Expand Up @@ -525,6 +525,7 @@ filegroups:
- src/core/lib/slice/slice_hash_table.h
- src/core/lib/slice/slice_internal.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/lib/slice/slice_utils.h
- src/core/lib/slice/slice_weak_hash_table.h
- src/core/lib/surface/api_trace.h
- src/core/lib/surface/call.h
Expand Down
3 changes: 2 additions & 1 deletion doc/g_stands_for.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
- 1.18 'g' stands for ['goose'](https://github.com/grpc/grpc/tree/v1.18.x)
- 1.19 'g' stands for ['gold'](https://github.com/grpc/grpc/tree/v1.19.x)
- 1.20 'g' stands for ['godric'](https://github.com/grpc/grpc/tree/v1.20.x)
- 1.21 'g' stands for ['gandalf'](https://github.com/grpc/grpc/tree/master)
- 1.21 'g' stands for ['gandalf'](https://github.com/grpc/grpc/tree/v1.21.x)
- 1.22 'g' stands for ['gale'](https://github.com/grpc/grpc/tree/master)
6 changes: 4 additions & 2 deletions gRPC-C++.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
Pod::Spec.new do |s|
s.name = 'gRPC-C++'
# TODO (mxyan): use version that match gRPC version when pod is stabilized
# version = '1.21.0-dev'
# version = '1.22.0-dev'
version = '0.0.8-dev'
s.version = version
s.summary = 'gRPC C++ library'
s.homepage = 'https://grpc.io'
s.license = 'Apache License, Version 2.0'
s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' }

grpc_version = '1.21.0-dev'
grpc_version = '1.22.0-dev'

s.source = {
:git => 'https://github.com/grpc/grpc.git',
Expand Down Expand Up @@ -518,6 +518,7 @@ Pod::Spec.new do |s|
'src/core/lib/slice/slice_hash_table.h',
'src/core/lib/slice/slice_internal.h',
'src/core/lib/slice/slice_string_helpers.h',
'src/core/lib/slice/slice_utils.h',
'src/core/lib/slice/slice_weak_hash_table.h',
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/call.h',
Expand Down Expand Up @@ -721,6 +722,7 @@ Pod::Spec.new do |s|
'src/core/lib/slice/slice_hash_table.h',
'src/core/lib/slice/slice_internal.h',
'src/core/lib/slice/slice_string_helpers.h',
'src/core/lib/slice/slice_utils.h',
'src/core/lib/slice/slice_weak_hash_table.h',
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/call.h',
Expand Down
4 changes: 3 additions & 1 deletion gRPC-Core.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-Core'
version = '1.21.0-dev'
version = '1.22.0-dev'
s.version = version
s.summary = 'Core cross-platform gRPC library, written in C'
s.homepage = 'https://grpc.io'
Expand Down Expand Up @@ -494,6 +494,7 @@ Pod::Spec.new do |s|
'src/core/lib/slice/slice_hash_table.h',
'src/core/lib/slice/slice_internal.h',
'src/core/lib/slice/slice_string_helpers.h',
'src/core/lib/slice/slice_utils.h',
'src/core/lib/slice/slice_weak_hash_table.h',
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/call.h',
Expand Down Expand Up @@ -1147,6 +1148,7 @@ Pod::Spec.new do |s|
'src/core/lib/slice/slice_hash_table.h',
'src/core/lib/slice/slice_internal.h',
'src/core/lib/slice/slice_string_helpers.h',
'src/core/lib/slice/slice_utils.h',
'src/core/lib/slice/slice_weak_hash_table.h',
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/call.h',
Expand Down
2 changes: 1 addition & 1 deletion gRPC-ProtoRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC'
version = '1.21.0-dev'
version = '1.22.0-dev'
s.version = version
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
s.homepage = 'https://grpc.io'
Expand Down
2 changes: 1 addition & 1 deletion gRPC-RxLibrary.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary'
version = '1.21.0-dev'
version = '1.22.0-dev'
s.version = version
s.summary = 'Reactive Extensions library for iOS/OSX.'
s.homepage = 'https://grpc.io'
Expand Down
2 changes: 1 addition & 1 deletion gRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC'
version = '1.21.0-dev'
version = '1.22.0-dev'
s.version = version
s.summary = 'gRPC client library for iOS/OSX'
s.homepage = 'https://grpc.io'
Expand Down
1 change: 1 addition & 0 deletions grpc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/slice/slice_hash_table.h )
s.files += %w( src/core/lib/slice/slice_internal.h )
s.files += %w( src/core/lib/slice/slice_string_helpers.h )
s.files += %w( src/core/lib/slice/slice_utils.h )
s.files += %w( src/core/lib/slice/slice_weak_hash_table.h )
s.files += %w( src/core/lib/surface/api_trace.h )
s.files += %w( src/core/lib/surface/call.h )
Expand Down
12 changes: 12 additions & 0 deletions include/grpcpp/server_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ class Server : public grpc::ServerInterface, private grpc::GrpcLibraryCodegen {

grpc_server* server() override { return server_; }

protected:
/// NOTE: This method is not part of the public API for this class.
void set_health_check_service(
std::unique_ptr<grpc::HealthCheckServiceInterface> service) {
health_check_service_ = std::move(service);
}

/// NOTE: This method is not part of the public API for this class.
bool health_check_service_disabled() const {
return health_check_service_disabled_;
}

private:
std::vector<
std::unique_ptr<grpc::experimental::ServerInterceptorFactoryInterface>>*
Expand Down
5 changes: 3 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<date>2018-01-19</date>
<time>16:06:07</time>
<version>
<release>1.21.0dev</release>
<api>1.21.0dev</api>
<release>1.22.0dev</release>
<api>1.22.0dev</api>
</version>
<stability>
<release>beta</release>
Expand Down Expand Up @@ -433,6 +433,7 @@
<file baseinstalldir="/" name="src/core/lib/slice/slice_hash_table.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/slice/slice_internal.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/slice/slice_string_helpers.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/slice/slice_utils.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/slice/slice_weak_hash_table.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/api_trace.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/call.h" role="src" />
Expand Down
51 changes: 25 additions & 26 deletions src/core/ext/filters/client_channel/client_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class ChannelData {
~ChannelData();

static bool ProcessResolverResultLocked(
void* arg, const Resolver::Result& result, const char** lb_policy_name,
void* arg, Resolver::Result* result, const char** lb_policy_name,
RefCountedPtr<ParsedLoadBalancingConfig>* lb_policy_config,
grpc_error** service_config_error);

Expand Down Expand Up @@ -271,7 +271,6 @@ class ChannelData {
OrphanablePtr<LoadBalancingPolicy> resolving_lb_policy_;
grpc_connectivity_state_tracker state_tracker_;
ExternalConnectivityWatcher::WatcherList external_connectivity_watcher_list_;
UniquePtr<char> health_check_service_name_;
RefCountedPtr<ServiceConfig> saved_service_config_;
bool received_first_resolver_result_ = false;

Expand Down Expand Up @@ -951,18 +950,10 @@ class ChannelData::ClientChannelControlHelper
}

Subchannel* CreateSubchannel(const grpc_channel_args& args) override {
grpc_arg args_to_add[2];
int num_args_to_add = 0;
if (chand_->health_check_service_name_ != nullptr) {
args_to_add[0] = grpc_channel_arg_string_create(
const_cast<char*>("grpc.temp.health_check"),
const_cast<char*>(chand_->health_check_service_name_.get()));
num_args_to_add++;
}
args_to_add[num_args_to_add++] = SubchannelPoolInterface::CreateChannelArg(
grpc_arg arg = SubchannelPoolInterface::CreateChannelArg(
chand_->subchannel_pool_.get());
grpc_channel_args* new_args =
grpc_channel_args_copy_and_add(&args, args_to_add, num_args_to_add);
grpc_channel_args_copy_and_add(&args, &arg, 1);
Subchannel* subchannel =
chand_->client_channel_factory_->CreateSubchannel(new_args);
grpc_channel_args_destroy(new_args);
Expand Down Expand Up @@ -1201,14 +1192,14 @@ void ChannelData::ProcessLbPolicy(
// Synchronous callback from ResolvingLoadBalancingPolicy to process a
// resolver result update.
bool ChannelData::ProcessResolverResultLocked(
void* arg, const Resolver::Result& result, const char** lb_policy_name,
void* arg, Resolver::Result* result, const char** lb_policy_name,
RefCountedPtr<ParsedLoadBalancingConfig>* lb_policy_config,
grpc_error** service_config_error) {
ChannelData* chand = static_cast<ChannelData*>(arg);
RefCountedPtr<ServiceConfig> service_config;
// If resolver did not return a service config or returned an invalid service
// config, we need a fallback service config.
if (result.service_config_error != GRPC_ERROR_NONE) {
if (result->service_config_error != GRPC_ERROR_NONE) {
// If the service config was invalid, then fallback to the saved service
// config. If there is no saved config either, use the default service
// config.
Expand All @@ -1229,7 +1220,7 @@ bool ChannelData::ProcessResolverResultLocked(
}
service_config = chand->default_service_config_;
}
} else if (result.service_config == nullptr) {
} else if (result->service_config == nullptr) {
if (chand->default_service_config_ != nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO,
Expand All @@ -1240,15 +1231,15 @@ bool ChannelData::ProcessResolverResultLocked(
service_config = chand->default_service_config_;
}
} else {
service_config = result.service_config;
service_config = result->service_config;
}
*service_config_error = GRPC_ERROR_REF(result.service_config_error);
*service_config_error = GRPC_ERROR_REF(result->service_config_error);
if (service_config == nullptr &&
result.service_config_error != GRPC_ERROR_NONE) {
result->service_config_error != GRPC_ERROR_NONE) {
return false;
}
UniquePtr<char> service_config_json;
// Process service config.
UniquePtr<char> service_config_json;
const internal::ClientChannelGlobalParsedObject* parsed_service_config =
nullptr;
if (service_config != nullptr) {
Expand All @@ -1257,6 +1248,20 @@ bool ChannelData::ProcessResolverResultLocked(
service_config->GetParsedGlobalServiceConfigObject(
internal::ClientChannelServiceConfigParser::ParserIndex()));
}
// TODO(roth): Eliminate this hack as part of hiding health check
// service name from LB policy API. As part of this, change the API
// for this function to pass in result as a const reference.
if (parsed_service_config != nullptr &&
parsed_service_config->health_check_service_name() != nullptr) {
grpc_arg new_arg = grpc_channel_arg_string_create(
const_cast<char*>("grpc.temp.health_check"),
const_cast<char*>(parsed_service_config->health_check_service_name()));
grpc_channel_args* new_args =
grpc_channel_args_copy_and_add(result->args, &new_arg, 1);
grpc_channel_args_destroy(result->args);
result->args = new_args;
}
// Check if the config has changed.
const bool service_config_changed =
((service_config == nullptr) !=
(chand->saved_service_config_ == nullptr)) ||
Expand All @@ -1273,12 +1278,6 @@ bool ChannelData::ProcessResolverResultLocked(
chand, service_config_json.get());
}
chand->saved_service_config_ = std::move(service_config);
if (parsed_service_config != nullptr) {
chand->health_check_service_name_.reset(
gpr_strdup(parsed_service_config->health_check_service_name()));
} else {
chand->health_check_service_name_.reset();
}
}
// We want to set the service config at least once. This should not really be
// needed, but we are doing it as a defensive approach. This can be removed,
Expand All @@ -1296,7 +1295,7 @@ bool ChannelData::ProcessResolverResultLocked(
chand->saved_service_config_);
}
UniquePtr<char> processed_lb_policy_name;
chand->ProcessLbPolicy(result, parsed_service_config,
chand->ProcessLbPolicy(*result, parsed_service_config,
&processed_lb_policy_name, lb_policy_config);
// Swap out the data used by GetChannelInfo().
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ void SubchannelNode::PopulateConnectivityState(grpc_json* json) {
if (subchannel_ == nullptr) {
state = GRPC_CHANNEL_SHUTDOWN;
} else {
state = subchannel_->CheckConnectivity(true /* inhibit_health_checking */);
state = subchannel_->CheckConnectivityState(
nullptr /* health_check_service_name */,
nullptr /* connected_subchannel */);
}
json = grpc_json_create_child(nullptr, json, "state", nullptr,
GRPC_JSON_OBJECT, false);
Expand Down
Loading

0 comments on commit e4d9b57

Please sign in to comment.