Skip to content

Commit

Permalink
Do not mark goal state as processed when goal state fails to update
Browse files Browse the repository at this point in the history
  • Loading branch information
narrieta committed Apr 27, 2022
1 parent a4836c5 commit 5870194
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions azurelinuxagent/common/protocol/goal_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _update(self, force_update):
else: # vm_settings_updated
most_recent = vm_settings

if self._extensions_goal_state is None or most_recent.created_on_timestamp > self._extensions_goal_state.created_on_timestamp:
if self._extensions_goal_state is None or most_recent.created_on_timestamp >= self._extensions_goal_state.created_on_timestamp:
self._extensions_goal_state = most_recent

#
Expand All @@ -221,7 +221,7 @@ def _update(self, force_update):
# Track goal state comes after that, the extensions will need the new certificate. The Agent needs to refresh the goal state in that
# case, to ensure it fetches the new certificate.
#
if self.extensions_goal_state.source == GoalStateSource.FastTrack:
if self._extensions_goal_state.source == GoalStateSource.FastTrack:
self._check_certificates()

def _check_certificates(self):
Expand Down
20 changes: 10 additions & 10 deletions azurelinuxagent/ga/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,19 +606,19 @@ def _processing_new_extensions_goal_state(self):
return self._goal_state is not None and egs.id != self._last_extensions_gs_id and not egs.is_outdated

def _process_goal_state(self, exthandlers_handler, remote_access_handler):
try:
protocol = exthandlers_handler.protocol

# update self._goal_state
if not self._try_update_goal_state(protocol):
# agent updates and status reporting should be done even when the goal state is not updated
self.__update_guest_agent(protocol)
self._report_status(exthandlers_handler)
return
protocol = exthandlers_handler.protocol

# check for agent updates
# update self._goal_state
if not self._try_update_goal_state(protocol):
# agent updates and status reporting should be done even when the goal state is not updated
self.__update_guest_agent(protocol)
self._report_status(exthandlers_handler)
return

# check for agent updates
self.__update_guest_agent(protocol)

try:
if self._processing_new_extensions_goal_state():
if not self._extensions_summary.converged:
message = "A new goal state was received, but not all the extensions in the previous goal state have completed: {0}".format(self._extensions_summary)
Expand Down

0 comments on commit 5870194

Please sign in to comment.