This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master
in repository copr/copr.
commit d37d83209d123aec96591242b4dc4ba88f917403
Author: Pavel Raiskup <praiskup(a)redhat.com>
AuthorDate: Tue Jul 30 08:37:06 2019 +0200
backend: cleanup_vm_nova.py: give the spawner 10 minutes
---
backend/run/cleanup_vm_nova.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/backend/run/cleanup_vm_nova.py b/backend/run/cleanup_vm_nova.py
index c80c8e4..32e80db 100755
--- a/backend/run/cleanup_vm_nova.py
+++ b/backend/run/cleanup_vm_nova.py
@@ -13,6 +13,9 @@ from dateutil.parser import parse as dt_parse
import yaml
from novaclient.client import Client
+# don't kill younger VMs than this (minutes)
+SPAWN_TIMEOUT = 10
+
sys.path.append("/usr/share/copr/")
from backend.helpers import BackendConfigReader
@@ -78,7 +81,7 @@ class Cleaner(object):
def old_enough(srv):
dt_created = dt_parse(srv.created)
delta = (utc_now() - dt_created).total_seconds()
- if delta > 60 * 5: # 5 minutes
+ if delta > 60 * SPAWN_TIMEOUT:
log.debug("Server {} created {} now {}; delta: {}".format(srv,
dt_created, utc_now(), delta))
return True
return False
@@ -98,7 +101,8 @@ class Cleaner(object):
"""
Terminate
- errored VM's and
- - VM's with uptime > 5 minutes and which don't have entry in redis DB
+ - VM's with uptime > SPAWN_TIMEOUT minutes and which don't have entry
in
+ redis DB
"""
start = time.time()
log.info("Cleanup start")
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.