Skip to content

Conversation

@ChrsMark
Copy link
Contributor

@ChrsMark ChrsMark commented Oct 25, 2018

closes: #58

Currently when a cgroup path is not found under a subsystem's directory
Load function will fail completely. This can be blocking when a subsystem
is taking time to update its cgroups. This commit makes Load to by-pass
any not-found subsystem returning a Cgroup containing a list of the
only-found subsystems.

cc: @crosbymichael

@ChrsMark ChrsMark force-pushed the lenient-subsystems-checking branch 2 times, most recently from 8cfd7b4 to 99a20c9 Compare October 25, 2018 10:58
@crosbymichael
Copy link
Member

Thanks, i'll try to get this reviewed today or tomorrow

return nil, err
}
// check the the subsystems still exist
for _, s := range pathers(subsystems) {
Copy link
Member

Choose a reason for hiding this comment

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

could we keep the for range the same and create a temporary var for valid subsystems? Maybe something like activeSubsystems and you append active ones instead of removing the ones that are not found from the current list? I think it would make the code simpler and explicit.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! I had the same thought but chose to go with the more "economical" way by keeping the same array.

@crosbymichael
Copy link
Member

Also, after you make the updates, do you think you could work up a test in a separate commit to verify that we handle omitting a subsystem?

@ChrsMark
Copy link
Contributor Author

@crosbymichael yes, tests need to be added on this. Another commit is coming from my friend @MichaelKatsoulis adding the tests.

@codecov-io
Copy link

codecov-io commented Oct 31, 2018

Codecov Report

Merging #63 into master will increase coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master     #63     +/-   ##
========================================
+ Coverage    13.6%   13.7%   +0.1%     
========================================
  Files          23      23             
  Lines        4528    4530      +2     
========================================
+ Hits          616     621      +5     
+ Misses       3797    3795      -2     
+ Partials      115     114      -1
Impacted Files Coverage Δ
cgroup.go 50.18% <100%> (+1.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 965bb1d...7d825b2. Read the comment docs.

@ChrsMark ChrsMark force-pushed the lenient-subsystems-checking branch from c253b52 to 5115b1f Compare October 31, 2018 09:26
@crosbymichael
Copy link
Member

@ChrsMark Thanks! The code is looking great now!

@crosbymichael
Copy link
Member

@ChrsMark when you update and add the test, can you rebase on master so that the CI runs successfully?

@ChrsMark ChrsMark force-pushed the lenient-subsystems-checking branch from 5115b1f to cc652b9 Compare November 2, 2018 08:36
Currently when a cgroup path is not found under a subsystem's directory
Load function will fail completely. This can be blocking when a subsystem
is taking time to update its cgroups. This commit makes Load to by-pass
any not-found subsystem returning a Cgroup with a list of the
only-found subsystems.

Signed-off-by: Chris Mark <[email protected]>
@ChrsMark ChrsMark force-pushed the lenient-subsystems-checking branch from cc652b9 to f6cbfb4 Compare November 2, 2018 08:39
@ChrsMark
Copy link
Contributor Author

ChrsMark commented Nov 2, 2018

@crosbymichael branch rebased on top of upstream's master and the test added. Please could you have a look?

@crosbymichael
Copy link
Member

LGTM

Thanks @ChrsMark and @MichaelKatsoulis !

Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Very strict checking of subsystems' existence while loading cgroup

5 participants