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

crio status: add goroutines subcommand #8697

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

saschagrunert
Copy link
Member

@saschagrunert saschagrunert commented Oct 22, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

The subcommand can be used to query the CRI-O goroutines in the same way as writing them to disk using SIGUSR1. This also allows to query the goroutines using the HTTP endpoint:

sudo curl --unix-socket /var/run/crio/crio.sock http://crio/debug/goroutines

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

Added crio status `goroutines` subcommand and `/debug/goroutines` HTTP endpoint for printing the go routine stack.

@openshift-ci openshift-ci bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Oct 22, 2024
@openshift-ci openshift-ci bot requested review from hasan4791 and klihub October 22, 2024 07:40
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 22, 2024
@kwilczynski
Copy link
Member

We can use this to also solve the "heap dump" decable we've been having for a while now. See the following:

If we move this to a "debug" namespace, such as we have:

  • /debug/heap
  • /debug/goroutines

Then crio status could serve both nicely. Same for a curl against the endpoint.

That said, goroutines and heap dumps are available when the profiling support is enabled, why add more?

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 10.71429% with 25 lines in your changes missing coverage. Please review.

Project coverage is 46.45%. Comparing base (c7cabff) to head (2665ada).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8697      +/-   ##
==========================================
- Coverage   46.49%   46.45%   -0.04%     
==========================================
  Files         151      151              
  Lines       21956    21978      +22     
==========================================
+ Hits        10208    10210       +2     
- Misses      10684    10702      +18     
- Partials     1064     1066       +2     

@saschagrunert
Copy link
Member Author

That said, goroutines and heap dumps are available when the profiling support is enabled, why add more?

Do you suggest to not add the feature at all or should we move it just to the /debug/… endpoint?

@saschagrunert saschagrunert force-pushed the goroutine-status branch 2 times, most recently from f0ad3c0 to 45f4091 Compare October 22, 2024 15:08
@saschagrunert
Copy link
Member Author

Updated the endpoint and added an integration test.

The subcommand can be used to query the CRI-O goroutines in the same way
as writing them to disk using `SIGUSR1`. This also allows to query the
goroutines using the HTTP endpoint:

```shell
sudo curl --unix-socket /var/run/crio/crio.sock http://crio/goroutines
```

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
@kwilczynski
Copy link
Member

/retest

@kwilczynski
Copy link
Member

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 22, 2024
Copy link
Contributor

openshift-ci bot commented Oct 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kwilczynski, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 7a5f767 into cri-o:main Oct 22, 2024
80 of 82 checks passed
@saschagrunert saschagrunert deleted the goroutine-status branch October 22, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants