]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
monclient: time out properly from wait_auth_rotating
authorSage Weil <sage@newdream.net>
Fri, 5 Mar 2010 00:45:42 +0000 (16:45 -0800)
committerSage Weil <sage@newdream.net>
Mon, 8 Mar 2010 22:49:43 +0000 (14:49 -0800)
src/mon/MonClient.cc

index f5622aa1695c81a8eb727bea4a69d85c2fdf8415..b129cf3d58ba8c0a7fa5c35007f21fedfc203aef 100644 (file)
@@ -543,15 +543,19 @@ int MonClient::wait_auth_rotating(double timeout)
   utime_t until = g_clock.now();
   until += timeout;
 
-  if (auth->get_protocol() == CEPH_AUTH_NONE) {
+  if (auth->get_protocol() == CEPH_AUTH_NONE)
     return 0;
-  }
   
   if (!rotating_secrets)
     return 0;
 
   while (auth_principal_needs_rotating_keys(entity_name) &&
         rotating_secrets->need_new_secrets()) {
+    utime_t now = g_clock.now();
+    if (now >= until) {
+      dout(0) << "wait_auth_rotating timed out after " << timeout << dendl;
+      return -ETIMEDOUT;
+    }
     dout(10) << "wait_auth_rotating waiting (until " << until << ")" << dendl;
     auth_cond.WaitUntil(monc_lock, until);
   }