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

AllowUstoGetContainerInfoOnDocker #1135

Merged
merged 2 commits into from
Dec 11, 2019
Merged

Conversation

cecile75
Copy link
Collaborator

Tested on docker. Although "/proc/self/cgroup" file is not empty, "/proc/self/cgroup".toFile().length() returns 0
as does Files.size("/proc/self/cgroup") so we should check that the content is not empty after reading it.

Tested on docker. Although "/proc/self/cgroup" file is not empty, "/proc/self/cgroup".toFile().length() returns 0
as does Files.size("/proc/self/cgroup").
@cecile75 cecile75 requested a review from a team as a code owner December 11, 2019 13:30
Comment on lines 75 to 76
log.error("proc file is empty");
throw new IOException();
Copy link
Contributor

Choose a reason for hiding this comment

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

An empty proc file should not be an error (#1052) because some environments always have an empty proc file. I think this will work for both cases:

log.debug("Proc file is empty");
return new ContainerInfo();

Empty proc file is not an error
@randomanderson randomanderson added this to the 0.39.0 milestone Dec 11, 2019
Copy link
Contributor

@randomanderson randomanderson left a comment

Choose a reason for hiding this comment

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

👍

@cecile75 cecile75 merged commit 05d4c15 into master Dec 11, 2019
@cecile75 cecile75 deleted the cécile/ContainerInfoForDocker branch December 11, 2019 15:51
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.

None yet

2 participants