GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: add trace points to dns by chinhuang007 · Pull Request #21840 · nodejs/node

Conversation

@chinhuang007

@chinhuang007 chinhuang007 commented Jul 16, 2018

Copy link
Copy Markdown
Contributor

Add trace points to dns under node.dns category.
Emit trace events for dns operations. Use the
nestable async events instead of deprecated ones.
Include test code to verify the trace log.

Refs: #19157

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x ] tests and/or benchmarks are included
  • [x ] commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gireeshpunathil and bricss reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. labels Jul 16, 2018
addaleax
addaleax reviewed Jul 16, 2018
View reviewed changes
Comment thread src/cares_wrap.cc Outdated

@addaleax addaleax Jul 16, 2018

Copy link
Copy Markdown
Member

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.

This looks odd … this means that trace_name is initialized once and not changed afterwards? What if this function gets called with instances of QueryWrap that have different names?

I think things might end up being easier if you store the original const char* itself on the class and always pass that to the trace macros. That might require the string to be given at compile time, but I’d think that’s okay.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@chinhuang007 chinhuang007 Jul 16, 2018

Copy link
Copy Markdown
Contributor Author

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.

Thanks for pointing it out. I will need to fix it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@addaleax addaleax added the trace_events Issues and PRs related to trace events from V8, Node.js core, and user code. label Jul 16, 2018
@chinhuang007
chinhuang007 force-pushed the add_dns_trace branch from b16b527 to 1c15db6 Compare July 16, 2018 23:19
gireeshpunathil
gireeshpunathil reviewed Jul 17, 2018
View reviewed changes
Comment thread src/cares_wrap.cc Outdated

@gireeshpunathil gireeshpunathil Jul 17, 2018

Copy link
Copy Markdown
Member

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.

does this change cause any external JS API interface change? I guess not.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@addaleax addaleax Jul 17, 2018

Copy link
Copy Markdown
Member

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.

No, this is all internal.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gireeshpunathil reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread test/parallel/test-trace-events-dns.js Outdated

@gireeshpunathil gireeshpunathil Jul 17, 2018

Copy link
Copy Markdown
Member

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.

does it make sense to wrap all these callbacks into common.mustCall semantic?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@chinhuang007 chinhuang007 Jul 18, 2018

Copy link
Copy Markdown
Contributor Author

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.

Thanks for the comments. The callbacks are not significant in the trace log test case. There are existing test files that cover general dns features. The main focus here is to ensure an expected trace log is written to the trace output file. I did break the all-in-one test into individual tests so it will be easier to pinpoint the problem should an error occurs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@gireeshpunathil gireeshpunathil Jul 18, 2018

Copy link
Copy Markdown
Member

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.

makes sense, thanks. My experience showed that issues are often caught by test cases that were not designed to test such issues. Moreover the semantic which we are talking about is present in every piece of test code that has a completion handler callback. But definitely not a reason for tests to overload cases, and I am fine here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jasnell
jasnell reviewed Jul 17, 2018
View reviewed changes
Comment thread src/cares_wrap.cc Outdated

@jasnell jasnell Jul 17, 2018

Copy link
Copy Markdown
Member

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.

Let's make the category on these node.dns.native. Once we have the V8 trace instrinsic landed they will be paired up with the node.dns.js side.

Also, there's a macro to make the naming easier... e.g. TRACING_CATEGORY_NODE2(dns, native) expands to node,node.dns,node.dns.native to ensure we have a proper hierarchy.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@chinhuang007 chinhuang007 Jul 18, 2018

Copy link
Copy Markdown
Contributor Author

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.

Thanks for the comments. I changed the category to node.dns.native, also started to use TRACING_CATEGORY_NODE2(dns, native).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
addaleax
addaleax approved these changes Jul 17, 2018
View reviewed changes
Comment thread src/cares_wrap.cc Outdated

@addaleax addaleax Jul 17, 2018

Copy link
Copy Markdown
Member

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.

No, this is all internal.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gireeshpunathil reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread test/parallel/test-trace-events-dns.js Outdated

@addaleax addaleax Jul 17, 2018

Copy link
Copy Markdown
Member

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.

This test should probably go into test/internet?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@chinhuang007 chinhuang007 Jul 17, 2018

Copy link
Copy Markdown
Contributor Author

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.

Honestly I are not sure the technical differences between test/internet and test/parallel. I saw dns test code in both folders. For now, I put this under test/parallel, along with other test-trace-events-xxx test files. I don't mind to move if it should go to test/internet by definition.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@addaleax addaleax Jul 17, 2018

Copy link
Copy Markdown
Member

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.

@chinhuang007 Generally, test that reach out to random internet servers should go into test/internet – think of it as tests that could be affected by e.g. a firewall. These tests aren’t run as part of a standard make test, though.

There are DNS tests in test/parallel, but (I think) most of those use a DNS mock implementation (e.g. test/parallel/test-dns-resolveany.js) – that’s nice, because it means that the test is fully self-contained and doesn’t do any networking outside the local host, but it also comes with some overhead when writing the test.

It’s a tradeoff, and you can choose to go either route, but if you keep the test as it is, please move it. :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@chinhuang007 chinhuang007 Jul 18, 2018

Copy link
Copy Markdown
Contributor Author

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.

Okay, moved the test code to test/parallel. Thanks for your explanation!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@chinhuang007
chinhuang007 force-pushed the add_dns_trace branch 2 times, most recently from 33668dd to d7ede7a Compare July 18, 2018 00:17
jasnell
jasnell approved these changes Jul 18, 2018
View reviewed changes
gireeshpunathil
gireeshpunathil approved these changes Jul 18, 2018
View reviewed changes
cjihrig
cjihrig approved these changes Jul 19, 2018
View reviewed changes
@chinhuang007

chinhuang007 commented Jul 23, 2018

Copy link
Copy Markdown
Contributor Author

What's the next step to move it forward?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chinhuang007

chinhuang007 commented Jul 25, 2018

Copy link
Copy Markdown
Contributor Author

If no changes are needed, can someone help start the merge/land process?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Jul 25, 2018

Copy link
Copy Markdown
Member

@chinhuang007 I think this is technically ready, but /cc @joyeecheung because https://github.com/nodejs/node/pull/21939/files#diff-5a543a2c1d958ec924db11553ecfb703 also adds string identifiers to all of the different query classes

CI: https://ci.nodejs.org/job/node-test-pull-request/16004/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chinhuang007
chinhuang007 force-pushed the add_dns_trace branch 2 times, most recently from 849f83b to 128e866 Compare July 26, 2018 00:28
joyeecheung
joyeecheung reviewed Jul 26, 2018
View reviewed changes
Comment thread src/cares_wrap.cc Outdated

@joyeecheung joyeecheung Jul 26, 2018

Copy link
Copy Markdown
Member

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.

Is there a reason these are ip4 and ip6 instead of ipv4 and ipv6? (like the ones in GetHostByAddrWrap)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@chinhuang007 chinhuang007 Jul 26, 2018

Copy link
Copy Markdown
Contributor Author

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.

Thanks for catching it. Just fixed it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@joyeecheung

joyeecheung commented Jul 26, 2018

Copy link
Copy Markdown
Member

It should be orthogonal to #21939 since the naming here is for time spent on (JS-API-ish) operations (measured in microseconds) instead of internal types of chunks in memory (measured in bytes).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chinhuang007
chinhuang007 force-pushed the add_dns_trace branch 3 times, most recently from 7d401e2 to 420daf0 Compare July 27, 2018 00:04
@chinhuang007

chinhuang007 commented Jul 27, 2018

Copy link
Copy Markdown
Contributor Author

Thanks, @joyeecheung for the review and comments. I fixed a CI problem for osx. Can someone help start a new CI?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gireeshpunathil

gireeshpunathil commented Jul 27, 2018

Copy link
Copy Markdown
Member

CI: https://ci.nodejs.org/job/node-test-pull-request/16020/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joyeecheung
joyeecheung approved these changes Jul 27, 2018
View reviewed changes
@chinhuang007

chinhuang007 commented Aug 1, 2018

Copy link
Copy Markdown
Contributor Author

The CI build problem doesn't seem related this PR. Can someone start a new CI to see if the problem is repeatable?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yhwang

yhwang commented Aug 1, 2018

Copy link
Copy Markdown
Member

New CI: https://ci.nodejs.org/job/node-test-commit/20136/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chinhuang007

chinhuang007 commented Aug 6, 2018

Copy link
Copy Markdown
Contributor Author

Please let me know if anything else needs to be done before this PR can be merged/landed. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Aug 12, 2018

Copy link
Copy Markdown
Member

CI: https://ci.nodejs.org/job/node-test-pull-request/16396/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yhwang

yhwang commented Aug 16, 2018

Copy link
Copy Markdown
Member

new CI: https://ci.nodejs.org/job/node-test-pull-request/16491/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chinhuang007

chinhuang007 commented Aug 17, 2018

Copy link
Copy Markdown
Contributor Author

@jasnell Thanks for starting the CI. Somehow some tests failed on unrelated build issues. I wonder if you can help merge/land it?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@joyeecheung joyeecheung mentioned this pull request Aug 17, 2018
CI Failures: 20180817 nodejs/reliability#14
Closed
@jasnell

jasnell commented Aug 18, 2018

Copy link
Copy Markdown
Member

New CI: https://ci.nodejs.org/job/node-test-pull-request/16525/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Aug 18, 2018

Copy link
Copy Markdown
Member

Once again, CI: https://ci.nodejs.org/job/node-test-pull-request/16544/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@joyeecheung

joyeecheung commented Aug 20, 2018

Copy link
Copy Markdown
Member

This PR needs a rebase against master to avoid the git failure in the CI.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@joyeecheung joyeecheung mentioned this pull request Aug 20, 2018
CI failures: 20180820 nodejs/reliability#15
Closed
@chinhuang007
src: add trace points to dns
7ceedb9
Add trace points to dns under node.dns.native category.
Emit trace events for dns operations. Use the
nestable async events instead of deprecated ones.
Include test code to verify the trace log. The
trace name is stored as const char* class variable.
The test code is to check each operation in separate
sync processes.

Refs: nodejs#19157
@chinhuang007
chinhuang007 force-pushed the add_dns_trace branch from 60cf701 to 7ceedb9 Compare August 20, 2018 16:10
@chinhuang007

chinhuang007 commented Aug 20, 2018

Copy link
Copy Markdown
Contributor Author

Thanks for the CIs and comments. I just rebased and locally tested. Hope the next CI will be clean.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@joyeecheung

joyeecheung commented Aug 20, 2018

Copy link
Copy Markdown
Member

CI: https://ci.nodejs.org/job/node-test-pull-request/16615/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Aug 20, 2018

Copy link
Copy Markdown
Member

Only one unrelated FreeBSD failure remaining 😄

Resume build: https://ci.nodejs.org/job/node-test-pull-request/16619/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chinhuang007

chinhuang007 commented Sep 2, 2018

Copy link
Copy Markdown
Contributor Author

Just rebased and passed tests. Do we need to start a new CI, hoping no unrelated errors? Please advice what I can do to help land it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Sep 2, 2018

Copy link
Copy Markdown
Member

@chinhuang007 Sorry, all that was needed was a ping to remind us – landed in b366de5!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax closed this Sep 2, 2018
addaleax pushed a commit that referenced this pull request Sep 2, 2018
@chinhuang007 @addaleax
src: add trace points to dns
b366de5
Add trace points to dns under node.dns.native category.
Emit trace events for dns operations. Use the
nestable async events instead of deprecated ones.
Include test code to verify the trace log. The
trace name is stored as const char* class variable.
The test code is to check each operation in separate
sync processes.

Refs: #19157

PR-URL: #21840
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
@refack

refack commented Sep 3, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Since this test is in /internet/ it is not covered by our regular CI.
Daily run picked up https://ci.nodejs.org/job/node-test-commit-custom-suites/675/default/testReport/junit/(root)/test/internet_test_trace_events_dns/

Update: Fix PR #22674

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@refack refack mentioned this pull request Sep 3, 2018
test: remove common.fileExists() #22151
Closed
3 tasks done
targos pushed a commit that referenced this pull request Sep 3, 2018
@chinhuang007 @targos
src: add trace points to dns
c8e586c
Add trace points to dns under node.dns.native category.
Emit trace events for dns operations. Use the
nestable async events instead of deprecated ones.
Include test code to verify the trace log. The
trace name is stored as const char* class variable.
The test code is to check each operation in separate
sync processes.

Refs: #19157

PR-URL: #21840
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
@targos targos mentioned this pull request Sep 5, 2018
Release proposal: v10.10.0 #22716
Merged
targos pushed a commit that referenced this pull request Sep 6, 2018
@chinhuang007 @targos
src: add trace points to dns
c52d67b
Add trace points to dns under node.dns.native category.
Emit trace events for dns operations. Use the
nestable async events instead of deprecated ones.
Include test code to verify the trace log. The
trace name is stored as const char* class variable.
The test code is to check each operation in separate
sync processes.

Refs: #19157

PR-URL: #21840
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
This was referenced Sep 6, 2018
2018-09-06 Version 10.10.0 (Current) @targos beevelop/docker-android-nodejs#236
Closed
2018-09-06 Version 10.10.0 (Current) @targos beevelop/docker-nodejs#221
Closed
@vmarchaud vmarchaud mentioned this pull request Jun 6, 2019
doc: document trace-events category for dns requests #28100
Closed
3 of 4 tasks
vmarchaud added a commit to vmarchaud/node that referenced this pull request Jun 7, 2019
@vmarchaud
doc: document trace-events category for dns requests
bfeb47e
As implemented in nodejs#21840, dns can
emit trace events when the category is enabled. This PR just add
it to the documentation.
Trott pushed a commit to Trott/io.js that referenced this pull request Jun 13, 2019
@vmarchaud @Trott
doc: document trace-events category for dns requests
f7ffa52
As implemented in nodejs#21840, dns can
emit trace events when the category is enabled. This PR just add
it to the documentation.

PR-URL: nodejs#28100
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
BridgeAR pushed a commit that referenced this pull request Jun 17, 2019
@vmarchaud @BridgeAR
doc: document trace-events category for dns requests
ecb963d
As implemented in #21840, dns can
emit trace events when the category is enabled. This PR just add
it to the documentation.

PR-URL: #28100
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@addaleax addaleax addaleax approved these changes
@jasnell jasnell jasnell approved these changes
@cjihrig cjihrig cjihrig approved these changes
@joyeecheung joyeecheung joyeecheung approved these changes
@gireeshpunathil gireeshpunathil gireeshpunathil approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. trace_events Issues and PRs related to trace events from V8, Node.js core, and user code.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@chinhuang007 @addaleax @joyeecheung @gireeshpunathil @yhwang @jasnell @refack @cjihrig @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.