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

Thread check types #959

Merged
merged 1 commit into from May 5, 2016

Conversation

Projects
None yet
2 participants
@ssalinas
Member

ssalinas commented Mar 18, 2016

Although cgroup isolation is common, posix is the default. If we are not using cgroup isolation we will not find a cpu cgroup to parse and this will error every time. This PR does a few things:

  • Make two types of thread checks, CGROUP and PSTREE
  • Configurably fall back to PSTREE when CGROUP fails (defaults to false)

/fixes #741

@ssalinas ssalinas modified the milestone: 0.4.12 Mar 18, 2016

@ssalinas ssalinas added the hs_staging label Mar 21, 2016

@tpetr

This comment has been minimized.

Show comment
Hide comment
@tpetr

tpetr Mar 21, 2016

Member

I like the idea of removing the cgroups requirement for thread limiting, but our original pstree implementation wasn't great. For example:

$ pstree 91309 -p
daemon-runner(91309)───su(91330)───daemon-runner(91338)─┬─python2.6(91408)
                                                        ├─tee(91339)
                                                        └─tee(91340)

The thread checker would conclude that process 91309 is using 3 threads, when it's really using 6. Are there any other UNIX facilities we can use to figure out the thread count? Do we know what pstree is using under the hood in order to generate this info?

Member

tpetr commented Mar 21, 2016

I like the idea of removing the cgroups requirement for thread limiting, but our original pstree implementation wasn't great. For example:

$ pstree 91309 -p
daemon-runner(91309)───su(91330)───daemon-runner(91338)─┬─python2.6(91408)
                                                        ├─tee(91339)
                                                        └─tee(91340)

The thread checker would conclude that process 91309 is using 3 threads, when it's really using 6. Are there any other UNIX facilities we can use to figure out the thread count? Do we know what pstree is using under the hood in order to generate this info?

@ssalinas

This comment has been minimized.

Show comment
Hide comment
@ssalinas

ssalinas Mar 21, 2016

Member

Good, point. Let me look and see what else we could use.

Member

ssalinas commented Mar 21, 2016

Good, point. Let me look and see what else we could use.

@ssalinas

This comment has been minimized.

Show comment
Hide comment
@ssalinas

ssalinas Mar 21, 2016

Member

Updated to have three possible thread checking types:

  • cgroup
  • ps
  • /proc//status

You can now configure the primary (defaults to cgroup) and a fallback (optional). If the fallback is set, it will be used in the case that the primary type does not result in a valid value

Member

ssalinas commented Mar 21, 2016

Updated to have three possible thread checking types:

  • cgroup
  • ps
  • /proc//status

You can now configure the primary (defaults to cgroup) and a fallback (optional). If the fallback is set, it will be used in the case that the primary type does not result in a valid value

@ssalinas ssalinas added the hs_qa label Mar 21, 2016

@ssalinas ssalinas changed the title from Thread check fallback to Thread check types Mar 24, 2016

@tpetr

This comment has been minimized.

Show comment
Hide comment
@tpetr

tpetr Apr 1, 2016

Member

🚢

Member

tpetr commented on 7cc4c10 Apr 1, 2016

🚢

@ssalinas ssalinas added the hs_stable label Apr 4, 2016

@ssalinas ssalinas modified the milestones: 0.5.0, 0.6.0 Apr 5, 2016

@ssalinas ssalinas merged commit 42f88f3 into master May 5, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@ssalinas ssalinas deleted the thread_check_fallback branch May 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment