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

Method init_monc

src/test/mon/test-mon-msg.cc:100–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98 }
99
100 int init_monc() {
101 dout(1) << __func__ << dendl;
102 ceph_assert(msg != NULL);
103 int err = monc.build_initial_monmap();
104 if (err < 0) {
105 derr << __func__ << " error building monmap: "
106 << cpp_strerror(err) << dendl;
107 return err;
108 }
109
110 monc.set_messenger(msg);
111 msg->add_dispatcher_head(&monc);
112
113 monc.set_want_keys(CEPH_ENTITY_TYPE_MON);
114 err = monc.init();
115 if (err < 0) {
116 derr << __func__ << " monc init failed: "
117 << cpp_strerror(err) << dendl;
118 goto fail;
119 }
120
121 err = monc.authenticate();
122 if (err < 0) {
123 derr << __func__ << " monc auth failed: "
124 << cpp_strerror(err) << dendl;
125 goto fail_monc;
126 }
127 monc.wait_auth_rotating(30.0);
128 monc.renew_subs();
129 dout(0) << __func__ << " finished" << dendl;
130 return 0;
131
132fail_monc:
133 derr << __func__ << " failing monc" << dendl;
134 monc.shutdown();
135fail:
136 return err;
137 }
138
139 void shutdown_messenger() {
140 dout(0) << __func__ << dendl;

Callers

nothing calls this directly

Calls 10

cpp_strerrorFunction · 0.85
build_initial_monmapMethod · 0.80
add_dispatcher_headMethod · 0.80
wait_auth_rotatingMethod · 0.80
set_messengerMethod · 0.45
set_want_keysMethod · 0.45
initMethod · 0.45
authenticateMethod · 0.45
renew_subsMethod · 0.45
shutdownMethod · 0.45

Tested by

no test coverage detected