-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
lib: add trace-sigint APIs #59040
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
lib: add trace-sigint APIs #59040
Conversation
d3eadac to
e8583be
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #59040 +/- ##
==========================================
- Coverage 89.91% 89.91% -0.01%
==========================================
Files 655 656 +1
Lines 192828 192860 +32
Branches 37805 37821 +16
==========================================
+ Hits 173385 173411 +26
- Misses 12029 12035 +6
Partials 7414 7414
🚀 New features to boost your workflow:
|
|
@legendecas Hi ! Could you help review this PR ? Thanks ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a strong opinion but maybe these two methods can be merged into process.setTraceSigIntEnabled(enabled).
e8583be to
034cd81
Compare
|
Thanks, i have updated the API to |
doc/api/process.md
Outdated
|
|
||
| * `enable` {boolean} | ||
|
|
||
| Enable or disable printing a stack trace on `SIGINT`. The API is only available on the main thread. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as a general rule I'm fairly reluctant to add new APIs to process. Could this be an environment variable instead? Specifically, why does this need to be an API? Not blocking, just wanting to understand the use case more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the APM scenario, we can not set the --trace-sigint flag for user at startup. So need a API which can be called at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be added to util instead? Like I said, I'm always a bit reluctant to add new APIs to the process global.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like signal related APIs are already on process. So it might not hurt to have another signal API on process... But I don't feel strongly about this.
f4aebda to
450d165
Compare
|
The test is failing on windows. |
450d165 to
8ec2621
Compare
8ec2621 to
2cdca4e
Compare
|
Landed in b87312b |
PR-URL: #59040 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
PR-URL: #59040 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

trace-sigintcommand line option is useful for debugging the busy code, expose it as API for using at runtime, such as APM SDK.make -j4 test(UNIX), orvcbuild test(Windows) passes