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

Fix the threshold telemetry issue #1394

Merged
merged 2 commits into from
Nov 16, 2018
Merged

Conversation

vrdmr
Copy link
Member

@vrdmr vrdmr commented Nov 13, 2018

Description

Earlier the thresholds were being assigned during the set_cgroups_limits (and being maintained in the Cgroup class, and member of _tracked in CGroupTelemetry). The monitor thread wasn't picking up the data and we were seeing 2018/11/07 21:18:42.654547 WARNING ExtHandler Monitor: failed to collect Cgroups performance metrics: 'NoneType' object has no attribute '__getitem__'.

This change now explicitly updates the limits[cgroup_name] dictionary, which is returned by the collect_all_tracked().

Issue #1395, also does half work for #1363


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and Travis.CI is passing.

Quality of Code and Contribution Guidelines

@vrdmr vrdmr added this to the v2.2.34 milestone Nov 13, 2018
@vrdmr vrdmr self-assigned this Nov 13, 2018
Copy link
Member

@jasonzio jasonzio left a comment

Choose a reason for hiding this comment

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

This isn't the right way to fix this problem. Move computation of thresholds into the CGroup constructor, so that self.threshold is present even if CGroup.set_limits() is never called for a particular instance. That will make the original code up in CGroupsTelemetry work under all circumstance. Much smaller change, no duplication of code.

tests/common/test_cgroups.py Outdated Show resolved Hide resolved
azurelinuxagent/common/cgroups.py Outdated Show resolved Hide resolved
azurelinuxagent/common/cgroups.py Show resolved Hide resolved
@vrdmr vrdmr force-pushed the vameru-fix-telemetry-bug branch 2 times, most recently from ac3803a to 91a3371 Compare November 14, 2018 18:00
Copy link
Member

@jasonzio jasonzio left a comment

Choose a reason for hiding this comment

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

This is looking a lot better. With the suggested change to the new class constructor, I think you've got a nice solution here.

azurelinuxagent/common/cgroups.py Outdated Show resolved Hide resolved
azurelinuxagent/common/cgroups.py Outdated Show resolved Hide resolved
@vrdmr vrdmr force-pushed the vameru-fix-telemetry-bug branch 2 times, most recently from 6875558 to 133f706 Compare November 15, 2018 06:37
@vrdmr vrdmr changed the base branch from master to release-2.2.33 November 16, 2018 01:38
@vrdmr vrdmr changed the base branch from release-2.2.33 to master November 16, 2018 01:38
@vrdmr vrdmr merged commit 575c399 into Azure:master Nov 16, 2018
@vrdmr vrdmr mentioned this pull request Nov 17, 2018
6 tasks
vrdmr added a commit that referenced this pull request Nov 19, 2018
* Changed local variable name and added traceback for exthandler failures (#1392)
* Changed local variable name and added traceback
* Changing the traceback location
* Fix the threshold telemetry issue (#1394)
* Adding the get_limits call within the collect_all_tracked call
* Added tests for threshold
* Send events when extensions fail to complete operation (#1397)
* Bumping up the version to 2.2.34
@vrdmr vrdmr deleted the vameru-fix-telemetry-bug branch December 7, 2018 16:31
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