native dns resolver: fix crash bug on re-resolution (#29903)

pull/29907/head
Mark D. Roth 3 years ago committed by GitHub
parent 9269732d15
commit 4d15e256ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc

@ -76,6 +76,16 @@ class NativeClientChannelDNSResolver : public PollingResolver {
OrphanablePtr<Orphanable> StartRequest() override;
private:
// No-op request class, used so that the PollingResolver code knows
// when there is a request in flight, even if the request is not
// actually cancellable.
class Request : public Orphanable {
public:
Request() = default;
void Orphan() override {}
};
void OnResolved(
absl::StatusOr<std::vector<grpc_resolved_address>> addresses_or);
};
@ -115,8 +125,7 @@ OrphanablePtr<Orphanable> NativeClientChannelDNSResolver::StartRequest() {
gpr_log(GPR_DEBUG, "[dns_resolver=%p] starting request=%p", this,
DNSResolver::HandleToString(dns_request_handle).c_str());
}
// Not cancellable.
return nullptr;
return MakeOrphanable<Request>();
}
void NativeClientChannelDNSResolver::OnResolved(

Loading…
Cancel
Save