]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: drop unnecessary (un)locking on queuing connection events
authorSage Weil <sage@inktank.com>
Mon, 9 Jul 2012 17:05:12 +0000 (10:05 -0700)
committerSage Weil <sage@inktank.com>
Tue, 10 Jul 2012 20:30:33 +0000 (13:30 -0700)
This used to be necessary because the pipe_lock was used when queueing
the pipe in the dispatch queue.  Now that is handled by IncomingQueue's
own lock, so these can be removed.

By no longer dropping the lock, we eliminate a whole category of potential
hard-to-debug races.  (Not that any were observed, but now we dno't need to
worry about them.)

Signed-off-by: Sage Weil <sage@inktank.com>
src/msg/Pipe.cc

index 58e5c8c4b46d7011ff3f79720a7011512a3694bd..dffa914b907163fe2e7166190373e80b32c9108a 100644 (file)
@@ -860,9 +860,7 @@ int Pipe::connect()
       ldout(msgr->cct,10) << "connect success " << connect_seq << ", lossy = " << policy.lossy
               << ", features " << connection_state->get_features() << dendl;
       
-      pipe_lock.Unlock();
       msgr->dispatch_queue.queue_connect(connection_state);
-      pipe_lock.Lock();
       
       if (!reader_running) {
        ldout(msgr->cct,20) << "connect starting reader" << dendl;
@@ -1034,9 +1032,7 @@ void Pipe::fail()
 
   discard_queue();
   
-  pipe_lock.Unlock();
   msgr->dispatch_queue.queue_reset(connection_state);
-  pipe_lock.Lock();
 }
 
 void Pipe::was_session_reset()
@@ -1046,9 +1042,7 @@ void Pipe::was_session_reset()
   ldout(msgr->cct,10) << "was_session_reset" << dendl;
   discard_queue();
 
-  pipe_lock.Unlock();
   msgr->dispatch_queue.queue_remote_reset(connection_state);
-  pipe_lock.Lock();
 
   out_seq = 0;
   in_seq = 0;