]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: temp hack to keep nonce unique
authorSage Weil <sage@newdream.net>
Thu, 17 Mar 2011 18:36:54 +0000 (11:36 -0700)
committerSage Weil <sage@newdream.net>
Thu, 17 Mar 2011 18:36:54 +0000 (11:36 -0700)
Temp hack for: #877
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/msg/SimpleMessenger.cc

index 6f746d444b841b82c677062c4063afbd90079e21..0041d8c484805364fd544da80c0006ad8258409d 100644 (file)
@@ -2418,8 +2418,12 @@ int SimpleMessenger::start(bool nodaemon)
     return 0;
   }
 
-  if (!did_bind)
-    ms_addr.nonce = getpid();
+  if (!did_bind) {
+    // NOTE: this is a racy temp fix.  it's fixed for real in v0.26
+    static uint64_t instance = 0;
+    ms_addr.nonce = (uint64_t)getpid() + (instance * 1000000ull);
+    instance++;
+  }
 
   dout(1) << "messenger.start" << dendl;
   started = true;