Loading system/gd/module.cc +2 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ Module* ModuleRegistry::Start(const ModuleFactory* module, Thread* thread) { } Module* instance = module->ctor_(); last_instance_ = "starting " + instance->ToString(); set_registry_and_handler(instance, thread); instance->ListDependencies(&instance->dependencies_); Loading @@ -99,6 +100,7 @@ void ModuleRegistry::StopAll() { for (auto it = start_order_.rbegin(); it != start_order_.rend(); it++) { auto instance = started_modules_.find(*it); ASSERT(instance != started_modules_.end()); last_instance_ = "stopping " + instance->second->ToString(); // Clear the handler before stopping the module to allow it to shut down gracefully. LOG_INFO("Stopping Handler of Module %s", instance->second->ToString().c_str()); Loading system/gd/module.h +1 −0 Original line number Diff line number Diff line Loading @@ -156,6 +156,7 @@ class ModuleRegistry { std::map<const ModuleFactory*, Module*> started_modules_; std::vector<const ModuleFactory*> start_order_; std::string last_instance_; }; class ModuleDumper { Loading system/gd/stack_manager.cc +8 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,10 @@ void StackManager::StartUp(ModuleList* modules, Thread* stack_thread) { std::move(promise))); auto init_status = future.wait_for(std::chrono::seconds(3)); ASSERT_LOG(init_status == std::future_status::ready, "Can't start stack"); ASSERT_LOG( init_status == std::future_status::ready, "Can't start stack, last instance: %s", registry_.last_instance_.c_str()); LOG_INFO("init complete"); } Loading @@ -58,7 +61,10 @@ void StackManager::ShutDown() { handler_->Post(common::BindOnce(&StackManager::handle_shut_down, common::Unretained(this), std::move(promise))); auto stop_status = future.wait_for(std::chrono::seconds(5)); ASSERT_LOG(stop_status == std::future_status::ready, "Can't stop stack"); ASSERT_LOG( stop_status == std::future_status::ready, "Can't stop stack, last instance: %s", registry_.last_instance_.c_str()); handler_->Clear(); handler_->WaitUntilStopped(std::chrono::milliseconds(2000)); Loading Loading
system/gd/module.cc +2 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ Module* ModuleRegistry::Start(const ModuleFactory* module, Thread* thread) { } Module* instance = module->ctor_(); last_instance_ = "starting " + instance->ToString(); set_registry_and_handler(instance, thread); instance->ListDependencies(&instance->dependencies_); Loading @@ -99,6 +100,7 @@ void ModuleRegistry::StopAll() { for (auto it = start_order_.rbegin(); it != start_order_.rend(); it++) { auto instance = started_modules_.find(*it); ASSERT(instance != started_modules_.end()); last_instance_ = "stopping " + instance->second->ToString(); // Clear the handler before stopping the module to allow it to shut down gracefully. LOG_INFO("Stopping Handler of Module %s", instance->second->ToString().c_str()); Loading
system/gd/module.h +1 −0 Original line number Diff line number Diff line Loading @@ -156,6 +156,7 @@ class ModuleRegistry { std::map<const ModuleFactory*, Module*> started_modules_; std::vector<const ModuleFactory*> start_order_; std::string last_instance_; }; class ModuleDumper { Loading
system/gd/stack_manager.cc +8 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,10 @@ void StackManager::StartUp(ModuleList* modules, Thread* stack_thread) { std::move(promise))); auto init_status = future.wait_for(std::chrono::seconds(3)); ASSERT_LOG(init_status == std::future_status::ready, "Can't start stack"); ASSERT_LOG( init_status == std::future_status::ready, "Can't start stack, last instance: %s", registry_.last_instance_.c_str()); LOG_INFO("init complete"); } Loading @@ -58,7 +61,10 @@ void StackManager::ShutDown() { handler_->Post(common::BindOnce(&StackManager::handle_shut_down, common::Unretained(this), std::move(promise))); auto stop_status = future.wait_for(std::chrono::seconds(5)); ASSERT_LOG(stop_status == std::future_status::ready, "Can't stop stack"); ASSERT_LOG( stop_status == std::future_status::ready, "Can't stop stack, last instance: %s", registry_.last_instance_.c_str()); handler_->Clear(); handler_->WaitUntilStopped(std::chrono::milliseconds(2000)); Loading