Skip to content

Conversation

rane-rajasi
Copy link
Contributor

Contains:

  • Fix for bug where the last status read in CRP for an installation operation has availablePatchSummary marked as 'In Progress'.
    This was due to the status for PatchInstallationSummary in status blob. CRP considers this status as the terminal state. So once PatchInstallationSummary is marked as 'success', CRP stops polling substatus and does not wait for the implicit (or 2nd) assessment to complete, if that is pending.
    Changed the implementation to only mark PatchInstallationSummary as 'success' once the implicit assessment is completed.
    code change includes: removing substatus set to success in PatchInstaller and adding that in CoreMain after implicit assessment has competed

  • Updated error message text for when Linux agent does not support telemetry, to ensure the error object within status blob includes the complete message
    Code change in Constants.py

  • For an installation operation, adding error details in installation substatus also if assessment fails. The error within installation substatus just mentions that an error occurred due to assessment failure and to refer the assessment substatus for more details.
    Code change in CoreMain: Added a new variable to track overall installation substatus (var: overall_patch_installation_operation_successful), which includes implicit assessment, and using this to determine if failure occurred during assessment, in function update_patch_substatus_if_pending()

  • Fix for adding error details in substatus, when failure occurs during core setup.
    Code change in CoreMain: Moved execution config read above any actions and adding all setup errors in assessment substatus. For an installation operation, a generic error ~ install failed due to assessment fail will be added in installation substatus due to the change in point 3 above.

@rane-rajasi rane-rajasi requested a review from a team June 2, 2021 16:22
Comment on lines +124 to +133
def update_patch_substatus_if_pending(patch_operation_requested, overall_patch_installation_operation_successful, patch_assessment_successful, status_handler, composite_logger):
if patch_operation_requested == Constants.INSTALLATION.lower() and not overall_patch_installation_operation_successful:
if not patch_assessment_successful:
status_handler.set_current_operation(Constants.INSTALLATION)
status_handler.add_error_to_status("Installation failed due to assessment failure. Please refer the error details in assessment substatus")
status_handler.set_installation_substatus_json(status=Constants.STATUS_ERROR)
composite_logger.log_debug(' -- Persisted failed installation substatus.')
if not patch_assessment_successful:
status_handler.set_assessment_substatus_json(status=Constants.STATUS_ERROR)
composite_logger.log_debug(' -- Persisted failed assessment substatus.')
Copy link
Collaborator

@kjohn-msft kjohn-msft Jun 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would have been best encapsulated within the separate assessor and installer classes and invoked as needed. But that can't be done neatly as they may not have been initialized correctly. For completeness of positioning, it shouldn't be inside status handler as it's a level of detail that is not for status handler. It's not for CoreMain as it's usurping some logic that belongs elsewhere.

Maybe not for this PR, but consider what can be done for this.

Copy link
Collaborator

@kjohn-msft kjohn-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments inline.

Copy link
Collaborator

@kjohn-msft kjohn-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving with a minor change requested (please address).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants