Skip to content

Commit

Permalink
Stop timeout when plugin fails
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Petr Benas committed Feb 18, 2015
1 parent e88b7f7 commit 853b67d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion smoker/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions smoker/server/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 853b67d

Please sign in to comment.