Skip to content

Commit

Permalink
Revert "Revert c-ares as the default resolvre"
Browse files Browse the repository at this point in the history
This reverts commit ca30b22.
  • Loading branch information
apolcyn committed Jan 31, 2019
1 parent 4286279 commit 139d9f6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ static grpc_address_resolver_vtable ares_resolver = {
grpc_resolve_address_ares, blocking_resolve_address_ares};

static bool should_use_ares(const char* resolver_env) {
return resolver_env != nullptr && gpr_stricmp(resolver_env, "ares") == 0;
return resolver_env == nullptr || strlen(resolver_env) == 0 ||
gpr_stricmp(resolver_env, "ares") == 0;
}

void grpc_resolver_dns_ares_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ if cur_resolver and cur_resolver != 'ares':
'needs to use GRPC_DNS_RESOLVER=ares.'))
test_runner_log('Exit 1 without running tests.')
sys.exit(1)
os.environ.update({'GRPC_DNS_RESOLVER': 'ares'})
os.environ.update({'GRPC_TRACE': 'cares_resolver'})

def wait_until_dns_server_is_up(args,
Expand Down
2 changes: 1 addition & 1 deletion test/core/client_channel/resolvers/dns_resolver_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int main(int argc, char** argv) {
test_succeeds(dns, "dns:www.google.com");
test_succeeds(dns, "dns:///www.google.com");
char* resolver_env = gpr_getenv("GRPC_DNS_RESOLVER");
if (resolver_env == nullptr || gpr_stricmp(resolver_env, "native") == 0) {
if (resolver_env != nullptr && gpr_stricmp(resolver_env, "native") == 0) {
test_fails(dns, "dns://8.8.8.8/8.8.8.8:8888");
} else {
test_succeeds(dns, "dns://8.8.8.8/8.8.8.8:8888");
Expand Down
1 change: 0 additions & 1 deletion test/cpp/naming/resolver_component_tests_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def python_args(arg_list):
'needs to use GRPC_DNS_RESOLVER=ares.'))
test_runner_log('Exit 1 without running tests.')
sys.exit(1)
os.environ.update({'GRPC_DNS_RESOLVER': 'ares'})
os.environ.update({'GRPC_TRACE': 'cares_resolver'})

def wait_until_dns_server_is_up(args,
Expand Down

0 comments on commit 139d9f6

Please sign in to comment.