Skip to content
Merged
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
30 changes: 21 additions & 9 deletions presto-native-execution/presto_cpp/main/PrestoServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ void PrestoServer::run() {
PRESTO_STARTUP_LOG(INFO) << "Spill executor was not configured.";
}

PRESTO_STARTUP_LOG(INFO) << "Starting all periodic tasks...";
PRESTO_STARTUP_LOG(INFO) << "Starting all periodic tasks";

auto* memoryAllocator = velox::memory::memoryManager()->allocator();
auto* asyncDataCache = cache::AsyncDataCache::getInstance();
Expand Down Expand Up @@ -474,18 +474,18 @@ void PrestoServer::run() {
heartbeatManager_->stop();
}

PRESTO_SHUTDOWN_LOG(INFO) << "Stopping all periodic tasks...";
PRESTO_SHUTDOWN_LOG(INFO) << "Stopping all periodic tasks";
periodicTaskManager_->stop();

stopAdditionalPeriodicTasks();

// Destroy entities here to ensure we won't get any messages after Server
// object is gone and to have nice log in case shutdown gets stuck.
PRESTO_SHUTDOWN_LOG(INFO) << "Destroying Task Resource...";
PRESTO_SHUTDOWN_LOG(INFO) << "Destroying Task Resource";
taskResource_.reset();
PRESTO_SHUTDOWN_LOG(INFO) << "Destroying Task Manager...";
PRESTO_SHUTDOWN_LOG(INFO) << "Destroying Task Manager";
taskManager_.reset();
PRESTO_SHUTDOWN_LOG(INFO) << "Destroying HTTP Server...";
PRESTO_SHUTDOWN_LOG(INFO) << "Destroying HTTP Server";
httpServer_.reset();

unregisterConnectors();
Expand Down Expand Up @@ -863,13 +863,25 @@ std::vector<std::string> PrestoServer::registerConnectors(
void PrestoServer::unregisterConnectors() {
PRESTO_SHUTDOWN_LOG(INFO) << "Unregistering connectors";
auto connectors = facebook::velox::connector::getAllConnectors();
std::unordered_set<std::string> connectorIds;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was never populated with connector names. Hence the log at Line 869 was not printing any names.

connectorIds.reserve(connectors.size());
if (connectors.empty()) {
PRESTO_SHUTDOWN_LOG(INFO) << "No connectors to unregister";
return;
}

PRESTO_SHUTDOWN_LOG(INFO)
<< "Unregistering " << connectors.size() << " connectors";
for (const auto& connectorEntry : connectors) {
facebook::velox::connector::unregisterConnector(connectorEntry.first);
if (facebook::velox::connector::unregisterConnector(connectorEntry.first)) {
PRESTO_SHUTDOWN_LOG(INFO)
<< "Unregistered connector: " << connectorEntry.first;
} else {
PRESTO_SHUTDOWN_LOG(INFO)
<< "Unable to unregister connector: " << connectorEntry.first;
}
}

PRESTO_SHUTDOWN_LOG(INFO)
<< "Unregistered connectors: " << folly::join(',', connectorIds);
<< "Unregistered " << connectors.size() << " connectors";
}

void PrestoServer::registerShuffleInterfaceFactories() {
Expand Down