From 02101db088f86076d99664d449813483b82509f2 Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Mon, 7 Oct 2013 15:37:34 -0400 Subject: [PATCH 1/2] Raise timeout for pypo->liquidsoap communication to improve reliability under load --- python_apps/pypo/timeout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_apps/pypo/timeout.py b/python_apps/pypo/timeout.py index e6e0ace75..1b0d8dc2f 100644 --- a/python_apps/pypo/timeout.py +++ b/python_apps/pypo/timeout.py @@ -30,7 +30,7 @@ def __timeout(func, timeout_duration, default, args, kwargs): first_attempt = False -def ls_timeout(f, timeout=4, default=None): +def ls_timeout(f, timeout=15, default=None): def new_f(*args, **kwargs): return __timeout(f, timeout, default, args, kwargs) return new_f From f34a6d201a6dd818ac1f17662d89f551400b880a Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Mon, 7 Oct 2013 15:39:14 -0400 Subject: [PATCH 2/2] Double the pypo->liquidsoap timeout on second attempt if first attempt failed --- python_apps/pypo/timeout.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python_apps/pypo/timeout.py b/python_apps/pypo/timeout.py index 1b0d8dc2f..81ec927a0 100644 --- a/python_apps/pypo/timeout.py +++ b/python_apps/pypo/timeout.py @@ -15,6 +15,8 @@ def __timeout(func, timeout_duration, default, args, kwargs): while True: it = InterruptableThread() it.start() + if not first_attempt: + timeout_duration = timeout_duration * 2 it.join(timeout_duration) if it.isAlive():