30291 Commits

Author SHA1 Message Date
Ben Noordhuis
e20b4f918a
test: fix fs test-fs-utimes strictEqual arg order
`actual` is the first argument, `expected` the second, but the test
flipped them around and was producing confusing assertion messages
as a result.

Refs: https://github.com/nodejs/node/pull/32408#issuecomment-602170887

PR-URL: https://github.com/nodejs/node/pull/32420
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-04-02 18:41:26 +02:00
Lucas Holmquist
88b4e86fd7
fs: make parameters optional for readSync
This makes the offset, length and position parameters optional by
passing in an options object.

PR-URL: https://github.com/nodejs/node/pull/32460
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-04-02 18:34:31 +02:00
James M Snell
05da0bbadc
src: avoid using elevated v8 namespaces in node_perf.h
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32468
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-04-02 18:33:25 +02:00
James M Snell
04c9a983de
src: avoid using elevated v8 namespaces in node_errors.h
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32468
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-04-02 18:33:24 +02:00
cjihrig
23a34089aa
tools: update ESLint to 7.0.0-alpha.3
Update ESLint to 7.0.0-alpha.3

PR-URL: https://github.com/nodejs/node/pull/32533
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-04-02 18:29:48 +02:00
Juan José Arboleda
7534477786
test: replace flag expose_internals to expose-internals
PR-URL: https://github.com/nodejs/node/pull/32542
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-04-02 18:28:23 +02:00
himself65
060a170e29
test: use common.mustCall in test-worker-esm-exit
PR-URL: https://github.com/nodejs/node/pull/32544
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-04-02 18:26:59 +02:00
Daniel Estiven Rico Posada
a6ab883eaa
test: use template strings in parallel tests
PR-URL: https://github.com/nodejs/node/pull/32549
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-02 18:25:30 +02:00
James M Snell
0be9ebb722
src: minor http2 refactorings
* Simplify Http2Priority struct
* BooleanValue => IsTrue/IsFalse

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32551
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-04-02 18:15:38 +02:00
James M Snell
5f5d3805f0
src: rename http2 class and suppress compile warnings
Suppress compile warnings on Windows, rename class for
consistent styling.

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32551
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-04-02 18:15:36 +02:00
James M Snell
8f8bbc6798
src: use smart pointers for nghttp2 objects
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32551
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-04-02 18:15:34 +02:00
Anna Henningsen
f558a765da
src: remove loop_init_failed_ from Worker class
There’s no reason for this to not be stored alongside the loop
data structure itself.

PR-URL: https://github.com/nodejs/node/pull/32562
Refs: https://github.com/nodejs/node/pull/32344
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-02 18:13:09 +02:00
Anna Henningsen
be876510bf
src: clean up worker thread creation code
Instead of setting and then in the case of error un-setting properties,
only set them when no error occurs.

Refs: https://github.com/nodejs/node/pull/32344

PR-URL: https://github.com/nodejs/node/pull/32562
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-02 18:13:07 +02:00
Hachimi Aa (Sfeir)
0c70e8c6e4
doc: improve fs.read documentation
PR-URL: https://github.com/nodejs/node/pull/29270
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-04-02 18:09:46 +02:00
Ben Noordhuis
6f94221884
test: add known issues test for #31733
Authenticated decryption works for file streams up to 32768 bytes but
not beyond. Other streams and direct decryption are not affected.

Refs: https://github.com/nodejs/node/issues/31733

PR-URL: https://github.com/nodejs/node/pull/31734
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-04-02 18:00:07 +02:00
Anna Henningsen
e06512b9b7
report: add missing locks for report_on_fatalerror accessors
Overlooked in 2fa74e3e38bb028339e48763138456b3ed10ed97.

Refs: https://github.com/nodejs/node/pull/32207

PR-URL: https://github.com/nodejs/node/pull/32535
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-04-02 17:46:30 +02:00
Anna Henningsen
2a885151e9
src: include AsyncWrap provider strings in snapshot
… and move them to `IsolateData`, because they should exist once
per Isolate.

PR-URL: https://github.com/nodejs/node/pull/32572
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-04-02 17:45:41 +02:00
Anna Henningsen
6246f90375
test: wait for message from parent in embedding cctest
I’ve seen this fail a few times in CI, presumably because the
inspector commmand did not reach the child thread in time.
Explicitly waiting seems to solve that.

Refs: https://github.com/nodejs/node/pull/30467

PR-URL: https://github.com/nodejs/node/pull/32563
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-02 17:44:25 +02:00
Anna Henningsen
72e521f5e8
src: move JSONWriter into its own file
The JSONWriter feature is not inherently related to the report
feature in any way.

As a drive-by fix, remove a number of unused header includes.

PR-URL: https://github.com/nodejs/node/pull/32552
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-04-02 17:25:57 +02:00
Anna Henningsen
c4b381a131
src: align PerformanceState class name with conventions
Class names are written in UpperCamelCase. Otherwise, this looks like
it’s a variable, not a class name.

PR-URL: https://github.com/nodejs/node/pull/32539
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-02 17:25:29 +02:00
Anna Henningsen
037ac99ed5
embedding: make Stop() stop Workers
This makes sense given that terminating execution of the parent thread
this way likely also is supposed to stop all running Worker threads
spawned by it.

PR-URL: https://github.com/nodejs/node/pull/32531
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-02 17:23:19 +02:00
Anna Henningsen
d812f16234
embedding: provide hook for custom process.exit() behaviour
Embedders may not want to terminate the process when `process.exit()`
is called. This provides a hook for more flexible handling of that
situation.

Refs: https://github.com/nodejs/node/pull/30467#issuecomment-603689644

PR-URL: https://github.com/nodejs/node/pull/32531
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-02 17:23:15 +02:00
Andrey Pechkurov
7e664a554a benchmark: fix error on server close in AsyncLocalStorage benchmark
PR-URL: https://github.com/nodejs/node/pull/32503
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-04-02 14:53:24 +02:00
Alex R
b149eefa82 http: fix incorrect headersTimeout measurement
For keep-alive connections, the headersTimeout may fire during
subsequent request because the measurement was reset after
a request and not before a request.

PR-URL: https://github.com/nodejs/node/pull/32329
Fixes: https://github.com/nodejs/node/issues/27363
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-04-02 14:50:20 +02:00
Anna Henningsen
8b9e877435
worker: do not emit 'exit' events during process.exit()
Do not emit `'exit'` events caused by recursively stopping all
running Workers from inside the `process.exit()` call.

PR-URL: https://github.com/nodejs/node/pull/32546
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-04-02 02:46:14 +02:00
Anna Henningsen
d3a4865417
tracing: do not attempt to call into JS when disallowed
PR-URL: https://github.com/nodejs/node/pull/32548
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-02 02:45:16 +02:00
Myles Borins
ac08249971
doc: update releaser list in README.md
Moved emeritus members keys and fixed alphabetization issues

PR-URL: https://github.com/nodejs/node/pull/32577
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-01 19:11:08 -04:00
Hassaan Pasha
881c932bf2 deps: update archs files for OpenSSL-1.1.1f
After an OpenSSL source update, all the config files need to be
 regenerated and comitted by:
    $ cd deps/openssl/config
    $ make
    $ git add deps/openssl/config/archs
    $ git add deps/openssl/openssl/include/crypto/bn_conf.h
    $ git add deps/openssl/openssl/include/crypto/dso_conf.h
    $ git add deps/openssl/openssl/include/openssl/opensslconf.h
    $ git commit

PR-URL: https://github.com/nodejs/node/pull/32583
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-04-01 14:13:16 -07:00
Hassaan Pasha
5318fe58f6 deps: upgrade openssl sources to 1.1.1f
This updates all sources in deps/openssl/openssl by:
    $ cd deps/openssl/
    $ rm -rf openssl
    $ tar zxf ~/tmp/openssl-1.1.1f.tar.gz
    $ mv openssl-1.1.0h openssl
    $ git add --all openssl
    $ git commit openssl

PR-URL: https://github.com/nodejs/node/pull/32583
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-04-01 14:12:48 -07:00
Myles Borins
9d82c5501c
test: mark test-http2-reset-flood flaky on bsd
This test is somewhat regularly flaky on 12.x and it appears master as
well. There appears to be an issue tracking flakes for 6+ months. Seems
reasonable to mark this to keep us from having red CI.

Refs: https://github.com/nodejs/node/issues/29802

PR-URL: https://github.com/nodejs/node/pull/32595
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-04-01 12:54:17 -04:00
Matheus Marchini
f6dcd63b29
deps: revert whitespace changes on V8
While landing the upgrade to V8 8.1, something went wrong and git made
unecessary (and incorrect) whitespace changes to test fixtures, which
broke V8 tests. Revert those changes to fix our tests.

PR-URL: https://github.com/nodejs/node/pull/32587
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-04-01 09:24:38 -07:00
Myles Borins
18b3383526
test: add test-worker-prof to the SLOW list for debug
Consistently failing on ubuntu1804_sharedlibs_debug_x64

Refs: https://github.com/nodejs/node/issues/26401

PR-URL: https://github.com/nodejs/node/pull/32589
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2020-04-01 10:39:38 -04:00
Robert Nagy
138eb32be1 net: wait for shutdown to complete before closing
When not allowing half open, handle.close would be
invoked before shutdown has been called and
completed causing a potential data race.

Fixes: https://github.com/nodejs/node/issues/32486#issuecomment-604072559

PR-URL: https://github.com/nodejs/node/pull/32491
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-04-01 13:05:10 +02:00
gengjiawen
9c00af0716 doc: add ASAN build instructions
PR-URL: https://github.com/nodejs/node/pull/32436
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
2020-04-01 02:54:30 +00:00
Guy Bedford
534c204e22 module: path-only CJS exports extension searching
PR-URL: https://github.com/nodejs/node/pull/32351
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-03-31 20:39:01 -06:00
cjihrig
60c4c2b6c5
src: runtime deprecate process.umask()
This commit runtime deprecates calling process.umask() with
no arguments.

PR-URL: https://github.com/nodejs/node/pull/32499
Fixes: https://github.com/nodejs/node/issues/32321
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-31 22:05:07 -04:00
cjihrig
75ee5b2622
doc: deprecate process.umask() with no arguments
This commit introduces a documentation deprecation for calling
process.umask() with no arguments.

PR-URL: https://github.com/nodejs/node/pull/32499
Fixes: https://github.com/nodejs/node/issues/32321
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-31 22:04:53 -04:00
Richard Lau
25a1f04cdc
tools: only fetch previous versions when necessary
Refactor the logic for working out the previous versions of Node.js for
the API documentation so that the parsing (including the potential https
get) happens at most once per build (as opposed to the current once per
generated API doc).

Signed-off-by: Richard Lau <riclau@uk.ibm.com>

PR-URL: https://github.com/nodejs/node/pull/32518
Fixes: https://github.com/nodejs/node/issues/32512
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-03-31 18:25:10 -04:00
Rich Trott
8905be2cee test: refactor test-http-information-processing
Replace magic numbers with constant.
Use for loop for repeated code.
Reduce console logging.
Remove unneeded countdown module use.

PR-URL: https://github.com/nodejs/node/pull/32547
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-03-31 13:11:22 -07:00
Sam Roberts
867ff41d87 src: handle report options on fatalerror
Follow on to https://github.com/nodejs/node/pull/32207, 3 other options
are also not respected under situations that the isolate is not
available.

PR-URL: https://github.com/nodejs/node/pull/32497
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-31 11:59:25 -07:00
Gabriel Schulhof
e158218fb2 doc: update context-aware section of addon doc
Replace the portion of the context-aware addon example that advocates
for managing the life cycle of the per-addon-instance data using a
weak reference with code that illustrates how to manage its life cycle
using an environment cleanup hook.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: https://github.com/nodejs/node/pull/28659
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-03-31 10:22:12 -07:00
James M Snell
accc984ca9 src: refactoring and cleanup of node_i18n
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32438
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-03-30 09:50:25 -07:00
Denys Otrishko
fd7e5d40a4
wasi: clean up options validation
PR-URL: https://github.com/nodejs/node/pull/31797
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-30 17:22:22 +02:00
murgatroid99
18c3ff99aa
dns: add dns.ALL hints flag constant
PR-URL: https://github.com/nodejs/node/pull/32183
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-30 17:21:13 +02:00
Luigi Pinca
bbf3fb8ac9
doc: update AUTHORS list
PR-URL: https://github.com/nodejs/node/pull/32222
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-30 17:18:52 +02:00
Antoine du HAMEL
f571b294f5
doc: deprecate process.mainModule
PR-URL: https://github.com/nodejs/node/pull/32232
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-03-30 17:18:51 +02:00
Pranshu Srivastava
6ade42bb3c
doc: stream.end(cb) cb can be invoked with error
Update docs that the optional callback passed to
`writable.end` can be invoked in case of an error as well.

PR-URL: https://github.com/nodejs/node/pull/32238
Fixes: https://github.com/nodejs/node/issues/31220
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-30 17:15:50 +02:00
Ben Noordhuis
c37d4ccee8
crypto: clear openssl error stack after en/decrypt
The publicEncrypt/privateDecrypt/etc. family of functions didn't clear
OpenSSL's error stack on early return.

Notably, trying to use an encrypted key with the wrong passphrase left
an error on the stack that made subsequent encrypt or decrypt operations
fail, even with an unencrypted key.

Fixes: https://github.com/nodejs/node/issues/32240

PR-URL: https://github.com/nodejs/node/pull/32248
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-03-30 17:13:45 +02:00
himself65
2d8812984f
src: remove unnecessary 'Local.As' operation
PR-URL: https://github.com/nodejs/node/pull/32286
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-30 17:12:31 +02:00
himself65
defbc2ed82
fs: fix fs.read when passing null value
PR-URL: https://github.com/nodejs/node/pull/32479
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2020-03-30 17:10:25 +02:00