]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: get_connection() is required to establish a connection if none exists.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Thu, 8 Mar 2012 00:43:04 +0000 (16:43 -0800)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Tue, 3 Apr 2012 20:11:09 +0000 (13:11 -0700)
Making an allowance for lossy server connections is silly. Just don't
ask for the Connection in that case. (There aren't any users who
rely on the previous behavior.)
Document that requirement in Messenger.h!

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/msg/Messenger.h
src/msg/SimpleMessenger.cc

index 61e35e1bff254bf2ec31a782d5a5c6069b9d9b52..40abd4b9a9dec72b8af7d374b54f6861d6007fe1 100644 (file)
@@ -251,6 +251,12 @@ protected:
   virtual void mark_disposable(Connection *con) = 0;
   virtual void mark_down_all() = 0;
 
+  /**
+   * Get the Connection object associated with a given entity. If a
+   * Connection does not exist, create one and establish a logical connection.
+   *
+   * @param dest The entity to get a connection for.
+   */
   virtual Connection *get_connection(const entity_inst_t& dest) = 0;
 
   virtual int rebind(int avoid_port) { return -EOPNOTSUPP; }
index a1e1cc4edc7991868495d841482735ec0c77999b..7e4acbfde15bcc9fce924d3a25a35e8b0c89f84e 100644 (file)
@@ -2512,16 +2512,10 @@ Connection *SimpleMessenger::get_connection(const entity_inst_t& dest)
       }
     }
     if (!pipe) {
-      Policy& policy = get_policy(dest.name.type());
-      if (policy.lossy && policy.server)
-       pipe = NULL;
-      else
-       pipe = connect_rank(dest.addr, dest.name.type());
+      pipe = connect_rank(dest.addr, dest.name.type());
     }
   }
-  if (pipe)
-    return (Connection *)pipe->connection_state->get();
-  return NULL;
+  return (Connection *)pipe->connection_state->get();
 }