}
ldout(async_msgr->cct, 0) << __func__ << "accept connect_seq " << connect.connect_seq
- << " vs existing " << existing->connect_seq
- << " state " << existing->state << dendl;
+ << " vs existing " << existing->connect_seq
+ << " state " << existing->state << dendl;
if (connect.connect_seq == 0 && existing->connect_seq > 0) {
ldout(async_msgr->cct,0) << __func__ << " accept peer reset, then tried to connect to us, replacing" << dendl;
ldout(cct,20) << __func__ << ": stopped processor thread" << dendl;
// close all connections
- lock.Lock();
- {
- ldout(cct, 10) << __func__ << ": closing connections" << dendl;
-
- while (!conns.empty()) {
- ceph::unordered_map<entity_addr_t, AsyncConnectionRef>::iterator it = conns.begin();
- AsyncConnectionRef p = it->second;
- ldout(cct, 5) << __func__ << " " << it->first << " " << p << dendl;
- conns.erase(it);
- p->mark_down();
- ms_deliver_handle_reset(p.get());
- }
- }
- lock.Unlock();
+ mark_down_all();
ldout(cct, 10) << __func__ << ": done." << dendl;
ldout(cct, 1) << __func__ << " complete." << dendl;
while (!conns.empty()) {
ceph::unordered_map<entity_addr_t, AsyncConnectionRef>::iterator it = conns.begin();
AsyncConnectionRef p = it->second;
- ldout(cct, 5) << __func__ << " " << it->first << " " << p << dendl;
+ ldout(cct, 5) << __func__ << " mark down " << it->first << " " << p << dendl;
conns.erase(it);
p->mark_down();
ms_deliver_handle_reset(p.get());
}
+
+ while (!deleted_conns.empty()) {
+ set<AsyncConnectionRef>::iterator it = deleted_conns.begin();
+ AsyncConnectionRef p = *it;
+ ldout(cct, 5) << __func__ << " delete " << p << dendl;
+ p->put();
+ deleted_conns.erase(it);
+ }
lock.Unlock();
}