Skip to content

Commit

Permalink
Throw instead of segv in external connection construction due to dest…
Browse files Browse the repository at this point in the history
…royed thread pool singleton

Reviewed By: ghostonhuang

Differential Revision: D49647234

fbshipit-source-id: 6b939b85d4171e191e92e8940793edc38ce346ee
  • Loading branch information
disylh authored and facebook-github-bot committed Sep 26, 2023
1 parent 11a1646 commit c999785
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ class Impl {
facebook::memcache::ConnectionOptions connectionOptions,
ExternalCarbonConnectionImplOptions options) {
auto pool = detail::ThreadPool::getInstance();
if (!pool) {
throw CarbonConnectionException(
"Failed to init Impl due to Singleton<ThreadPool> was destroyed!");
}

auto info = pool->createClient<Transport>(connectionOptions, options);
client_ = info.first;
Expand Down

0 comments on commit c999785

Please sign in to comment.