Add sleep to stop corosync becoming wedged during restarts

This commit is contained in:
Liam Young 2014-10-13 09:56:02 +00:00
parent d329527fa1
commit 09546b3d31
1 changed files with 4 additions and 2 deletions

View File

@ -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")