Revision 7734de0a
b/lib/backend.py | ||
---|---|---|
994 | 994 |
|
995 | 995 |
start = time.time() |
996 | 996 |
end = start + timeout |
997 |
sleep_time = 1
|
|
997 |
sleep_time = 5
|
|
998 | 998 |
|
999 | 999 |
tried_once = False |
1000 |
while not tried_once and time.time() < end:
|
|
1000 |
while time.time() < end: |
|
1001 | 1001 |
try: |
1002 | 1002 |
hyper.StopInstance(instance, retry=tried_once) |
1003 | 1003 |
except errors.HypervisorError, err: |
... | ... | |
1006 | 1006 |
time.sleep(sleep_time) |
1007 | 1007 |
if instance.name not in hyper.ListInstances(): |
1008 | 1008 |
break |
1009 |
if sleep_time < 5: |
|
1010 |
# 1.2 behaves particularly good for our case: |
|
1011 |
# it gives us 10 increasing steps and caps just slightly above 5 seconds |
|
1012 |
sleep_time *= 1.2 |
|
1013 | 1009 |
else: |
1014 | 1010 |
# the shutdown did not succeed |
1015 | 1011 |
logging.error("Shutdown of '%s' unsuccessful, forcing", iname) |
Also available in: Unified diff