]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
monclient: seed RNG so we pick a random monitor
authorSage Weil <sage@newdream.net>
Fri, 9 Apr 2010 21:50:12 +0000 (14:50 -0700)
committerSage Weil <sage@newdream.net>
Fri, 9 Apr 2010 21:52:01 +0000 (14:52 -0700)
src/mon/MonClient.cc

index b129cf3d58ba8c0a7fa5c35007f21fedfc203aef..9da95d8ed75ef4a6786f023cc4947fe09d438ae7 100644 (file)
@@ -145,7 +145,6 @@ int MonClient::get_monmap_privately()
   
   int attempt = 10;
   int i = 0;
-  srand(getpid());
   
   dout(10) << "have " << monmap.epoch << dendl;
   
@@ -235,6 +234,8 @@ void MonClient::init()
   Mutex::Locker l(monc_lock);
   timer.add_event_after(10.0, new C_Tick(this));
 
+  // seed rng so we choose a different monitor each time
+  srand(getpid());
 
   auth_supported.clear();
   string str = g_conf.supported_auth;