PR-URL: https://github.com/nodejs/node/pull/28365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Provided a small example along its output using fs.stat() to check the
stats on two different paths, one a directory and the other a txt file.
PR-URL: https://github.com/nodejs/node/pull/28381
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
The implementation of _getDisplayPos, used to compute the cursor
position and to find out how many lines to clear up when re-rendering
the readline output, was counting each line (except the last one) from
the input as one row, even if they were wraping. This caused some
rendering issues when the 'prompt' have at least one wide line ending
with a newline char, duplicating the lines at the top of the prompt when
calling _refreshLine (ex: when the user hits backspace).
This patch fixes the issue by computing the real rows count for each new
line in the input string.
PR-URL: https://github.com/nodejs/node/pull/28272
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This change adds the ability to set the memory ceiling for a Node.js
process according to a memory limit set by cgroups (via
uv_get_constrained_memory), which is used by docker containers to set
resource constraints. Previously we would use the physical memory size
to estimate the necessary V8 heap sizes, but the physical memory size is
not necessarily the correct limit, e.g. if the process is running inside
a docker container or is otherwise constrained.
Non-Linux systems shouldn't be affected.
PR-URL: https://github.com/nodejs/node/pull/27508
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This commit adds an assertion checking the exact field names
returned by process.resourceUsage(). This ensures that no new
fields accidentally slip into the returned object in the future.
PR-URL: https://github.com/nodejs/node/pull/28498
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
The pointer used to hold an incoming dynamically loaded module's
`node::node_module` structure needs to be thread-local. So far this was
done with `uv_key_set()` and `uv_key_get()`. The language now supports
the `thread_local` keyword which makes implementing this a lot cleaner.
PR-URL: https://github.com/nodejs/node/pull/28456
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This upgrade is a small patch release, fixing compilation
errors on Android, Cygwin, and uClibc - none of which are
tested in the CI.
PR-URL: https://github.com/nodejs/node/pull/28511
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
If a top level module is listed as Stable, there is no need to
call out individual components of that module as Stable. The
extra text is just distracting.
PR-URL: https://github.com/nodejs/node/pull/28485
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
The closing paren was missing. Move to using commas instead.
PR-URL: https://github.com/nodejs/node/pull/28483
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Expose `napi_build_version` to allow `node-gyp` to make it
available for building native addons.
Fixes: https://github.com/nodejs/node-gyp/issues/1745
Refs: https://github.com/nodejs/abi-stable-node/issues/371
PR-URL: https://github.com/nodejs/node/pull/27835
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
https://ci.nodejs.org/job/node-test-commit-v8-linux/configure echoes
python code into tools and runs it. Move these scripts into tools for
better maintainability.
Once this lands and is back-ported into LTS branches a bunch of shell
code can be deleted from the job.
PR-URL: https://github.com/nodejs/node/pull/28458
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
The devtoolset doesn't use or set the CXX, etc, env vars, so ignore them
if not present.
PR-URL: https://github.com/nodejs/node/pull/28458
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
plus some minor tweaks
PR-URL: https://github.com/nodejs/node/pull/28465
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
EIO has been observed to be returned by the Linux kernel under some
circumstances. Reading through drivers/tty/tty_io*.c, it seems to
indicate the tty went away. Of course none of this is documented.
Fixes: https://github.com/nodejs/node/issues/28479
PR-URL: https://github.com/nodejs/node/pull/28490
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Make `http2.connect()` work when using URLs with literal IPv6
addresses.
Fixes: https://github.com/nodejs/node/issues/28216
PR-URL: https://github.com/nodejs/node/pull/28406
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
This corrects a typo in the process.resourceUsage() docs. The
field is named swappedOut, not swapedOut.
PR-URL: https://github.com/nodejs/node/pull/28497
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
As discussed in https://github.com/nodejs/diagnostics/issues/161,
the core should expose important metrics about the runtime, this PR's
goal is to let user get the number of io request made, and lower level
mertrics like the page faults and context switches.
PR-URL: https://github.com/nodejs/node/pull/28018
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
According to https://editorconfig.org/#supported-properties the
canonical way to disable a property is to set it to 'unset'. We did use
'ignore' and this generally works because tools ignore unknown values
but some of them like `eclint` are picky on it.
PR-URL: https://github.com/nodejs/node/pull/28440
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Notable changes:
- Support for the Haiku platform has been added.
- The maximum UV_THREADPOOL_SIZE has been increased from
128 to 1024.
- uv_fs_copyfile() now works properly when the source and
destination files are the same.
PR-URL: https://github.com/nodejs/node/pull/28449
Fixes: https://github.com/nodejs/node/issues/27746
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Currently, when an HTTP2 session is destroyed with a code, that
code is not propagated to the destroy() call of the session's
streams. This commit forwards any code used to destroy a session
to its corresponding streams.
PR-URL: https://github.com/nodejs/node/pull/28435
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Otherwise this was failing on machines which already had a service
running on port 3000.
PR-URL: https://github.com/nodejs/node/pull/28312
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit removes the comment in cache_builder.cc regarding the usage
of --code-cache-path with configure.
Commit 14df42fd00 ("build: run
`mkcodecache` as an action") deprecated this option and it is always
set to yes (unless cross compiling).
PR-URL: https://github.com/nodejs/node/pull/28419
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
The `Execute()` callback is not allowed to call into JS, so
we should use `assert()` instead of potentially throwing JS errors.
PR-URL: https://github.com/nodejs/node/pull/28423
Fixes: https://github.com/nodejs/help/issues/1998
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This commit:
- Removes an unnecessary stability index entry. These generally
are not included for Stable entries.
- Remove mention of experimental status that is not true anymore.
- Remove use of "we"
- Remove use of relative time phrasing.
- Misc cleanup.
PR-URL: https://github.com/nodejs/node/pull/28425
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit removes extra whitespace and some awkward text
containing typos from the cluster worker.isDead() code
sample.
PR-URL: https://github.com/nodejs/node/pull/28421
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Previously the enhancement were done right after emitting
`'uncaughtException'`, which meant by the time we knew the
exception was fatal in C++, the error.stack had already been
patched.
This patch moves those routines to be called later during the
fatal exception handling, and split them into two stages:
before and after the inspector is notified by the invocation of
`V8Inspector::exceptionThrown`. We now expand the stack to include
additional informations about unhandled 'error' events before
the inspector is notified, but delay the highlighting of the
frames until after the inspector is notified, so that the
ANSI escape sequences won't show up in the inspector console.
PR-URL: https://github.com/nodejs/node/pull/28308
Fixes: https://github.com/nodejs/node/issues/28287
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This updates eslint from v6.0.0-alpha.2 to v6.0.1
This also removes eslint-disable comments about `bigint` typeof
checks. Those would otherwise have caused linting errors now that
`bigint` is accepted as valid entry.
PR-URL: https://github.com/nodejs/node/pull/28173
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
This update enables linting for "note that" in our docs. That phrase is
almost always superfluous. Sentences are almost always clearer and
stronger without it.
PR-URL: https://github.com/nodejs/node/pull/28393
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>