Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not update goal state when refreshing the host plugin #1741

Merged
merged 2 commits into from
Dec 27, 2019

Conversation

narrieta
Copy link
Member

@narrieta narrieta commented Dec 21, 2019

We are updating the goal state too frequently and that is part of the reason different components are getting out of sync. One of the reasons we were forcing updates of the goal state was to retry calls to the host plugin when the container id or the role config change. In this case updating the full goal state is not needed and it can actually introduce consistency issues.

The main change in this PR is to define an API specifically to update the host plugin without changing the goal state.

Other small changes are minor cleanup of the update goal state in the metadata protocol and the parse code of the goal state; I'll add comments in the PR to explain those changes.


This change is Reviewable

@codecov
Copy link

codecov bot commented Dec 21, 2019

Codecov Report

Merging #1741 into develop will increase coverage by 0.04%.
The diff coverage is 90.41%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1741      +/-   ##
===========================================
+ Coverage    68.39%   68.44%   +0.04%     
===========================================
  Files           81       81              
  Lines        11741    11734       -7     
  Branches      1648     1645       -3     
===========================================
+ Hits          8030     8031       +1     
+ Misses        3369     3362       -7     
+ Partials       342      341       -1
Impacted Files Coverage Δ
azurelinuxagent/common/protocol/metadata.py 53.37% <100%> (ø) ⬆️
azurelinuxagent/daemon/main.py 73.68% <33.33%> (+0.76%) ⬆️
azurelinuxagent/common/protocol/wire.py 76.65% <92.64%> (+0.51%) ⬆️

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 8194bbc...646ce6f. Read the comment docs.

tests/ga/test_update.py Outdated Show resolved Hide resolved
# For the use of "(?<=" "(?=" see 7.2.1 in https://docs.python.org/3.1/library/re.html
# For the use of "\g<1>" see backreferences in https://docs.python.org/3.1/library/re.html#re.sub
#
# Note that these regular expressions are not enough to _parse all valid XML documents (e.g. they do
Copy link
Member Author

Choose a reason for hiding this comment

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

typo: "_parse"

#
# Note that these regular expressions are not enough to _parse all valid XML documents (e.g. they do
# not account for metacharacters like < or > in the values) but they are good enough for the test
# data. There are some basic checks, but the functions could could not match valid XML or produce
Copy link
Member Author

Choose a reason for hiding this comment

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

typo: "could could not match" -> "may not match"

larohra
larohra previously approved these changes Dec 26, 2019
Copy link
Contributor

@larohra larohra left a comment

Choose a reason for hiding this comment

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

Minor comments but the major changes look good. Thanks for doing this change, it was much needed 👍

azurelinuxagent/common/protocol/wire.py Show resolved Hide resolved
azurelinuxagent/common/protocol/wire.py Show resolved Hide resolved
azurelinuxagent/common/protocol/wire.py Show resolved Hide resolved
tests/protocol/mockwiredata.py Show resolved Hide resolved
tests/protocol/test_wire.py Outdated Show resolved Hide resolved
vrdmr
vrdmr previously approved these changes Dec 26, 2019
Copy link
Member

@vrdmr vrdmr left a comment

Choose a reason for hiding this comment

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

minor comments. LGTM.

azurelinuxagent/common/protocol/wire.py Show resolved Hide resolved
tests/protocol/mockwiredata.py Show resolved Hide resolved
@narrieta narrieta dismissed stale reviews from vrdmr and larohra via 646ce6f December 26, 2019 21:29
Copy link
Contributor

@larohra larohra left a comment

Choose a reason for hiding this comment

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

LGTM

@narrieta narrieta merged commit b6d21d3 into Azure:develop Dec 27, 2019
@narrieta narrieta deleted the refresh_host_plugin branch December 27, 2019 00:34
@vrdmr vrdmr added this to the v2.2.46 milestone Jan 6, 2020
rjschwei pushed a commit to rjschwei/WALinuxAgent that referenced this pull request Mar 24, 2020
* Do not update goal state when refreshing the host plugin

* Fixing typos and undoing bad rename
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