]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: Don't take over old pipes if they're lossy.
authorGreg Farnum <gregf@hq.newdream.net>
Tue, 28 Sep 2010 18:45:43 +0000 (11:45 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Tue, 28 Sep 2010 18:45:43 +0000 (11:45 -0700)
Fixes bug #443.

src/msg/SimpleMessenger.cc

index 7d80c8f2fb55fff8f3953fc4c01a7c86721d3d91..ddf65927347a6d7aa6b41deb3f4b302ca25a5d6a 100644 (file)
@@ -808,11 +808,14 @@ int SimpleMessenger::Pipe::accept()
   existing->stop();
   existing->unregister_pipe();
     
-  //set ourself to take over other Connection, for older messages
-  existing->connection_state->clear_pipe();
-  existing->connection_state->pipe = get();
-  existing->connection_state->put();
-  existing->connection_state = NULL;
+  if (!existing->policy.lossy) { /* if we're lossy, we can lose messages and
+                                    should let the daemon handle it itself.
+    Otherwise, take over other Connection so we don't lose older messages */
+    existing->connection_state->clear_pipe();
+    existing->connection_state->pipe = get();
+    existing->connection_state->put();
+    existing->connection_state = NULL;
+  }
 
  open:
   // open