MCPcopy Create free account
hub / github.com/ceph/ceph / start_one

Method start_one

src/mgr/StandbyPyModules.cc:75–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void StandbyPyModules::start_one(PyModuleRef py_module)
76{
77 std::lock_guard l(lock);
78 const auto name = py_module->get_name();
79 auto standby_module = new StandbyPyModule(state, py_module, clog);
80
81 // Send all python calls down a Finisher to avoid blocking
82 // C++ code, and avoid any potential lock cycles.
83 finisher.queue(new LambdaContext([this, standby_module, name](int) {
84 int r = standby_module->load();
85 if (r != 0) {
86 derr << "Failed to run module in standby mode ('" << name << "')"
87 << dendl;
88 delete standby_module;
89 } else {
90 std::lock_guard l(lock);
91 auto em = modules.emplace(name, standby_module);
92 ceph_assert(em.second); // actually inserted
93
94 dout(4) << "Starting thread for " << name << dendl;
95 standby_module->thread.create(standby_module->get_thread_name());
96 }
97 }));
98}
99
100int StandbyPyModule::load()
101{

Callers

nothing calls this directly

Calls 6

get_nameMethod · 0.45
queueMethod · 0.45
loadMethod · 0.45
emplaceMethod · 0.45
createMethod · 0.45
get_thread_nameMethod · 0.45

Tested by

no test coverage detected