diff --git a/azurelinuxagent/common/interfaces.py b/azurelinuxagent/common/interfaces.py index d6b0753bb9..41b16e6681 100644 --- a/azurelinuxagent/common/interfaces.py +++ b/azurelinuxagent/common/interfaces.py @@ -30,6 +30,15 @@ def get_thread_name(): def run(self): raise NotImplementedError("run() not implemented") + def keep_alive(self): + """ + Returns true if the thread handler should be restarted when the thread dies + and false when it should remain dead. + + Defaults to True and can be overridden by sub-classes. + """ + return True + def is_alive(self): raise NotImplementedError("is_alive() not implemented") diff --git a/azurelinuxagent/common/version.py b/azurelinuxagent/common/version.py index 721cad6d7a..71dfe2937f 100644 --- a/azurelinuxagent/common/version.py +++ b/azurelinuxagent/common/version.py @@ -209,7 +209,7 @@ def has_logrotate(): # # When doing a release, be sure to use the actual agent version. # -AGENT_VERSION = '2.7.0.6' +AGENT_VERSION = '2.7.1.0' AGENT_LONG_VERSION = "{0}-{1}".format(AGENT_NAME, AGENT_VERSION) AGENT_DESCRIPTION = """ The Azure Linux Agent supports the provisioning and running of Linux diff --git a/azurelinuxagent/ga/collect_logs.py b/azurelinuxagent/ga/collect_logs.py index b26e260ca3..dc62fccf21 100644 --- a/azurelinuxagent/ga/collect_logs.py +++ b/azurelinuxagent/ga/collect_logs.py @@ -107,6 +107,9 @@ def __init__(self): def run(self): self.start() + def keep_alive(self): + return self.should_run + def is_alive(self): return self.event_thread.is_alive() diff --git a/azurelinuxagent/ga/update.py b/azurelinuxagent/ga/update.py index cfac6f48c1..2b0e857b43 100644 --- a/azurelinuxagent/ga/update.py +++ b/azurelinuxagent/ga/update.py @@ -421,7 +421,7 @@ def _check_daemon_running(self, debug): def _check_threads_running(self, all_thread_handlers): # Check that all the threads are still running for thread_handler in all_thread_handlers: - if not thread_handler.is_alive(): + if thread_handler.keep_alive() and not thread_handler.is_alive(): logger.warn("{0} thread died, restarting".format(thread_handler.get_thread_name())) thread_handler.start()