Skip to content

Commit

Permalink
Merge pull request #2611 from Azure/hotfix-2.7.1.0
Browse files Browse the repository at this point in the history
Merge hotfix 2.7.1.0 to master
  • Loading branch information
narrieta authored Jun 14, 2022
2 parents 76f769c + fed399f commit 96949f3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
9 changes: 9 additions & 0 deletions azurelinuxagent/common/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion azurelinuxagent/common/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions azurelinuxagent/ga/collect_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion azurelinuxagent/ga/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 96949f3

Please sign in to comment.