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

trace_events: stop tracing agent in process.exit() #18005

Closed
wants to merge 2 commits into from
Closed

trace_events: stop tracing agent in process.exit() #18005

wants to merge 2 commits into from

Conversation

AndreasMadsen
Copy link
Member

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

trace_events

@AndreasMadsen AndreasMadsen added dont-land-on-v4.x trace_events Issues and PRs related to V8, Node.js core, and userspace code trace events. labels Jan 5, 2018
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jan 5, 2018
@AndreasMadsen
Copy link
Member Author

@AndreasMadsen
Copy link
Member Author


proc.once('exit', common.mustCall(() => {
assert(common.fileExists(FILE_NAME));
fs.readFile(FILE_NAME, common.mustCall((err, data) => {
Copy link
Member

Choose a reason for hiding this comment

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

Use fs.readFileSync here, the async version is not guaranteed to complete. In fact, it probably doesn't but that goes unnoticed because the common.mustCall(...) isn't checked as you're already inside an exit handler.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a child process 'exit' event, not process.exit(). fs.readFileSync() is probably a simpler idea either way though.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is how all of the other trace-events tests work. I can change it, but at least it should be consistent.

@AndreasMadsen
Copy link
Member Author

Landed in 6aac05b

MylesBorins pushed a commit that referenced this pull request Jan 10, 2018
PR-URL: #18005
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
@MylesBorins MylesBorins mentioned this pull request Jan 10, 2018
MylesBorins pushed a commit that referenced this pull request Jan 10, 2018
PR-URL: #18005
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
gibfahn pushed a commit to gibfahn/node that referenced this pull request Jan 17, 2018
PR-URL: nodejs#18005
Backport-PR-URL: nodejs#18179
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
MylesBorins pushed a commit that referenced this pull request Jan 19, 2018
Backport-PR-URL: #18179
PR-URL: #18005
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
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++. trace_events Issues and PRs related to V8, Node.js core, and userspace code trace events.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants