Commit Graph

212 Commits

Author SHA1 Message Date
Aviv Keller
71785889c8
lib: prefer logical assignment
PR-URL: https://github.com/nodejs/node/pull/55044
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2024-10-09 06:42:16 +00:00
Antoine du Hamel
99e0d0d218
test: add escapePOSIXShell util
PR-URL: https://github.com/nodejs/node/pull/55125
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-09-29 20:44:52 +00:00
Aviv Keller
574f2dd517
lib: prefer optional chaining
PR-URL: https://github.com/nodejs/node/pull/55045
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2024-09-24 19:48:15 +00:00
Yagiz Nizipli
e5c8978222 test: set test-writewrap as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:29 -07:00
tannal
0b6b2a4dc7
test: merge ongc and gcutil into gc.js
PR-URL: https://github.com/nodejs/node/pull/54355
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-08-29 08:49:52 +01:00
Sonny
bd42e4c6a7
test: fix typo in test
PR-URL: https://github.com/nodejs/node/pull/54137
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-08-04 07:03:24 +00:00
psj-tar-gz
491855c82b
test: add http agent to executionAsyncResource
Refs: https://github.com/nodejs/node/blob/HEAD/test/async-hooks/test-async-exec-resource-http.js
Signed-off-by: psj-tar-gz <lyricalllmagical@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/34966
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2024-05-11 10:45:09 +02:00
Abdirahim Musse
4e109e5958
test: un-set test-emit-after-on-destroyed as flaky
I tested running the test case 100k times on the AIX ci machine
and was unable to re-produce the error. Also it has not showed up
recently as flaky on the ci. I suggest we mark this
as un-flaky.

ref: https://github.com/nodejs/node/issues/50245#issuecomment-1924738357
PR-URL: https://github.com/nodejs/node/pull/51995
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-03-08 23:40:23 +00:00
Yagiz Nizipli
2d24518bfa
test: set test-emit-after-on-destroyed as flaky
Ref: https://github.com/nodejs/node/issues/50245
PR-URL: https://github.com/nodejs/node/pull/50246
Refs: https://github.com/nodejs/node/issues/50245
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2023-10-20 15:36:06 +00:00
Livia Medeiros
052434a0c1
test: use tmpdir.resolve()
PR-URL: https://github.com/nodejs/node/pull/49136
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-08-21 16:41:53 +00:00
Moshe Atlow
9658d84ddd tools: fix jsdoc lint
PR-URL: https://github.com/nodejs/node/pull/47789
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
2023-05-02 00:48:20 +00:00
James M Snell
dc90810f9f async_hooks: remove experimental onPropagate option
The `onPropagate` option for `AsyncLocalStorage` is problematic for a
couple of reasons:

1. It is not expected to be forwards compatible in any way with the
   upcoming TC-39 `AsyncContext` proposal.
2. It introduces a non-trivial O(n) cost invoking a JavaScript callback
   for *every* AsyncResource that is created, including every Promise.

While it is still experimental, I recommend removing it while we can
revisit the fundamental use cases in light of the coming `AsyncContext`
proposal.

Refs: https://github.com/nodejs/node/issues/46374
PR-URL: https://github.com/nodejs/node/pull/46386
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2023-02-01 07:37:05 -08:00
Jordan Harband
757c104147
tools: add prefer-proto rule
fixup: add support for `Object.create(null)`

fixup: extend to any 1-argument Object.create call

fixup: add tests
PR-URL: https://github.com/nodejs/node/pull/46083
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-01-10 05:38:36 +00:00
Antoine du Hamel
cf46746b8a
test: add trailing commas in async-hooks tests (#45549)
PR-URL: https://github.com/nodejs/node/pull/45549
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2022-11-21 18:43:47 +01:00
Gerhard Stöbich
67d1831e9b
async_hooks: add hook to stop propagation
Add hook to AsyncLocalStorage to allow user to stop propagation.
This is needed to avoid leaking a store if e.g. the store indicates
that its operations are finished or it reached its time to live.

PR-URL: https://github.com/nodejs/node/pull/45386
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-11-15 12:27:03 +00:00
Luigi Pinca
65ec9f35e9 test: defer invocation checks
Do not immediately check the `tcpserver` hook invocations when it
closes. Do it in the next iteration of the event loop.

PR-URL: https://github.com/nodejs/node/pull/42340
Refs: https://github.com/nodejs/node/pull/42340#issuecomment-1290964192
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-11-05 19:53:24 +01:00
Antoine du Hamel
2c1b9f506a
test: remove unnecessary noop function args to mustCall()
RefsL https://github.com/nodejs/node/pull/45027

PR-URL: https://github.com/nodejs/node/pull/45047
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
2022-10-20 13:13:32 +00:00
Rich Trott
6059cbedbd
test: remove unnecessary noop function args to mustCall()
PR-URL: https://github.com/nodejs/node/pull/45027
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-10-18 12:13:41 +00:00
Paolo Insogna
4267b92604 http: use Keep-Alive by default in global agents
PR-URL: https://github.com/nodejs/node/pull/43522
Fixes: https://github.com/nodejs/node/issues/37184
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-06-29 12:48:52 +02:00
Feng Yu
ea99431586
test: mark flaky tests on smartos
PR-URL: https://github.com/nodejs/node/pull/43596
Refs: https://github.com/nodejs/node/issues/43457
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-06-28 18:06:48 +01:00
Paolo Insogna
3caa2c1a00
http: refactor headersTimeout and requestTimeout logic
PR-URL: https://github.com/nodejs/node/pull/41263
Fixes: https://github.com/nodejs/node/issues/33440
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-04-13 15:47:59 +01:00
Anatoli Papirovski
51783320a4 process: ignore asyncId 0 in exception handler
Today, the global uncaught exception handler is the only
place where asyncId 0 is not ignored and we still proceed
to call emitAfter. This would've already failed one of
our correctness tests in async_hooks if not for some other
code meant to handle a different edge case.

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

PR-URL: https://github.com/nodejs/node/pull/41424
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-01-18 22:05:12 +01:00
Rich Trott
55ceaec111 tools,benchmark,lib,test: enable no-case-declarations lint rule
PR-URL: https://github.com/nodejs/node/pull/41385
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2022-01-05 07:42:19 -08:00
Bradley Farias
c3866b09c1 async_hooks: fix AsyncLocalStorage in unhandledRejection cases
PR-URL: https://github.com/nodejs/node/pull/41202
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2021-12-21 09:33:45 -06:00
Rich Trott
1e8b296c58
lib,test,tools: use consistent JSDoc types
This could be in preparation of implementing the jsdoc/check-types
ESLint rule.

PR-URL: https://github.com/nodejs/node/pull/40989
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2021-11-29 06:48:00 +00:00
Darshan Sen
2b0087f3d4 Revert "async_hooks: merge resource_symbol with owner_symbol"
This reverts commit 7ca2f13039.

PR-URL: https://github.com/nodejs/node/pull/40741
Fixes: https://github.com/nodejs/node/issues/40693
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-11-18 18:42:27 +05:30
Darshan Sen
1b8bfddf89 test: add AsyncLocalStorage tests using udp, tcp and tls sockets
Fixes: https://github.com/nodejs/node/issues/40693

Signed-off-by: Darshan Sen <darshan.sen@postman.com>

PR-URL: https://github.com/nodejs/node/pull/40741
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-11-18 18:42:23 +05:30
Rafael Gonzaga
d10085bcb1
async_hooks: expose async_wrap providers
docs: add asyncWrapProviders api doc

tests(async_hooks): use internalBinding for comparisson

fix(test-async-wrap): lint error

docs: use REPLACEME for asyncWrapProviders

update: use freeze and copy for asyncWrapProviders

update(async_hooks): use primordials on asyncWrapProviders

fix: use common to expect error

docs(asyncWrapProviders): rephrase return type

fix: lint md

fix: lint md

docs(async_hooks): typo

Co-authored-by: Stephen Belanger <admin@stephenbelanger.com>

update(asyncWrapProviders): add __proto__ as null

Co-authored-by: Simone Busoli <simone.busoli@gmail.com>
Co-authored-by: Michaël Zasso <targos@protonmail.com>

test: adjust __proto__ assertion

docs: add DEP0111 link

PR-URL: https://github.com/nodejs/node/pull/40760
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2021-11-12 21:48:34 +00:00
Rich Trott
cbd61c944c doc: format markdown files in test directory
Use `make format-md` to format markdown files in `test` directory.

PR-URL: https://github.com/nodejs/node/pull/40290
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-10-04 20:19:11 -07:00
Stephen Belanger
926152a38c async_hooks: use resource stack for AsyncLocalStorage run
PR-URL: https://github.com/nodejs/node/pull/39890
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-08-31 17:04:35 +00:00
Michaël Zasso
508890d795
test: use assert.match instead of regexp.test
PR-URL: https://github.com/nodejs/node/pull/39928
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-08-31 18:50:16 +02:00
Darshan Sen
7ca2f13039
async_hooks: merge resource_symbol with owner_symbol
Signed-off-by: Darshan Sen <darshan.sen@postman.com>

PR-URL: https://github.com/nodejs/node/pull/38468
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-07-28 13:41:24 -07:00
Darkripper214
e46c680bf2 test: improve clarity of ALS-enable-disable.js
The last als.run() will reactivate the als,
hence the test should test for getting the object,
not undefined

PR-URL: https://github.com/nodejs/node/pull/38008
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-04-02 18:37:35 +02:00
Rich Trott
330f25ef82 test: prepare for consistent comma-dangle lint rule
Make changes so that tests will pass when the comma-dangle settings
applied to the rest of the code base are also applied to tests.

PR-URL: https://github.com/nodejs/node/pull/37930
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-04-01 23:14:29 -07:00
Tobias Nießen
7d672733c6
test: fix ibmi skip message
PR-URL: https://github.com/nodejs/node/pull/37821
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-03-22 10:56:05 -07:00
Sajal Khandelwal
7d5806eee3 async_hooks: set unhandledRejection async context
This commit now executes `process.on('unhandledRejection')` in the
async execution context of the concerned `Promise`.

PR-URL: https://github.com/nodejs/node/pull/37281
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-02-13 16:49:21 +02:00
Michael Dawson
15164cebce lib,src: update cluster to use Parent
Doc deprecate isMaster and setupMaster in favor
of isPrimary and setupPrimary.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/36478
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-01-05 15:41:45 -05:00
Nick Schonning
dbdd234e4b doc: adjust table alignment for remark v13
Addresses table-cell-padding rule issues

PR-URL: https://github.com/nodejs/node/pull/35647
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-11-02 16:56:31 -08:00
Rich Trott
f593f9e9ef test: adjust comments for upcoming lint rule
Enforce `//` for multiline comments. Some tests mixed and matched, and
at least one did so in a (to me) surprising way.

PR-URL: https://github.com/nodejs/node/pull/35485
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-10-07 04:36:02 -07:00
Gerhard Stoebich
48249889b6 async_hooks: avoid unneeded AsyncResource creation
Inspired by the callstack at https://github.com/nodejs/node/issues/34556#issuecomment-666743528

If the wanted store is equal to the active store it's not needed to
create an AsyncResource.

Refs: https://github.com/nodejs/node/issues/34556#issuecomment-666743528

PR-URL: https://github.com/nodejs/node/pull/34616
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
2020-08-06 23:26:13 +02:00
Gerhard Stoebich
cb142d1341 async_hooks: execute destroy hooks earlier
Use a microtask to call destroy hooks in case there are a lot queued
as immediate may be scheduled late in case of long running
promise chains.

Queuing a mircrotasks in GC context is not allowed therefore an
interrupt is triggered to do this in JS context as fast as possible.

fixes: https://github.com/nodejs/node/issues/34328
refs: https://github.com/nodejs/node/issues/33896

PR-URL: https://github.com/nodejs/node/pull/34342
Fixes: https://github.com/nodejs/node/issues/34328
Refs: https://github.com/nodejs/node/issues/33896
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-08-02 23:13:42 +02:00
Andrey Pechkurov
019ea073ba async_hooks: don't reuse resource in HttpAgent when queued
PR-URL: https://github.com/nodejs/node/pull/34439
Fixes: https://github.com/nodejs/node/issues/34401
Refs: https://github.com/nodejs/node/pull/27581
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-07-30 19:26:44 +03:00
Anna Henningsen
00823f2967
src: add callback scope for native immediates
This ensures that microtasks scheduled by native immediates are run
after the tasks are done. In particular, this affects the inspector
integration since 6f9f546406.

Fixes: https://github.com/nodejs/node/issues/33002
Refs: https://github.com/nodejs/node/pull/32523

PR-URL: https://github.com/nodejs/node/pull/34366
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-07-20 20:37:08 +02:00
Gerhard Stoebich
a2b1b92e30 test: AsyncLocalStorage works with thenables
This adds a test to verify that AsyncLocalStorage works with thenables.

PR-URL: https://github.com/nodejs/node/pull/34008
Refs: https://github.com/nodejs/node/pull/33778
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-24 15:44:49 +02:00
Luigi Pinca
b533fb3508 tools: enable no-else-return lint rule
Refs: https://github.com/nodejs/node/pull/32644
Refs: https://github.com/nodejs/node/pull/32662

PR-URL: https://github.com/nodejs/node/pull/32667
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-05-16 06:42:16 +02:00
Andrey Pechkurov
50dd63e8ef
async_hooks: merge run and exit methods
PR-URL: https://github.com/nodejs/node/pull/31950
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-04-13 18:37:44 +02:00
Stephen Belanger
f7f0441997
async_hooks: prevent sync methods of async storage exiting outer context
PR-URL: https://github.com/nodejs/node/pull/31950
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-04-13 18:37:09 +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
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
Bartosz Sosnowski
eb553a473b
test: unflake async-hooks/test-statwatcher
On Windows 2016 under high load further change events can be emitted
after writing the 5 bytes is reported. Updating the mtime of the file
can be reported as a separate change. This will increase the "before"
count, but not the "w1HookCount" since we removed the listener.

This makes the test keep the listeners until the end of the test.

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

PR-URL: https://github.com/nodejs/node/pull/32484
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-29 22:33:33 +02:00