Skip to content

Conversation

benank
Copy link
Contributor

@benank benank commented Jul 14, 2022

Fix for ConfigurePatching getting stuck in transitioning. ConfigurePatching would run, enable auto-assessment, and auto assessment would start but load the status file from disk. After ConfigurePatching completes, auto assessment would run but would not have updated status file information since it did not read it from disk again after ConfigurePatching updated if when it finished its operation.

@benank benank requested review from a team, kjohn-msft and rane-rajasi and removed request for a team July 14, 2022 22:03
@codecov
Copy link

codecov bot commented Jul 14, 2022

Codecov Report

Merging #154 (914f921) into master (cc08163) will increase coverage by 0.13%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #154      +/-   ##
==========================================
+ Coverage   87.28%   87.42%   +0.13%     
==========================================
  Files          48       48              
  Lines        8324     8326       +2     
==========================================
+ Hits         7266     7279      +13     
+ Misses       1058     1047      -11     
Flag Coverage Δ
python27 86.26% <100.00%> (+0.13%) ⬆️
python39 87.38% <100.00%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...core/src/service_interfaces/LifecycleManagerArc.py 67.21% <100.00%> (+0.27%) ⬆️
...re/src/service_interfaces/LifecycleManagerAzure.py 60.97% <100.00%> (+0.48%) ⬆️
src/core/src/service_interfaces/StatusHandler.py 92.23% <100.00%> (+2.75%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc08163...914f921. Read the comment docs.

# Signalling take-over of core state by auto-assessment after safety checks for any competing process
self.update_core_sequence(completed=False)
# Refresh status file in memory to be up-to-date
self.status_handler.load_status_file_components()
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Should this be done on line 120 so it is done for both cases?
  2. Should it be done in all code paths within update_core_sequence? Update_core_sequence has an early return.
  3. What about all invocations of update_core_sequence? Should it be done there as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. The second case should already have up-to-date status file information because there isn't any delay there. It isn't needed on line 120 but can be moved there.
  2. Core sequence is read at the beginning of each loop within the execution_start_check method, so it should always have up-to-date information.
  3. I don't think this is needed. It's only needed in areas of contention when there are multiple core processes running at the same time, and this is already taken care of (as mentioned above).

# Signalling take-over of core state by auto-assessment after safety checks for any competing process
self.update_core_sequence(completed=False)
# Refresh status file in memory to be up-to-date
self.status_handler.load_status_file_components()
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Test this change on a machine with Auto Patching and Auto Assessment
  2. We don't have any tests mocking Auto assessment behavior, to test this scenario. See if it's possible to add that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Tested on a machine with those attributes, works as intended.
  2. Looking into it.

Copy link
Contributor

@rane-rajasi rane-rajasi Jul 21, 2022

Choose a reason for hiding this comment

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

When testing on a machine, check/follow these:

  1. Create a VM with Auto Patching and Auto Assessment i.e. patchmode = AutomaticByPlatform and assessmentmode = AutomaticByPlatform
  2. Check if ConfigurePatching call is triggered. If not, manually invoke ConfigurePatching API. This first ConfigurePatching call should timeout.
  3. Update the code.
  4. Call ConfigurePatching again.
  5. Keep on monitoring the API result. Query ContextActivity for the second and check ConfigurePatchingSummary, it should report status as Success. This is the bug fix
  6. This part is optional and not a validation for the bug fix. In case you want to verify whether Auto Assessment completed, wait for sometime and then check auto assessment log

Copy link
Contributor

Choose a reason for hiding this comment

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

Add a task in our backlog for AutoAssessment tests

@benank benank merged commit 31c110f into master Jul 25, 2022
@benank benank deleted the bankiel-cp-status-fix branch July 25, 2022 18:25
@benank benank mentioned this pull request Jul 25, 2022
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.

3 participants