From 3bf26b78b49992c15c9b06891c1068eb686ae783 Mon Sep 17 00:00:00 2001
From: Jakub Hradil <jkhradil@gmail.com>
Date: Thu, 1 Oct 2015 09:12:38 +0200
Subject: [PATCH] Fix migration control job hanging due to next pool not being
 set when run from schedule

---
 src/dird/migrate.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/dird/migrate.c b/src/dird/migrate.c
index a8b9d1c..cdbdf31 100644
--- a/src/dird/migrate.c
+++ b/src/dird/migrate.c
@@ -1223,6 +1223,11 @@ bool do_migration_init(JCR *jcr)
        * one to the writing SD.
        */
       jcr->remote_replicate = !is_same_storage_daemon(jcr->res.rstore, jcr->res.wstore);
+   } else {
+      /*
+       * Set next pool even for control job, otherwise it will hang waiting for max Storage jobs
+       */
+      set_migration_next_pool(jcr, &pool);
    }
 
    return true;
-- 
2.4.3

