Skip to content

Thread check types#959

Merged
ssalinas merged 1 commit into
masterfrom
thread_check_fallback
May 5, 2016
Merged

Thread check types#959
ssalinas merged 1 commit into
masterfrom
thread_check_fallback

Conversation

@ssalinas
Copy link
Copy Markdown
Contributor

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 force-pushed the thread_check_fallback branch from dba4f15 to c7db9bd Compare March 21, 2016 15:29
@tpetr
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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 Compare March 21, 2016 17:37
@ssalinas
Copy link
Copy Markdown
Contributor Author

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 Compare March 22, 2016 16:08
@ssalinas ssalinas changed the title Thread check fallback Thread check types Mar 24, 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
@ssalinas ssalinas deleted the thread_check_fallback branch May 5, 2016 14:10
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.

Failed to parse cgroup information

2 participants