Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deadlock in standalone mcrouter on invalid config #455

Closed
Closed
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
18 changes: 9 additions & 9 deletions mcrouter/Server-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,6 @@ bool runServerDual(
auto evbs = extractEvbs(*ioThreadPool);
CHECK_EQ(evbs.size(), mcrouterOpts.num_proxies);

// Create AsyncMcServer instance
asyncMcServer =
std::make_shared<AsyncMcServer>(detail::createAsyncMcServerOptions(
mcrouterOpts, standaloneOpts, &evbs));

// Create CarbonRouterInstance
if (standaloneOpts.remote_thread) {
router =
Expand All @@ -328,6 +323,11 @@ bool runServerDual(
return false;
}

// Create AsyncMcServer instance
asyncMcServer =
std::make_shared<AsyncMcServer>(detail::createAsyncMcServerOptions(
mcrouterOpts, standaloneOpts, &evbs));

setupRouter<RouterInfo>(mcrouterOpts, standaloneOpts, router, preRunCb);

// Create CarbonRouterClients for each worker thread
Expand Down Expand Up @@ -515,10 +515,6 @@ bool runServer(
// Get EVB of main thread
auto localEvb = ioThreadPool->getEventBaseManager()->getEventBase();

asyncMcServer =
std::make_shared<AsyncMcServer>(detail::createAsyncMcServerOptions(
mcrouterOpts, standaloneOpts, &evbs));

if (standaloneOpts.remote_thread) {
router =
CarbonRouterInstance<RouterInfo>::init("standalone", mcrouterOpts);
Expand All @@ -531,6 +527,10 @@ bool runServer(
return false;
}

asyncMcServer =
std::make_shared<AsyncMcServer>(detail::createAsyncMcServerOptions(
mcrouterOpts, standaloneOpts, &evbs));

setupRouter<RouterInfo>(mcrouterOpts, standaloneOpts, router, preRunCb);

auto shutdownStarted = std::make_shared<std::atomic<bool>>(false);
Expand Down
Loading