From 853b67dc69bd9858a7ddcd06dcc7e61e01534d38 Mon Sep 17 00:00:00 2001 From: Petr Benas Date: Wed, 18 Feb 2015 15:24:23 +0100 Subject: [PATCH] Stop timeout when plugin fails The plugin module watchdog timeout has to be stopped when module run ends with an exception. When it's not, the module together with the rest API server would be restarted after the timeout exceeds. --- smoker/client/__init__.py | 6 +++++- smoker/server/plugins/__init__.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/smoker/client/__init__.py b/smoker/client/__init__.py index a068704..5291732 100644 --- a/smoker/client/__init__.py +++ b/smoker/client/__init__.py @@ -388,7 +388,11 @@ def poll(self, uri, sleep=1): if not res: if retries == 0: - lg.error("Polling on %s failed after 3 retries" % uri) + lg.error( + "Polling on %s failed after 3 retries. This may " + "happen when a plugin died while waiting for the " + "result. Please retry and check log on the hosts if " + "it happens again." % uri) return False else: retries -= 1 diff --git a/smoker/server/plugins/__init__.py b/smoker/server/plugins/__init__.py index ef7c283..9a8cf2d 100644 --- a/smoker/server/plugins/__init__.py +++ b/smoker/server/plugins/__init__.py @@ -557,6 +557,7 @@ def run_module(self, module, **kwargs): except Exception as e: lg.error("Plugin %s: module execution failed: %s" % (self.name, e)) lg.exception(e) + signal.alarm(0) raise signal.alarm(0)