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

Method fault

src/msg/async/ProtocolV1.cc:126–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void ProtocolV1::fault() {
127 ldout(cct, 20) << __func__ << dendl;
128
129 if (state == CLOSED || state == NONE) {
130 ldout(cct, 10) << __func__ << " connection is already closed" << dendl;
131 return;
132 }
133
134 if (connection->policy.lossy && state != START_CONNECT &&
135 state != CONNECTING) {
136 ldout(cct, 1) << __func__ << " on lossy channel, failing" << dendl;
137 stop();
138 connection->dispatch_queue->queue_reset(connection);
139 return;
140 }
141
142 connection->write_lock.lock();
143 can_write = WriteStatus::NOWRITE;
144 is_reset_from_peer = false;
145
146 // requeue sent items
147 requeue_sent();
148
149 if (!once_ready && out_q.empty() && state >= START_ACCEPT &&
150 state <= ACCEPTING_WAIT_CONNECT_MSG_AUTH && !replacing) {
151 ldout(cct, 10) << __func__ << " with nothing to send and in the half "
152 << " accept state just closed" << dendl;
153 connection->write_lock.unlock();
154 stop();
155 connection->dispatch_queue->queue_reset(connection);
156 return;
157 }
158 replacing = false;
159
160 connection->fault();
161
162 reset_recv_state();
163
164 if (connection->policy.standby && out_q.empty() && !keepalive &&
165 state != WAIT) {
166 ldout(cct, 10) << __func__ << " with nothing to send, going to standby"
167 << dendl;
168 state = STANDBY;
169 connection->write_lock.unlock();
170 return;
171 }
172
173 connection->write_lock.unlock();
174
175 if ((state >= START_CONNECT && state <= CONNECTING_SEND_CONNECT_MSG) ||
176 state == WAIT) {
177 // backoff!
178 if (state == WAIT) {
179 backoff.set_from_double(cct->_conf->ms_max_backoff);
180 } else if (backoff == utime_t()) {
181 backoff.set_from_double(cct->_conf->ms_initial_backoff);
182 } else {
183 backoff += backoff;

Callers

nothing calls this directly

Calls 12

queue_resetMethod · 0.80
set_from_doubleMethod · 0.80
create_time_eventMethod · 0.80
to_nsecMethod · 0.80
stopFunction · 0.50
utime_tClass · 0.50
lockMethod · 0.45
emptyMethod · 0.45
unlockMethod · 0.45
get_global_seqMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected