Skip to content

lib: allow process kill by signal number - #16944

Closed
sam-github wants to merge 3 commits into
nodejs:masterfrom
sam-github:kill-allow-numbers
Closed

lib: allow process kill by signal number#16944
sam-github wants to merge 3 commits into
nodejs:masterfrom
sam-github:kill-allow-numbers

Conversation

@sam-github

@sam-githubsam-github commented Nov 10, 2017

Copy link
Copy Markdown
Contributor

This brings the behaviour in line with the documentation.

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)

@nodejs-github-botnodejs-github-bot added the process Issues and PRs related to the process subsystem. label Nov 10, 2017
@sam-github

Copy link
Copy Markdown
ContributorAuthor

Comment threadlib/internal/process.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don’t you want to keep the ===?

@sam-github
sam-githubforce-pushed the kill-allow-numbers branch 2 times, most recently from f8fa77d to 823de05CompareNovember 10, 2017 22:11

@cjihrigcjihrig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM if the CI is happy. It will need restarted, as the linter failed.

@sam-github

Copy link
Copy Markdown
ContributorAuthor

Linting is fixed, build and passed locally, will wait for all the platforms to pass before restarting for an all-green run.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this can be simplified to just

common.expectsError(()=>process.kill(1,987),{code: 'EINVAL',type: Error,message: 'kill EINVAL'});

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done

@sam-github
sam-githubforce-pushed the kill-allow-numbers branch 2 times, most recently from 92235a0 to bfb2503CompareNovember 12, 2017 13:20
@sam-githubsam-github added the semver-minor PRs that contain new features and should be released in the next minor version. label Nov 12, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

common.expectsError( () => process.kill(1, 'test'), { ... }

That is, The first argument needs to be a function...

PR-URL: nodejs#16944
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This brings the behaviour in line with the documentation.
PR-URL: nodejs#16944
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@sam-github

Copy link
Copy Markdown
ContributorAuthor

@jasnell passed locally, ci running

@addaleax

Copy link
Copy Markdown
Member

@sam-github Was there a CI run associated with this?

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

@addaleaxaddaleax added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Nov 18, 2017
@addaleax

Copy link
Copy Markdown
Member

@sam-github Looks like this doesn’t work on Windows quite yet

@bzoz

bzoz commented Nov 20, 2017

Copy link
Copy Markdown
Contributor

On Windows libuv first tries to open the process handle (src/win/process.c:1246) before checking for correct signal. If the signum is invalid, it will raise ENOSYS (src/win/process.c:1215). For this test to work, we would need to change libuv, which I guess would be rather simple.

@sam-github

Copy link
Copy Markdown
ContributorAuthor

I'll take a look, should have time this week.

@BridgeARBridgeAR removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 1, 2018
@bzoz

bzoz commented Feb 1, 2018

Copy link
Copy Markdown
Contributor

There is no process with PID 1 on Windows. Change those to 0 or process.pid and it should work.

@BridgeAR

Copy link
Copy Markdown
Member

Ping @sam-github

@BridgeAR

Copy link
Copy Markdown
Member

I pushed the fix that @bzoz suggested.

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

@BridgeARBridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 17, 2018
@bzoz

bzoz commented Feb 17, 2018

Copy link
Copy Markdown
Contributor

CI failures on Windows are unrelated

@BridgeAR

Copy link
Copy Markdown
Member

Running one more CI before landing.

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

@BridgeAR

Copy link
Copy Markdown
Member

Landed in 7ca4ca8 🎉

BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Feb 17, 2018
This brings the behaviour in line with the documentation.
PR-URL: nodejs#16944
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
This brings the behaviour in line with the documentation.
PR-URL: #16944
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Feb 21, 2018
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
This brings the behaviour in line with the documentation.
PR-URL: #16944
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins added a commit that referenced this pull request Feb 21, 2018
Notable changes:
* async_hooks:
- deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
#18513
- rename PromiseWrap.parentId to PromiseWrap.isChainedPromise
(Ali Ijaz Sheikh) #18633
* deps:
- update node-inspect to 1.11.3 (Jan Krems)
#18354
- ICU 60.2 bump (Steven R. Loomis)
#17687
- Introduce ScriptOrModule and HostDefinedOptions to V8 (Jan Krems)
#16889
* http:
- add options to http.createServer() for `IncomingMessage` and
`ServerReponse` (Peter Marton)
#15752
* http2:
- add http fallback options to .createServer (Peter Marton)
#15752
* https:
- Adds the remaining options from tls.createSecureContext() to the
string generated by Agent#getName(). This allows https.request()
to accept the options and generate unique sockets appropriately.
(Jeff Principe)
#16402
* inspector:
- --inspect-brk for es modules (Guy Bedford)
#18194
* lib:
- allow process kill by signal number (Sam Roberts)
#16944
* module:
- enable dynamic import (Myles Borins)
#18387
- dynamic import is now supported (Jan Krems)
#15713
* napi:
- add methods to open/close callback scope (Michael Dawson)
#18089
* src:
- allow --perf-(basic-)?prof in NODE_OPTIONS (Leko)
#17600
* vm:
- add support for es modules (Gus Caplan)
#17560
PR-URL: #18902
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
This brings the behaviour in line with the documentation.
PR-URL: #16944
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins added a commit that referenced this pull request Feb 21, 2018
Notable changes:
* async_hooks:
- deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
#18513
- rename PromiseWrap.parentId to PromiseWrap.isChainedPromise
(Ali Ijaz Sheikh) #18633
* deps:
- update node-inspect to 1.11.3 (Jan Krems)
#18354
- ICU 60.2 bump (Steven R. Loomis)
#17687
- Introduce ScriptOrModule and HostDefinedOptions to V8 (Jan Krems)
#16889
* http:
- add options to http.createServer() for `IncomingMessage` and
`ServerReponse` (Peter Marton)
#15752
* http2:
- add http fallback options to .createServer (Peter Marton)
#15752
* https:
- Adds the remaining options from tls.createSecureContext() to the
string generated by Agent#getName(). This allows https.request()
to accept the options and generate unique sockets appropriately.
(Jeff Principe)
#16402
* inspector:
- --inspect-brk for es modules (Guy Bedford)
#18194
* lib:
- allow process kill by signal number (Sam Roberts)
#16944
* module:
- enable dynamic import (Myles Borins)
#18387
- dynamic import is now supported (Jan Krems)
#15713
* napi:
- add methods to open/close callback scope (Michael Dawson)
#18089
* src:
- allow --perf-(basic-)?prof in NODE_OPTIONS (Leko)
#17600
* vm:
- add support for es modules (Gus Caplan)
#17560
PR-URL: #18902
MylesBorins added a commit that referenced this pull request Feb 22, 2018
Notable changes:
* async_hooks:
- deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
#18513
- rename PromiseWrap.parentId to PromiseWrap.isChainedPromise
(Ali Ijaz Sheikh) #18633
* deps:
- update node-inspect to 1.11.3 (Jan Krems)
#18354
- ICU 60.2 bump (Steven R. Loomis)
#17687
- Introduce ScriptOrModule and HostDefinedOptions to V8 (Jan Krems)
#16889
* http:
- add options to http.createServer() for `IncomingMessage` and
`ServerReponse` (Peter Marton)
#15752
* http2:
- add http fallback options to .createServer (Peter Marton)
#15752
* https:
- Adds the remaining options from tls.createSecureContext() to the
string generated by Agent#getName(). This allows https.request()
to accept the options and generate unique sockets appropriately.
(Jeff Principe)
#16402
* inspector:
- --inspect-brk for es modules (Guy Bedford)
#18194
* lib:
- allow process kill by signal number (Sam Roberts)
#16944
* module:
- enable dynamic import (Myles Borins)
#18387
- dynamic import is now supported (Jan Krems)
#15713
* napi:
- add methods to open/close callback scope (Michael Dawson)
#18089
* src:
- allow --perf-(basic-)?prof in NODE_OPTIONS (Leko)
#17600
* vm:
- add support for es modules (Gus Caplan)
#17560
PR-URL: #18902
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
This brings the behaviour in line with the documentation.
PR-URL: nodejs#16944
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
Notable changes:
* async_hooks:
- deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
nodejs#18513
- rename PromiseWrap.parentId to PromiseWrap.isChainedPromise
(Ali Ijaz Sheikh) nodejs#18633
* deps:
- update node-inspect to 1.11.3 (Jan Krems)
nodejs#18354
- ICU 60.2 bump (Steven R. Loomis)
nodejs#17687
- Introduce ScriptOrModule and HostDefinedOptions to V8 (Jan Krems)
nodejs#16889
* http:
- add options to http.createServer() for `IncomingMessage` and
`ServerReponse` (Peter Marton)
nodejs#15752
* http2:
- add http fallback options to .createServer (Peter Marton)
nodejs#15752
* https:
- Adds the remaining options from tls.createSecureContext() to the
string generated by Agent#getName(). This allows https.request()
to accept the options and generate unique sockets appropriately.
(Jeff Principe)
nodejs#16402
* inspector:
- --inspect-brk for es modules (Guy Bedford)
nodejs#18194
* lib:
- allow process kill by signal number (Sam Roberts)
nodejs#16944
* module:
- enable dynamic import (Myles Borins)
nodejs#18387
- dynamic import is now supported (Jan Krems)
nodejs#15713
* napi:
- add methods to open/close callback scope (Michael Dawson)
nodejs#18089
* src:
- allow --perf-(basic-)?prof in NODE_OPTIONS (Leko)
nodejs#17600
* vm:
- add support for es modules (Gus Caplan)
nodejs#17560
PR-URL: nodejs#18902
@MylesBorins

Copy link
Copy Markdown
Contributor

Should this be backported to v8.x-staging? If yes please follow the guide and raise a backport PR, if not let me know or add the dont-land-on label.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.processIssues and PRs related to the process subsystem.semver-minorPRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@sam-github@addaleax@bzoz@BridgeAR@MylesBorins@jasnell@cjihrig@nodejs-github-bot