Skip to content

doc: inspector.close undefined in worker threads - #43867

Closed
kvakil wants to merge 1 commit into
nodejs:mainfrom
kvakil:documentInspectorClose
Closed

kvakil wants to merge 1 commit into
nodejs:mainfrom
kvakil:documentInspectorClose

Conversation

@kvakil

@kvakil kvakil commented Jul 16, 2022

Copy link
Copy Markdown
Contributor

In the main thread, inspector.close is defined as process._debugEnd:

$ node -e 'console.log(require("inspector").close)'
[Function: _debugEnd]

It's not defined in worker threads:

$ node -e 'const {Worker} = require("worker_threads");new Worker("console.log(require(\"inspector\").close)", {eval: true})'
undefined

(As far as I can tell this is intentional and has existed for quite some
time.)

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to Node.js documentation. inspector Issues and PRs related to the V8 inspector protocol. labels Jul 16, 2022
In the main thread, `inspector.close` is defined as `process._debugEnd`:

```
> inspector.close
[Function: _debugEnd]
```

It's not defined in worker threads:
```
> const {Worker} = require("worker_threads");
> new Worker("console.log(require(\"inspector\").close)", {eval:true})
undefined
```

(As far as I can tell this is intentional and has existed for quite some
time.)
@kvakil
kvakil force-pushed the documentInspectorClose branch from 4754078 to 84160d3 Compare July 16, 2022 20:09
@F3n67u F3n67u added commit-queue PRs queued for automated landing through the Commit Queue. author ready PRs with CI started, the required approvals, and no outstanding review comments. labels Jul 25, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Jul 25, 2022
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/43867
FetchError: Invalid response body while trying to fetch https://api.github.com/graphql: Premature close
    at consumeBody (file:///opt/hostedtoolcache/node/16.16.0/x64/lib/node_modules/node-core-utils/node_modules/node-fetch/src/body.js:234:60)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Response.text (file:///opt/hostedtoolcache/node/16.16.0/x64/lib/node_modules/node-core-utils/node_modules/node-fetch/src/body.js:158:18)
    at async Request.json (file:///opt/hostedtoolcache/node/16.16.0/x64/lib/node_modules/node-core-utils/lib/request.js:51:18)
    at async Request.query (file:///opt/hostedtoolcache/node/16.16.0/x64/lib/node_modules/node-core-utils/lib/request.js:109:20)
    at async Request.queryAll (file:///opt/hostedtoolcache/node/16.16.0/x64/lib/node_modules/node-core-utils/lib/request.js:136:20)
    at async Request.gql (file:///opt/hostedtoolcache/node/16.16.0/x64/lib/node_modules/node-core-utils/lib/request.js:66:22)
    at async PRData.getComments (file:///opt/hostedtoolcache/node/16.16.0/x64/lib/node_modules/node-core-utils/lib/pr_data.js:97:21)
    at async Promise.all (index 2)
    at async Promise.all (index 1) {
  type: 'system',
  errno: 'ERR_STREAM_PREMATURE_CLOSE',
  code: 'ERR_STREAM_PREMATURE_CLOSE',
  erroredSysCall: undefined
}
https://github.com/nodejs/node/actions/runs/2732898901

@nodejs-github-bot nodejs-github-bot added the commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. label Jul 25, 2022
F3n67u pushed a commit that referenced this pull request Jul 25, 2022
In the main thread, `inspector.close` is defined as `process._debugEnd`:

```
> inspector.close
[Function: _debugEnd]
```

It's not defined in worker threads:
```
> const {Worker} = require("worker_threads");
> new Worker("console.log(require(\"inspector\").close)", {eval:true})
undefined
```

(As far as I can tell this is intentional and has existed for quite some
time.)

PR-URL: #43867
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
@F3n67u

F3n67u commented Jul 25, 2022

Copy link
Copy Markdown
Contributor

Landed in 9599700

@F3n67u F3n67u closed this Jul 25, 2022
@F3n67u

F3n67u commented Jul 25, 2022

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

danielleadams pushed a commit that referenced this pull request Jul 26, 2022
In the main thread, `inspector.close` is defined as `process._debugEnd`:

```
> inspector.close
[Function: _debugEnd]
```

It's not defined in worker threads:
```
> const {Worker} = require("worker_threads");
> new Worker("console.log(require(\"inspector\").close)", {eval:true})
undefined
```

(As far as I can tell this is intentional and has existed for quite some
time.)

PR-URL: #43867
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
@danielleadams danielleadams mentioned this pull request Jul 26, 2022
targos pushed a commit that referenced this pull request Jul 31, 2022
In the main thread, `inspector.close` is defined as `process._debugEnd`:

```
> inspector.close
[Function: _debugEnd]
```

It's not defined in worker threads:
```
> const {Worker} = require("worker_threads");
> new Worker("console.log(require(\"inspector\").close)", {eval:true})
undefined
```

(As far as I can tell this is intentional and has existed for quite some
time.)

PR-URL: #43867
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
targos pushed a commit that referenced this pull request Aug 1, 2022
In the main thread, `inspector.close` is defined as `process._debugEnd`:

```
> inspector.close
[Function: _debugEnd]
```

It's not defined in worker threads:
```
> const {Worker} = require("worker_threads");
> new Worker("console.log(require(\"inspector\").close)", {eval:true})
undefined
```

(As far as I can tell this is intentional and has existed for quite some
time.)

PR-URL: #43867
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. doc Issues and PRs related to Node.js documentation. inspector Issues and PRs related to the V8 inspector protocol.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants