]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: fix direct send to loopback connection
authorSage Weil <sage@newdream.net>
Mon, 26 Jul 2010 22:56:33 +0000 (15:56 -0700)
committerSage Weil <sage@newdream.net>
Mon, 26 Jul 2010 22:58:54 +0000 (15:58 -0700)
If we send directly to the local/loopback connection, we need to
queue it for local delivery, not go through the usual send paths.

This fixes lost replies to messages sent to self (e.g., reply to
local anchortable).

Signed-off-by: Sage Weil <sage@newdream.net>
src/msg/SimpleMessenger.cc

index 87b9bf00893f3618f520901c66a5cf287a12e22f..3887faa77ff5b6006d8010696378d83f540561cd 100644 (file)
@@ -2341,7 +2341,10 @@ void SimpleMessenger::submit_message(Message *m, Pipe *pipe)
   }
 
   lock.Lock();
-  {
+  if (pipe == dispatch_queue.local_pipe) {
+    dout(20) << "submit_message " << *m << " local" << dendl;
+    dispatch_queue.local_delivery(m, m->get_priority());
+  } else {
     pipe->pipe_lock.Lock();
     if (pipe->state == Pipe::STATE_CLOSED) {
       dout(20) << "submit_message " << *m << " ignoring closed pipe " << pipe->peer_addr << dendl;