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

node-report: meld into core #22712

Merged
merged 3 commits into from
Jan 18, 2019
Merged

Conversation

gireeshpunathil
Copy link
Member

@gireeshpunathil gireeshpunathil commented Sep 5, 2018

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

This PR adds the the process.report tool.

  1. When enabled, node-report significantly helps root cause various types of problems, including support issues sent to the various repos of the Node.js organization

  2. The requirement of explicitly adding the dependency to node-report in users' applications often represents a blocker to adoption and thus cancels 1) benefits

No new functionalities have been added, changes that are required for melding it as a built-in capability has been affected on the module version of node-report (https://github.com/nodejs/node-report)

Changes at a glance:

  • opt-in feature for auto-generation of report through --report-events
  • APIs exposed through util module. APIs are enabled by default.
  • opt-out at configure time through --without-node-report
  • only minimal refactoring to natively merge the module
  • tests covering all the APIs and report generating events
  • a new page for node-report in the document section

Refs: #19661
Refs: #18760
Refs: nodejs/node-report#103

additional /cc

@rnchamberlain : original author of this component
@richardlau : previous work on merging this into core
@mhdawson : orignal requirement raiser through nodejs/node-report#110
@nodejs/diagnostics : in relation to nodejs/TSC#586
@jasnell @rvagg @joyeecheung : in relation to their specific requirements on interfaces /defaults (#19661)

@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Sep 5, 2018
doc/api/node_report.md Outdated Show resolved Hide resolved
AUTHORS Outdated Show resolved Hide resolved
doc/api/node_report.md Outdated Show resolved Hide resolved
doc/api/node_report.md Outdated Show resolved Hide resolved
@gireeshpunathil gireeshpunathil added c++ Issues and PRs that require attention from people who are familiar with C++. semver-minor PRs that contain new features and should be released in the next minor version. labels Sep 5, 2018
doc/api/node_report.md Outdated Show resolved Hide resolved
doc/api/node_report.md Outdated Show resolved Hide resolved
doc/api/node_report.md Outdated Show resolved Hide resolved
doc/api/util.md Outdated Show resolved Hide resolved
doc/api/util.md Outdated Show resolved Hide resolved
doc/api/util.md Outdated Show resolved Hide resolved
doc/api/util.md Outdated Show resolved Hide resolved
doc/api/util.md Outdated Show resolved Hide resolved
src/node_config.cc Outdated Show resolved Hide resolved
src/node_options.cc Outdated Show resolved Hide resolved
src/node_options.cc Outdated Show resolved Hide resolved
src/node_report_module.cc Outdated Show resolved Hide resolved
src/node_util.cc Outdated Show resolved Hide resolved
test/node-report/helper.js Outdated Show resolved Hide resolved
Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start. Needs a bit of work. Left some initial comments.

Copy link
Member

@richardlau richardlau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gireeshpunathil! Did a cursory glance over and left some comments. Will follow up with a proper technical review.

Docs should note that this feature is experimental (at least initially). I also have a preference for calling the report diagnostics report (or something similar) instead of node-report in core as I find the node- prefix redundant.

doc/api/node_report.md Outdated Show resolved Hide resolved
doc/api/util.md Outdated Show resolved Hide resolved
src/node_options.cc Outdated Show resolved Hide resolved
test/node-report/helper.js Outdated Show resolved Hide resolved
node.gyp Outdated Show resolved Hide resolved
doc/api/util.md Outdated Show resolved Hide resolved
doc/api/util.md Outdated Show resolved Hide resolved
doc/api/util.md Outdated Show resolved Hide resolved
doc/api/util.md Outdated Show resolved Hide resolved
src/node_report.h Outdated Show resolved Hide resolved
@richardlau richardlau mentioned this pull request Sep 5, 2018
4 tasks
@misterdjules
Copy link

@gireeshpunathil

Make node-report part of core runtime, to satisfy its tier1 status
on diagnostic tooling

What part of the tier1 status requires something to be part of Node.js' core?

doc/api/node_report.md Outdated Show resolved Hide resolved
doc/api/node_report.md Outdated Show resolved Hide resolved
doc/api/node_report.md Outdated Show resolved Hide resolved
src/node_report.h Outdated Show resolved Hide resolved
src/node_report.cc Outdated Show resolved Hide resolved
src/node_report_module.cc Outdated Show resolved Hide resolved
src/node_report_module.cc Outdated Show resolved Hide resolved
src/node_report_module.cc Outdated Show resolved Hide resolved
src/node_report_module.cc Outdated Show resolved Hide resolved
src/node_report_utils.cc Outdated Show resolved Hide resolved
@gireeshpunathil gireeshpunathil removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 18, 2019
@addaleax addaleax added notable-change PRs with changes that should be highlighted in changelogs. experimental Issues and PRs related to experimental features. labels Jan 19, 2019
@addaleax
Copy link
Member

For releasers: This was landed in 01cd219...55e0ad9

We also may want to add a note to the entry for the first commit in the changelog, because the commit title tells very little about the change itself.

@gireeshpunathil
Copy link
Member Author

@addaleax - thnx, can I know where? (to the bottom of 4f67973 ?) and what? (general description about the report, or the changed files, or something else?)

@addaleax
Copy link
Member

@gireeshpunathil I don’t know where – I think here is fine? And basically I’m just looking for a very short description of the commit that would fit into our one-line changelog, to explain the commit message title, e.g. (This commit adds the the process.report tool)?

@gireeshpunathil
Copy link
Member Author

added the one liner to the head or the PR description, as well as to the bottom of the main commit.

@addaleax addaleax added the report Issues and PRs related to process.report. label Jan 22, 2019
targos pushed a commit that referenced this pull request Jan 24, 2019
Make node-report part of core runtime because:

1. When enabled, node-report significantly helps root cause various
types of problems, including support issues sent to the various repos
of the Node.js organization.

2. The requirement of explicitly adding the dependency to node-report
in user applications often represents a blocker to adoption.

Major deviation from the module version of the node-report is that the
report is generated in JSON format, as opposed to human readable text.

No new functionalities have been added, changes that are required for
melding it as a built-in capability has been affected on the module
version of node-report (https://github.com/nodejs/node-report)

Co-authored-by: Bidisha Pyne <[email protected]>
Co-authored-by: Howard Hellyer <[email protected]>
Co-authored-by: Jeremiah Senkpiel <[email protected]>
Co-authored-by: Julian Alimin <[email protected]>
Co-authored-by: Lakshmi Swetha Gopireddy <[email protected]>
Co-authored-by: Manusaporn Treerungroj <[email protected]>
Co-authored-by: Michael Dawson <[email protected]>
Co-authored-by: Richard Chamberlain <[email protected]>
Co-authored-by: Richard Lau <[email protected]>
Co-authored-by: Sam Roberts <[email protected]>
Co-authored-by: Vipin Menon <[email protected]>

PR-URL: #22712
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
targos pushed a commit that referenced this pull request Jan 24, 2019
a separate section added for node-report at top level
main documentation added to doc/api/report.md
API documentation added to doc/api/process.md

PR-URL: #22712
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
targos pushed a commit that referenced this pull request Jan 24, 2019
One test per each API, so that additional tests in future are modular.
test/common/report.js contain common functions  that tests leverage.

PR-URL: #22712
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2019
MylesBorins added a commit that referenced this pull request Jan 24, 2019
Notable Changes:

* events:
  * For unhandled `error` events with an argument that is not an
    `Error` object, the resulting exeption will have more information
    about the argument.
    #25621
* child_process:
  * When the `maxBuffer` option is passed, `stdout` and `stderr` will
    be truncated rather than unavailable in case of an error.
    #24951
* policy:
  * Experimental support for module integrity checks through a manifest
    file is implemented now.
    #23834
* n-api:
  * The `napi_threadsafe_function` feature is now stable.
    #25556
* report:
  * An experimental diagnostic API for capturing process state is
    available as `process.report` and through command line flags.
    #22712
* tls:
  * `tls.connect()` takes a `timeout` option analogous to the
    `net.connect()` one.
    #25517
* worker:
  * `process.umask()` is available as a read-only function inside Worker
    threads now.
    #25526
  * An `execArgv` option that supports a subset of Node.js command line
    options is supported now.
    #25467

PR-URL: #25687
MylesBorins added a commit that referenced this pull request Jan 25, 2019
Notable Changes:

* events:
  * For unhandled `error` events with an argument that is not an
    `Error` object, the resulting exeption will have more information
    about the argument.
    #25621
* child_process:
  * When the `maxBuffer` option is passed, `stdout` and `stderr` will
    be truncated rather than unavailable in case of an error.
    #24951
* policy:
  * Experimental support for module integrity checks through a manifest
    file is implemented now.
    #23834
* n-api:
  * The `napi_threadsafe_function` feature is now stable.
    #25556
* report:
  * An experimental diagnostic API for capturing process state is
    available as `process.report` and through command line flags.
    #22712
* tls:
  * `tls.connect()` takes a `timeout` option analogous to the
    `net.connect()` one.
    #25517
* worker:
  * `process.umask()` is available as a read-only function inside Worker
    threads now.
    #25526
  * An `execArgv` option that supports a subset of Node.js command line
    options is supported now.
    #25467

PR-URL: #25687
@addaleax addaleax mentioned this pull request Feb 4, 2019
4 tasks
BethGriggs pushed a commit that referenced this pull request Feb 12, 2019
process.on('somesignal', ...) semantics expect the process to catch the
signal and invoke the associated handler. `setupSignalHandlers` perform
the additional task of preparing the libuv signal handler and associate
it with the event handler. It is possible that by the time this is
setup there could be pre-existing registrations that pre-date this setup
in the boot sequence.

So rearm pre-existing signal event registrations to get upto speed.

Ref: #22712 (comment)

PR-URL: #24651
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
rvagg pushed a commit that referenced this pull request Feb 28, 2019
process.on('somesignal', ...) semantics expect the process to catch the
signal and invoke the associated handler. `setupSignalHandlers` perform
the additional task of preparing the libuv signal handler and associate
it with the event handler. It is possible that by the time this is
setup there could be pre-existing registrations that pre-date this setup
in the boot sequence.

So rearm pre-existing signal event registrations to get upto speed.

Ref: #22712 (comment)

PR-URL: #24651
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
gireeshpunathil added a commit to gireeshpunathil/diagnostics that referenced this pull request Mar 22, 2019
Remove `Node report in core` from Current list of
initiatives, as this is achieved. Report has landed.

Refs: nodejs/node#22712
gireeshpunathil added a commit to gireeshpunathil/diagnostics that referenced this pull request Mar 29, 2019
Remove `Node report in core` from Current list of
initiatives, as this is achieved. Report has landed.

Refs: nodejs/node#22712
PR-URL: nodejs#286
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. experimental Issues and PRs related to experimental features. lib / src Issues and PRs related to general changes in the lib or src directory. notable-change PRs with changes that should be highlighted in changelogs. report Issues and PRs related to process.report. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.