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

src: fix negative nodeTiming milestone values #46588

Closed
wants to merge 2 commits into from

Conversation

legendecas
Copy link
Member

@legendecas legendecas commented Feb 9, 2023

Although the performance.timeOrigin is a Web API, Node.js specific extension performance.nodeTiming exposes the process performance milestones in the main thread and the worker threads. In order to avoid exposing negative values in performance.nodeTiming, set the performance.timeOrigin to the start time of the process both in the main thread and worker threads.

Refs: #43781
Fixes #45958, with regression test cases.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Feb 9, 2023
@legendecas
Copy link
Member Author

#43781 didn't land on v14.x and v16.x, so this fix doesn't need to land on v14.x and v16.x too.

src/env.h Outdated Show resolved Hide resolved
@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 20, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 20, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 27, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 27, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@legendecas
Copy link
Member Author

Fixed the test failure with tools/run-worker.js.

legendecas added a commit that referenced this pull request Mar 2, 2023
PR-URL: #46588
Fixes: #45958
Refs: #43781
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
@legendecas
Copy link
Member Author

Landed in a8c3d03

@legendecas legendecas closed this Mar 2, 2023
@legendecas legendecas deleted the perf_hooks/time_origin branch March 2, 2023 16:22
targos pushed a commit that referenced this pull request Mar 13, 2023
PR-URL: #46588
Fixes: #45958
Refs: #43781
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
targos pushed a commit that referenced this pull request Mar 14, 2023
PR-URL: #46588
Fixes: #45958
Refs: #43781
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
@danielleadams
Copy link
Member

@legendecas this didn't land cleanly on v18.x - do you mind opening a backport PR? Thank you

@danielleadams danielleadams added the backport-requested-v18.x PRs awaiting manual backport to the v18.x-staging branch. label Apr 3, 2023
@legendecas legendecas added dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. and removed backport-requested-v18.x PRs awaiting manual backport to the v18.x-staging branch. labels Apr 3, 2023
@legendecas
Copy link
Member Author

#43781 didn't land on v18.x. I'm tagging this as https://github.com/nodejs/node/labels/dont-land-on-v18.x.

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++. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PerformanceNodeTiming of perf_hooks
6 participants