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 from main loop in monitor thread #1767

Merged
merged 1 commit into from
Jan 29, 2020

Conversation

narrieta
Copy link
Member

@narrieta narrieta commented Jan 28, 2020

The monitor thread and the extension handler thread may try to update the certificates from the goal state concurrently, which can produce sporadic failures.

The main loop in monitor actually does not need to update the full goal state; the only data it needs are the container id and role config name to keep the host ga plugin up to date (to send the plugin's hearbeat).

There is a small chance of a race condition during initialization: MonitorHandler.init_protocols calls update_goal_state. I will address that issue on a separate PR.

Verified the fix manually using the debugger on a live VM.


This change is Reviewable

@codecov
Copy link

codecov bot commented Jan 28, 2020

Codecov Report

Merging #1767 into develop will decrease coverage by <.01%.
The diff coverage is 57.14%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1767      +/-   ##
===========================================
- Coverage    69.17%   69.16%   -0.01%     
===========================================
  Files           82       82              
  Lines        11726    11732       +6     
  Branches      1645     1645              
===========================================
+ Hits          8111     8114       +3     
- Misses        3263     3266       +3     
  Partials       352      352
Impacted Files Coverage Δ
azurelinuxagent/ga/monitor.py 93.91% <100%> (ø) ⬆️
azurelinuxagent/common/protocol/restapi.py 87.5% <50%> (-0.46%) ⬇️
azurelinuxagent/common/protocol/wire.py 77.77% <50%> (-0.06%) ⬇️
azurelinuxagent/common/protocol/metadata.py 53.31% <50%> (-0.03%) ⬇️

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 7692acd...dc7510c. Read the comment docs.

@narrieta narrieta merged commit bdda285 into Azure:develop Jan 29, 2020
@narrieta narrieta deleted the monitor-thread branch January 29, 2020 18:55
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