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

Scope issue in distributed test server #124

Merged
merged 1 commit into from
Jul 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 18 additions & 13 deletions tests/dist/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,24 @@ int main()
faabric::transport::initGlobalMessageContext();
tests::initDistTests();

SPDLOG_INFO("Starting distributed test server on worker");
std::shared_ptr<ExecutorFactory> fac =
std::make_shared<tests::DistTestExecutorFactory>();
faabric::runner::FaabricMain m(fac);
m.startBackground();

// Note, endpoint will block until killed
SPDLOG_INFO("Starting HTTP endpoint on worker");
faabric::endpoint::FaabricEndpoint endpoint;
endpoint.start();

SPDLOG_INFO("Shutting down");
m.shutdown();
// WARNING: All 0MQ operations must be contained within their own scope so
// that all sockets are destructed before the context is closed.
{
SPDLOG_INFO("Starting distributed test server on worker");
std::shared_ptr<ExecutorFactory> fac =
std::make_shared<tests::DistTestExecutorFactory>();
faabric::runner::FaabricMain m(fac);
m.startBackground();

// Note, endpoint will block until killed
SPDLOG_INFO("Starting HTTP endpoint on worker");
faabric::endpoint::FaabricEndpoint endpoint;
endpoint.start();

SPDLOG_INFO("Shutting down");
m.shutdown();
}

faabric::transport::closeGlobalMessageContext();

return EXIT_SUCCESS;
Expand Down