Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"all": true
},
"scripts": {
"test": "nyc gulp test",
"test": "nyc gulp test && GRPC_DNS_RESOLVER=ares nyc gulp nativeTestOnly",
"coverage": "nyc report --reporter=text-lcov | coveralls"
}
}
127 changes: 120 additions & 7 deletions packages/grpc-native-core/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,20 @@
'include_dirs': [
'deps/grpc',
'deps/grpc/include',
'deps/grpc/third_party/address_sorting/include',
'deps/grpc/third_party/cares',
'deps/grpc/third_party/cares/cares',
'deps/grpc/third_party/abseil-cpp',
'deps/grpc/third_party/nanopb'
'deps/grpc/third_party/nanopb',
],
'defines': [
'PB_FIELD_32BIT',
'GPR_BACKWARDS_COMPATIBILITY_MODE',
'GRPC_ARES=0',
'GRPC_ARES=1',
'GRPC_UV',
'GRPC_NODE_VERSION="1.22.0-dev"'
'GRPC_NODE_VERSION="1.22.0-dev"',
'CARES_STATICLIB',
'CARES_SYMBOL_HIDING'
],
'defines!': [
'OPENSSL_THREADS'
Expand Down Expand Up @@ -156,8 +161,7 @@
}],
['OS == "win"', {
"include_dirs": [
"deps/grpc/third_party/zlib",
"deps/grpc/third_party/cares/cares"
"deps/grpc/third_party/zlib"
],
"defines": [
'_WIN32_WINNT=0x0600',
Expand All @@ -177,8 +181,7 @@
]
}, { # OS != "win"
'include_dirs': [
'<(node_root_dir)/deps/zlib',
'<(node_root_dir)/deps/cares/include'
'<(node_root_dir)/deps/zlib'
]
}],
['OS == "mac"', {
Expand Down Expand Up @@ -561,6 +564,114 @@
}]
],
'targets': [
{
'target_name': 'ares',
'product_prefix': 'lib',
'type': 'static_library',
'sources': [
'deps/grpc/third_party/cares/cares/ares__close_sockets.c',
'deps/grpc/third_party/cares/cares/ares__get_hostent.c',
'deps/grpc/third_party/cares/cares/ares__read_line.c',
'deps/grpc/third_party/cares/cares/ares__timeval.c',
'deps/grpc/third_party/cares/cares/ares_cancel.c',
'deps/grpc/third_party/cares/cares/ares_create_query.c',
'deps/grpc/third_party/cares/cares/ares_data.c',
'deps/grpc/third_party/cares/cares/ares_destroy.c',
'deps/grpc/third_party/cares/cares/ares_expand_name.c',
'deps/grpc/third_party/cares/cares/ares_expand_string.c',
'deps/grpc/third_party/cares/cares/ares_fds.c',
'deps/grpc/third_party/cares/cares/ares_free_hostent.c',
'deps/grpc/third_party/cares/cares/ares_free_string.c',
'deps/grpc/third_party/cares/cares/ares_getenv.c',
'deps/grpc/third_party/cares/cares/ares_gethostbyaddr.c',
'deps/grpc/third_party/cares/cares/ares_gethostbyname.c',
'deps/grpc/third_party/cares/cares/ares_getnameinfo.c',
'deps/grpc/third_party/cares/cares/ares_getopt.c',
'deps/grpc/third_party/cares/cares/ares_getsock.c',
'deps/grpc/third_party/cares/cares/ares_init.c',
'deps/grpc/third_party/cares/cares/ares_library_init.c',
'deps/grpc/third_party/cares/cares/ares_llist.c',
'deps/grpc/third_party/cares/cares/ares_mkquery.c',
'deps/grpc/third_party/cares/cares/ares_nowarn.c',
'deps/grpc/third_party/cares/cares/ares_options.c',
'deps/grpc/third_party/cares/cares/ares_parse_a_reply.c',
'deps/grpc/third_party/cares/cares/ares_parse_aaaa_reply.c',
'deps/grpc/third_party/cares/cares/ares_parse_mx_reply.c',
'deps/grpc/third_party/cares/cares/ares_parse_naptr_reply.c',
'deps/grpc/third_party/cares/cares/ares_parse_ns_reply.c',
'deps/grpc/third_party/cares/cares/ares_parse_ptr_reply.c',
'deps/grpc/third_party/cares/cares/ares_parse_soa_reply.c',
'deps/grpc/third_party/cares/cares/ares_parse_srv_reply.c',
'deps/grpc/third_party/cares/cares/ares_parse_txt_reply.c',
'deps/grpc/third_party/cares/cares/ares_platform.c',
'deps/grpc/third_party/cares/cares/ares_process.c',
'deps/grpc/third_party/cares/cares/ares_query.c',
'deps/grpc/third_party/cares/cares/ares_search.c',
'deps/grpc/third_party/cares/cares/ares_send.c',
'deps/grpc/third_party/cares/cares/ares_strcasecmp.c',
'deps/grpc/third_party/cares/cares/ares_strdup.c',
'deps/grpc/third_party/cares/cares/ares_strerror.c',
'deps/grpc/third_party/cares/cares/ares_strsplit.c',
'deps/grpc/third_party/cares/cares/ares_timeout.c',
'deps/grpc/third_party/cares/cares/ares_version.c',
'deps/grpc/third_party/cares/cares/ares_writev.c',
'deps/grpc/third_party/cares/cares/bitncmp.c',
'deps/grpc/third_party/cares/cares/inet_net_pton.c',
'deps/grpc/third_party/cares/cares/inet_ntop.c',
'deps/grpc/third_party/cares/cares/windows_port.c',
],
'defines': [
'_GNU_SOURCE'
],
'conditions': [
['OS == "mac"', {
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.9'
},
'include_dirs': [
'deps/grpc/third_party/cares/config_darwin'
],
'defines': [
'HAVE_CONFIG_H'
]
}],
['OS == "linux"', {
'include_dirs': [
'deps/grpc/third_party/cares/config_linux'
],
'defines': [
'HAVE_CONFIG_H'
]
}],
['OS == "win"', {
'include_dirs': [
'deps/grpc/third_party/cares/config_windows'
],
'defines': [
'HAVE_CONFIG_H'
]
}]
]
},
{
'target_name': 'address_sorting',
'product_prefix': 'lib',
'type': 'static_library',
'dependencies': [
],
'sources': [
'deps/grpc/third_party/address_sorting/address_sorting.c',
'deps/grpc/third_party/address_sorting/address_sorting_posix.c',
'deps/grpc/third_party/address_sorting/address_sorting_windows.c',
],
'conditions': [
['OS == "mac"', {
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.9'
}
}]
]
},
{
'target_name': 'gpr',
'product_prefix': 'lib',
Expand Down Expand Up @@ -1009,6 +1120,8 @@
"dependencies": [
"grpc",
"gpr",
"ares",
"address_sorting"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/grpc-native-core/deps/grpc
Submodule grpc updated 91 files
+2 −0 .gitignore
+2 −0 BUILD
+2 −0 BUILD.gn
+14 −2 CMakeLists.txt
+10 −0 Makefile
+2 −0 build.yaml
+6 −4 doc/environment_variables.md
+2 −0 gRPC-C++.podspec
+4 −3 include/grpcpp/channel_impl.h
+4 −4 include/grpcpp/impl/codegen/channel_interface.h
+2 −3 include/grpcpp/impl/codegen/client_callback.h
+4 −466 include/grpcpp/impl/codegen/client_context.h
+491 −0 include/grpcpp/impl/codegen/client_context_impl.h
+8 −8 include/grpcpp/impl/codegen/client_interceptor.h
+7 −5 include/grpcpp/impl/codegen/client_unary_call.h
+2 −3 include/grpcpp/impl/codegen/completion_queue_impl.h
+5 −3 include/grpcpp/impl/codegen/rpc_service_method.h
+23 −19 include/grpcpp/impl/codegen/server_callback.h
+2 −353 include/grpcpp/impl/codegen/server_context.h
+376 −0 include/grpcpp/impl/codegen/server_context_impl.h
+8 −6 include/grpcpp/impl/codegen/server_interceptor.h
+13 −9 include/grpcpp/impl/codegen/server_interface.h
+6 −5 include/grpcpp/impl/codegen/service_type.h
+1 −1 include/grpcpp/opencensus.h
+2 −6 include/grpcpp/opencensus_impl.h
+3 −3 include/grpcpp/server_impl.h
+1 −1 src/compiler/cpp_generator.cc
+326 −101 src/core/ext/filters/client_channel/client_channel.cc
+3 −1 src/core/ext/filters/client_channel/lb_policy.h
+4 −5 src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
+23 −21 src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
+10 −14 src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
+25 −101 src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
+82 −20 src/core/ext/filters/client_channel/lb_policy/xds/xds.cc
+4 −6 src/core/ext/filters/client_channel/server_address.cc
+1 −3 src/core/ext/filters/client_channel/server_address.h
+18 −12 src/core/ext/filters/client_channel/subchannel.cc
+50 −21 src/core/ext/filters/client_channel/subchannel.h
+15 −30 src/core/ext/filters/client_channel/subchannel_interface.h
+5 −5 src/core/ext/transport/chttp2/transport/frame_data.cc
+3 −2 src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
+28 −82 src/core/lib/channel/channelz_registry.cc
+6 −26 src/core/lib/channel/channelz_registry.h
+8 −1 src/core/lib/gpr/string.cc
+6 −1 src/core/lib/gpr/string.h
+8 −0 src/core/lib/gprpp/inlined_vector.h
+38 −0 src/core/lib/gprpp/map.h
+3 −3 src/core/lib/http/httpcli.cc
+1 −1 src/core/lib/iomgr/call_combiner.cc
+1 −1 src/core/lib/iomgr/call_combiner.h
+3 −2 src/core/lib/iomgr/cfstream_handle.cc
+4 −0 src/core/lib/iomgr/cfstream_handle.h
+3 −3 src/core/lib/iomgr/ev_posix.cc
+3 −2 src/core/lib/iomgr/ev_posix.h
+2 −2 src/core/lib/iomgr/ev_windows.cc
+1 −1 src/core/lib/iomgr/lockfree_event.cc
+5 −1 src/core/lib/iomgr/port.h
+5 −6 src/core/lib/iomgr/tcp_uv.cc
+53 −7 src/core/lib/slice/slice.cc
+5 −0 src/core/lib/slice/slice_internal.h
+9 −0 src/core/lib/slice/slice_string_helpers.cc
+2 −0 src/core/lib/slice/slice_string_helpers.h
+2 −2 src/core/lib/surface/server.cc
+3 −3 src/core/lib/surface/validate_metadata.cc
+5 −0 src/core/lib/transport/metadata.cc
+1 −1 src/core/lib/transport/transport.cc
+8 −2 src/core/lib/transport/transport.h
+1 −1 src/cpp/client/channel_cc.cc
+4 −7 src/cpp/client/client_context.cc
+4 −1 src/cpp/ext/filters/census/grpc_plugin.h
+20 −18 src/cpp/server/server_context.cc
+0 −0 src/csharp/Grpc.Core.Api/Interceptors/CallInvokerExtensions.cs
+0 −0 src/csharp/Grpc.Core.Api/Interceptors/InterceptingCallInvoker.cs
+2 −0 src/csharp/Grpc.Core/ForwardedTypes.cs
+6 −6 src/csharp/Grpc.Tools/ProtoCompile.cs
+3 −3 src/objective-c/tests/InteropTests/InteropTests.m
+5 −0 src/python/grpcio/README.rst
+14 −17 src/python/grpcio/grpc/_channel.py
+4 −2 templates/CMakeLists.txt.template
+1 −1 templates/tools/dockerfile/interoptest/grpc_interop_aspnetcore/build_interop.sh.template
+6 −57 test/core/channel/channelz_registry_test.cc
+18 −0 test/core/gprpp/inlined_vector_test.cc
+47 −0 test/core/gprpp/map_test.cc
+40 −0 test/core/slice/slice_test.cc
+1 −1 test/core/util/test_lb_policies.cc
+1 −1 test/cpp/codegen/compiler_test_golden
+4 −2 test/cpp/util/cli_call.h
+1 −1 tools/dockerfile/interoptest/grpc_interop_aspnetcore/build_interop.sh
+2 −0 tools/doxygen/Doxyfile.c++
+2 −0 tools/doxygen/Doxyfile.c++.internal
+4 −0 tools/run_tests/generated/sources_and_headers.json
67 changes: 59 additions & 8 deletions packages/grpc-native-core/templates/binding.gyp.template
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,20 @@
'include_dirs': [
'deps/grpc',
'deps/grpc/include',
'deps/grpc/third_party/address_sorting/include',
'deps/grpc/third_party/cares',
'deps/grpc/third_party/cares/cares',
'deps/grpc/third_party/abseil-cpp',
'deps/grpc/third_party/nanopb'
'deps/grpc/third_party/nanopb',
],
'defines': [
'PB_FIELD_32BIT',
'GPR_BACKWARDS_COMPATIBILITY_MODE',
'GRPC_ARES=0',
'GRPC_ARES=1',
'GRPC_UV',
'GRPC_NODE_VERSION="${settings.get('node_version', settings.version)}"'
'GRPC_NODE_VERSION="${settings.get('node_version', settings.version)}"',
'CARES_STATICLIB',
'CARES_SYMBOL_HIDING'
],
'defines!': [
'OPENSSL_THREADS'
Expand Down Expand Up @@ -140,8 +145,7 @@
}],
['OS == "win"', {
"include_dirs": [
"deps/grpc/third_party/zlib",
"deps/grpc/third_party/cares/cares"
"deps/grpc/third_party/zlib"
],
"defines": [
'_WIN32_WINNT=0x0600',
Expand All @@ -161,8 +165,7 @@
]
}, { # OS != "win"
'include_dirs': [
'<(node_root_dir)/deps/zlib',
'<(node_root_dir)/deps/cares/include'
'<(node_root_dir)/deps/zlib'
]
}],
['OS == "mac"', {
Expand Down Expand Up @@ -279,8 +282,54 @@
}]
],
'targets': [
% for lib in libs:
% if lib.name == 'ares':
{
'target_name': '${lib.name}',
'product_prefix': 'lib',
'type': 'static_library',
'sources': [
% for source in lib.src:
'deps/grpc/${source}',
% endfor
],
'defines': [
'_GNU_SOURCE'
],
'conditions': [
['OS == "mac"', {
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.9'
},
'include_dirs': [
'deps/grpc/third_party/cares/config_darwin'
],
'defines': [
'HAVE_CONFIG_H'
]
}],
['OS == "linux"', {
'include_dirs': [
'deps/grpc/third_party/cares/config_linux'
],
'defines': [
'HAVE_CONFIG_H'
]
}],
['OS == "win"', {
'include_dirs': [
'deps/grpc/third_party/cares/config_windows'
],
'defines': [
'HAVE_CONFIG_H'
]
}]
]
},
% endif
% endfor
% for core in libs:
% if core.name == 'grpc':
% if core.name == 'grpc' or core.name == 'address_sorting':
% for lib in libs:
% if lib.name == core.name or (lib.name in core.transitive_deps and lib.name not in ('boringssl', 'z')):
{
Expand Down Expand Up @@ -347,6 +396,8 @@
"dependencies": [
"grpc",
"gpr",
"ares",
"address_sorting"
]
},
{
Expand Down
73 changes: 73 additions & 0 deletions packages/grpc-native-core/test/resolver_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
*
* Copyright 2019 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.
*
*/

'use strict';

var assert = require('assert');
var _ = require('lodash');

var grpc = require('..');

const insecureCreds = grpc.credentials.createInsecure();

describe('Name resolver', function() {
let server;
let port;
before(function(done) {
const insecureServerCreds = grpc.ServerCredentials.createInsecure();
server = new grpc.Server();
server.bindAsync('localhost:0', insecureServerCreds, (error, portVal) => {
port = portVal;
done(error);
});
});
after(function() {
server.forceShutdown();
});
// This test also seems to have problems with the native resolver on Windows
it.skip('Should resolve a target to IPv4 addresses', function(done) {
const client = new grpc.Client(`loopback4.unittest.grpc.io:${port}`, insecureCreds);
let deadline = new Date();
deadline.setSeconds(deadline.getSeconds() + 1);
client.waitForReady(deadline, (error) => {
assert.ifError(error);
done();
});
});
/* This test doesn't work with the native resolver on Windows on our test
* machines because they don't have IPv6 addresses, so Windows omits IPv6
* addresses from getaddrinfo results. */
it.skip('Should resolve a target to IPv6 addresses', function(done) {
const client = new grpc.Client(`loopback6.unittest.grpc.io:${port}`, insecureCreds);
let deadline = new Date();
deadline.setSeconds(deadline.getSeconds() + 1);
client.waitForReady(deadline, (error) => {
assert.ifError(error);
done();
});
});
it('Should resolve a target to IPv4 and IPv6 addresses', function(done) {
const client = new grpc.Client(`loopback46.unittest.grpc.io:${port}`, insecureCreds);
let deadline = new Date();
deadline.setSeconds(deadline.getSeconds() + 1);
client.waitForReady(deadline, (error) => {
assert.ifError(error);
done();
});
});
});
1 change: 1 addition & 0 deletions run-tests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ for %%v in (6 7 8 9 10 11 12) do (
call .\node_modules\.bin\gulp cleanAll || SET FAILED=1
call .\node_modules\.bin\gulp setupWindows || SET FAILED=1
call .\node_modules\.bin\gulp test || SET FAILED=1
cmd.exe /c "SET GRPC_DNS_RESOLVER=ares& call .\node_modules\.bin\gulp nativeTestOnly" || SET FAILED=1
)

node merge_kokoro_logs.js
Expand Down