Merge branch 'stable-2.9' into stable-2.10
authorThomas Thrainer <thomasth@google.com>
Wed, 19 Feb 2014 08:21:41 +0000 (09:21 +0100)
committerThomas Thrainer <thomasth@google.com>
Wed, 19 Feb 2014 08:58:04 +0000 (09:58 +0100)
* stable-2.8
  Fix integer overflow problem in hbal
  Add missing space

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

src/Ganeti/HTools/Program/Hbal.hs
src/Ganeti/Jobs.hs

index 3fdc30a..09d611a 100644 (file)
@@ -204,7 +204,8 @@ execJobSet anno master nl il cref (js:jss) = do
   let jobs = map (\(_, idx, move, _) ->
                     map anno $ Cluster.iMoveToJob nl il idx move) js
       descr = map (\(_, idx, _, _) -> Container.nameOf il idx) js
-      logfn = putStrLn . ("Got job IDs" ++) . commaJoin . map (show . fromJobId)
+      logfn =
+        putStrLn . ("Got job IDs " ++) . commaJoin . map (show . fromJobId)
   putStrLn $ "Executing jobset for instances " ++ commaJoin descr
   jrs <- bracket (L.getClient master) L.closeClient $
          Jobs.execJobsWait jobs logfn
index 179a3a0..c9ac935 100644 (file)
@@ -70,12 +70,12 @@ waitForJobs jids client = waitForJobs' 500000 15000000
     waitForJobs' delay maxdelay = do
       -- TODO: this should use WaitForJobChange once it's available in Haskell
       -- land, instead of a fixed schedule of sleeping intervals.
-      threadDelay $ min delay maxdelay
+      threadDelay delay
       sts <- L.queryJobsStatus client jids
       case sts of
         Bad e -> return . Bad $ "Checking job status: " ++ formatError e
         Ok sts' -> if any (<= JOB_STATUS_RUNNING) sts' then
-                     waitForJobs' (delay * 2) maxdelay
+                     waitForJobs' (min (delay * 2) maxdelay) maxdelay
                    else
                      return . Ok $ zip jids sts'