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

DEP0097 warning triggered in REPL. #34069

Closed
mkrawczuk opened this issue Jun 26, 2020 · 2 comments
Closed

DEP0097 warning triggered in REPL. #34069

mkrawczuk opened this issue Jun 26, 2020 · 2 comments
Labels
confirmed-bug Issues with confirmed bugs. repl Issues and PRs related to the REPL subsystem.

Comments

@mkrawczuk
Copy link
Contributor

What steps will reproduce the bug?

  1. Run Node REPL.
  2. Choose your favorite global object.
  3. Type it into the REPL with the dot-style property accessor like so: <global object>.
  4. Hit tab.

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior?

Deprecation warning is not shown.

What do you see instead?

Deprecation warning is shown.

./node --trace-deprecation
Welcome to Node.js v15.0.0-pre.
Type ".help" for more information.
> Array. /* hit tab */
Array.__defineGetter__      Array.__defineSetter__      Array.__lookupGetter__      Array.__lookupSetter__      Array.__proto__             Array.hasOwnProperty        Array.isPrototypeOf
Array.propertyIsEnumerable  Array.toLocaleString        Array.valueOf

Array.apply                 Array.arguments             Array.bind                  Array.call                  Array.caller                Array.constructor           Array.toString

Array.from                  Array.isArray               Array.length                Array.name                  Array.of                    Array.prototype

> Array.(node:13081) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
    at emitMakeCallbackDeprecation (domain.js:123:13)
    at Connection.topLevelDomainCallback (domain.js:134:5)
    at Connection.callbackTrampoline (internal/async_hooks.js:121:14)
    at Session.post (inspector.js:118:28)
    at internal/repl/utils.js:291:15
    at sendInspectorCommand (internal/util/inspector.js:16:12)
    at getInputPreview (internal/repl/utils.js:290:5)
    at showPreview (internal/repl/utils.js:443:5)
    at REPLServer.repl._refreshLine (internal/repl/utils.js:462:5)
    at readline.js:567:10

Additional information

This warning is triggered in several other ways in REPL. For example certain function calls can trigger it:

> child_process.execFile('vim', [], {timeout: 1});
...
> (node:14593) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
    at emitMakeCallbackDeprecation (domain.js:123:13)
    at Pipe.topLevelDomainCallback (domain.js:134:5)
    at Pipe.callbackTrampoline (internal/async_hooks.js:121:14)

It makes me believe there is a common point for whole REPL that triggers this warning. I am eager to investigate further if provided with some clues (especially on how to debug asynchronous handling in the C++ part of node).

@richardlau richardlau added the repl Issues and PRs related to the REPL subsystem. label Jun 26, 2020
@richardlau
Copy link
Member

cc @nodejs/repl

@jasnell jasnell added the confirmed-bug Issues with confirmed bugs. label Jun 26, 2020
@yashLadha
Copy link
Contributor

I find it strange though that this is happening only on the first tab and not consistently across the repl.

MylesBorins pushed a commit that referenced this issue Jul 14, 2020
646e5a4 changed the way that the domain hook callback
is called. Previously, the callback was only used in the case that
async_hooks were *not* being used (since domains already integrate
with async hooks the way they should), and the corresponding
deprecation warning also only emitted in that case.

However, that commit didn’t move that condition along when the code
was ported from C++ to JS. As a consequence, the domain hook callback
was used when it wasn’t necessary to use it, and the deprecation
warning emitted accidentally along with it.

Refs: 646e5a4#diff-9f21ce1b9d6d46fdd07b969e8a04e140L192
Refs: 646e5a4#diff-e6db408e12db906ead6ddfac3de15a6fR119
Refs: #33801 (comment)

PR-URL: #34245
Fixes: #34069
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
codebytere pushed a commit that referenced this issue Jul 14, 2020
646e5a4 changed the way that the domain hook callback
is called. Previously, the callback was only used in the case that
async_hooks were *not* being used (since domains already integrate
with async hooks the way they should), and the corresponding
deprecation warning also only emitted in that case.

However, that commit didn’t move that condition along when the code
was ported from C++ to JS. As a consequence, the domain hook callback
was used when it wasn’t necessary to use it, and the deprecation
warning emitted accidentally along with it.

Refs: 646e5a4#diff-9f21ce1b9d6d46fdd07b969e8a04e140L192
Refs: 646e5a4#diff-e6db408e12db906ead6ddfac3de15a6fR119
Refs: #33801 (comment)

PR-URL: #34245
Fixes: #34069
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
MylesBorins pushed a commit that referenced this issue Jul 16, 2020
646e5a4 changed the way that the domain hook callback
is called. Previously, the callback was only used in the case that
async_hooks were *not* being used (since domains already integrate
with async hooks the way they should), and the corresponding
deprecation warning also only emitted in that case.

However, that commit didn’t move that condition along when the code
was ported from C++ to JS. As a consequence, the domain hook callback
was used when it wasn’t necessary to use it, and the deprecation
warning emitted accidentally along with it.

Refs: 646e5a4#diff-9f21ce1b9d6d46fdd07b969e8a04e140L192
Refs: 646e5a4#diff-e6db408e12db906ead6ddfac3de15a6fR119
Refs: #33801 (comment)

PR-URL: #34245
Fixes: #34069
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
codebytere pushed a commit to codebytere/node that referenced this issue Jul 21, 2020
646e5a4 changed the way that the domain hook callback
is called. Previously, the callback was only used in the case that
async_hooks were *not* being used (since domains already integrate
with async hooks the way they should), and the corresponding
deprecation warning also only emitted in that case.

However, that commit didn’t move that condition along when the code
was ported from C++ to JS. As a consequence, the domain hook callback
was used when it wasn’t necessary to use it, and the deprecation
warning emitted accidentally along with it.

Refs: nodejs@646e5a4#diff-9f21ce1b9d6d46fdd07b969e8a04e140L192
Refs: nodejs@646e5a4#diff-e6db408e12db906ead6ddfac3de15a6fR119
Refs: nodejs#33801 (comment)

PR-URL: nodejs#34245
Fixes: nodejs#34069
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants