There was a strange series of crashes when retaking Pipe::lock inside
stop(). Not exactly sure why, but this simplifies locking slightly, and
behaves.
if (rank_pipe.count(addr)) {
Pipe *p = rank_pipe[addr];
dout(2) << "mark_down " << addr << " -- " << p << dendl;
+ p->unregister_pipe();
lock.Unlock();
p->lock.Lock();
p->stop();
for (unsigned i=0; i<rank.local.size(); i++)
if (rank.local[i] && rank.local[i]->get_dispatcher())
rank.local[i]->queue_reset(peer_addr, last_dest_name);
+
+ // unregister
+ lock.Unlock();
+ rank.lock.Lock();
+ unregister_pipe();
+ rank.lock.Unlock();
+ lock.Lock();
}
void Rank::Pipe::was_session_reset()
if (sd >= 0)
::close(sd);
sd = -1;
-
- // deactivate myself
- lock.Unlock();
- rank.lock.Lock();
- unregister_pipe();
- rank.lock.Unlock();
- lock.Lock();
}