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

Thread check types #959

Merged
merged 1 commit into from May 5, 2016
Merged

Thread check types #959

merged 1 commit into from May 5, 2016

Conversation

@ssalinas
Copy link
Member

@ssalinas 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
@ssalinas ssalinas force-pushed the thread_check_fallback branch from dba4f15 to c7db9bd Mar 21, 2016
@tpetr
Copy link
Member

@tpetr 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
Copy link
Member Author

@ssalinas ssalinas commented Mar 21, 2016

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

@ssalinas ssalinas force-pushed the thread_check_fallback branch from b44ce9c to 515b982 Mar 21, 2016
@ssalinas
Copy link
Member Author

@ssalinas 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 force-pushed the thread_check_fallback branch from 515b982 to 7cc4c10 Mar 22, 2016
@ssalinas ssalinas changed the title Thread check fallback Thread check types Mar 24, 2016
@tpetr

This comment has been minimized.

Copy link
Member

@tpetr 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
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
@ssalinas ssalinas removed hs_qa labels May 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.