From 09546b3d3184ec983db6cfdf02f53679570492d2 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Mon, 13 Oct 2014 09:56:02 +0000 Subject: [PATCH] Add sleep to stop corosync becoming wedged during restarts --- hooks/hooks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hooks/hooks.py b/hooks/hooks.py index 7af963e..4dddba8 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -35,7 +35,6 @@ from charmhelpers.core.hookenv import ( from charmhelpers.core.host import ( service_stop, service_start, - service_restart, service_running, write_file, mkdir, @@ -205,8 +204,11 @@ def upgrade_charm(): def restart_corosync(): if service_running("pacemaker"): service_stop("pacemaker") - service_restart("corosync") + service_stop("corosync") + # Corosync can become wedged if restarted too quickly. Need to + # replace sleep with some science time.sleep(5) + service_start("corosync") service_start("pacemaker")