Skip to content

Commit

Permalink
check Singleton::try_get for nullptr in `CoroDNSResolver::getDNSResol…
Browse files Browse the repository at this point in the history
…verInstance`

Summary:
- during shutdown, an evb may still be running while the DNSModule singleton has been shutdown / destructed

- this fails any dns request with exception `::SHUTDOWN`

Reviewed By: jalopezsilva

Differential Revision: D51733861

fbshipit-source-id: 36eb2131924a6e2acd87b42f61900677519d1cd3
  • Loading branch information
hanidamlaj authored and facebook-github-bot committed Dec 7, 2023
1 parent 12e026a commit 022203a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proxygen/lib/dns/DNSModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace proxygen {
static folly::Singleton<DNSModule> gDNSModule;

std::shared_ptr<DNSModule> DNSModule::get() {
return folly::Singleton<DNSModule>::try_get();
return gDNSModule.try_get();
}

DNSModule::DNSModule() {
Expand Down

0 comments on commit 022203a

Please sign in to comment.