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

[disk] another timeout on disk usage #2823

Merged
merged 1 commit into from
Sep 9, 2016
Merged

[disk] another timeout on disk usage #2823

merged 1 commit into from
Sep 9, 2016

Conversation

gmmeyer
Copy link
Contributor

@gmmeyer gmmeyer commented Sep 8, 2016

What does this PR do?

In #2714, we solved a problem with disk usage where nfs mounts would hang. In some cases, we're still seeing them hanging, because os.statvfs is being called in another place as well.

This adds a timeout wrapper to that second call, as well.

except Exception as e:
self.log.warn("Unable to get disk metrics for %s: %s", mountpoint, e)
return metrics

Copy link
Member

Choose a reason for hiding this comment

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

I believe returning an empty dictionary would cause a KeyError exception here.

Alternatively we could catch the exception within the collect_metrics_psutil method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yannmh I think you're looking at the wrong thing. These are the system.fs.inodes.* metrics. They're not referenced anywhere else.

@yannmh yannmh added this to the 5.9.0 milestone Sep 8, 2016
@yannmh yannmh self-assigned this Sep 8, 2016
@truthbk
Copy link
Member

truthbk commented Sep 9, 2016

I think @gmmeyer is right, this should not have any problems with an empty dictionary: https://github.com/DataDog/dd-agent/blob/greg/statvfs-fix/checks.d/disk.py#L184

@truthbk
Copy link
Member

truthbk commented Sep 9, 2016

Tests broke though, let's get CI back to 💯

@truthbk
Copy link
Member

truthbk commented Sep 9, 2016

Thanks @gmmeyer, this looks good to me. Can you please squash before merging? Thanks a lot. 👍

@truthbk truthbk merged commit 706e8ac into master Sep 9, 2016
@truthbk truthbk deleted the greg/statvfs-fix branch September 9, 2016 17:38
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