profile
viewpoint
Andrey Pechkurov puzpuzpuz @hazelcast Russia, Voronezh https://medium.com/@apechkurov

puzpuzpuz/cls-rtracer 95

Request Tracer - CLS-based request id generation for Express, Fastify, Koa and Hapi, batteries included

batrudinych/s3-redeploy 15

Node.js utility to sync files to Amazon S3 and invalidate CloudFront distributions.

puzpuzpuz/express-rtracer 9

Express Request Tracer - a middleware for CLS-based request id generation, batteries included

puzpuzpuz/talks 9

Materials for my talks

puzpuzpuz/http-nio-server 4

A demo HTTP server built with Java NIO & NIO.2

puzpuzpuz/rxjava-slf4j-mdc-hook 4

RxJava v1 and v2 hooks which enable SLF4J's MDC propagation.

puzpuzpuz/zeptourl-api 4

A TinyURL-like demo application

puzpuzpuz/books 3

Printed books and tutorials that were written by me as the author or co-author

puzpuzpuz/microbenchmarks 2

A collection of various JS microbenchmarks

puzpuzpuz/nbufpool 2

An unsafe Buffer pool for Node.js

issue commenthazelcast/hazelcast

Switch latency tracking in DS stats to System.nanoTime()

Tracking time with a milisecond granularity sn't that useful because we can't track call that have submillisecond latencies.

I agree. Once we have histogram proves for latencies, it will make much more sense.

So in theory I have no problem making use of nanotime; but it needs to be done consistently because nanotime should be used very carefully. You don't want to run into overflow problems for example.

Good point. Overflow may be a problem indeed, as a long allows to hold ~292 years with nanosecond granularity.

In case of total latency counter probes, users may experience the overflow on members running for several years (or even months) as operations are executed in parallel and latencies for neighbor operations may intersect in terms of time. So, maybe we should change granularity to micros or millis in these places:

  • https://github.com/hazelcast/hazelcast/blob/master/hazelcast/src/main/java/com/hazelcast/internal/monitor/impl/LocalMapStatsImpl.java#L99-L104
  • https://github.com/hazelcast/hazelcast/blob/master/hazelcast/src/main/java/com/hazelcast/internal/monitor/impl/LocalReplicatedMapStatsImpl.java#L78-L89

@alex-dukhno @blazember WDYT?

puzpuzpuz

comment created time in 10 hours

push eventpuzpuzpuz/hazelcast-simulator

Andrey Pechkurov

commit sha b0bb1ae01f417c7ae20d9f531dcfb60b9d13799a

Fix typos in readme

view details

Andrey Pechkurov

commit sha 3805b8899d5f5585637bcddc410c9687be856223

Replace IntIntMapTest with IntByteMapTest in readme and sample properties

view details

Zoltan Baranyi

commit sha 3c1c0f82fa438bb64afbf8f3bf5ebcd520ae323e

Fix starting dstat remotely Without these changes the ssh command never returns and simulator hangs before starting the benchmark.

view details

Peter Veentjer

commit sha 516d6ac2097e4a5309edc067a458b17c071c3035

WIP

view details

Peter Veentjer

commit sha cfa7a71d62021faeb451fc95b46f60770b1dd0ee

Merge pull request #1852 from pveentjer/v0.12/fix/lettuce-cluster-support WIP

view details

Peter Veentjer

commit sha abee5e55192852dda1bbeb5742fb461b99d76858

Merge pull request #1851 from blazember/fix-starting-dstat Fix starting dstat remotely

view details

Peter Veentjer

commit sha 345b6314f6fa127da5de7e6a7bb187de81bd0585

Merge pull request #1850 from puzpuzpuz/fix-readme-typos Fix typos in readme

view details

Peter Veentjer

commit sha bd6d71ecf935e3ba3143c5bf27a19d6fcae1dcdb

Upgraded machine to Nitro based and updated to latest Amazin Linux 2 AMI

view details

Peter Veentjer

commit sha 3194f053296b9415219df47833b8ba77a8c05bb3

Merge pull request #1854 from pveentjer/v0.12/clean/machine-image-upgrade Upgraded machine to Nitro based and updated to latest Amazin Linux 2 AMI

view details

Peter Veentjer

commit sha 3e7d56822d0800970d45b4d82fe72730db7acfe0

Added support for OpenJDK 14

view details

Peter Veentjer

commit sha 1edd1144c3c9af23dbf83b684f104c221939ffcb

Merge pull request #1855 from pveentjer/v0.12/feature/openjdk-14-support Added support for OpenJDK 14

view details

Peter Veentjer

commit sha 530de2e0d4a322bce4800980d6d9afe21ca5706b

Added option for ec2 run-instances configuration

view details

Peter Veentjer

commit sha 22c185ed734dba73be7fb17f58d6510f083e6709

Merge pull request #1857 from pveentjer/v0.12/feature/ec2-run-arguments Added option for ec2 run-instances configuration

view details

Peter Veentjer

commit sha fee9fb3efdd28e0f790b4d0434a3fcf9b64aa295

Various ec2 cleanups removal of peter key removed some unused properties removed some old todos

view details

Peter Veentjer

commit sha d05005c43d0e7e7db8991ad2f55fab5d74b28b70

Merge pull request #1858 from pveentjer/v0.12/cleaning/ec2-cleanup Various ec2 cleanups

view details

push time in 2 days

push eventpuzpuzpuz/node

unknown

commit sha cba9f2e7a2ff04619ceba1350418469049d79b1c

doc: add link to DNS definition PR-URL: https://github.com/nodejs/node/pull/32228 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>

view details

Robert Nagy

commit sha 1428a92492469b7ea1ee91acd204854a615be4eb

stream: make pipeline try to wait for 'close' Pipeline uses eos which will invoke the callback on 'finish' and 'end' before all streams have been fully destroyed. Fixes: https://github.com/nodejs/node/issues/32032 PR-URL: https://github.com/nodejs/node/pull/32158 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

James M Snell

commit sha a0578714bf50a473563fa32bad258aad92351ba0

repl: fixup error message Use "cmd.action" instead of just "action" for ERR_INVALID_ARG_TYPE Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32474 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

James M Snell

commit sha ca19d553cf78e335da396756677bd5afb910ed2d

http: fixup options.method error message Use `options.method` instead of just `method` Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32471 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Matheus Marchini

commit sha 7c66f4544abc424c0b18a05fc8ee2793b0c22014

build: drop Travis in favor of Actions GitHub Actions is running all tests already present on Travis, as well as building on more platforms (OS X and Windows). With Travis we're also getting timeouts more frequently than with Actions, which gives the false impression tests are failing (making it harder to triage PRs ready to merge). To make our config simpler, CI.yml and pythonpackage.yml got merged. The coverage is also increased by running tests on OS X. Signed-off-by: Matheus Marchini <mmarchini@netflix.com> PR-URL: https://github.com/nodejs/node/pull/32450 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ben Coe <bencoe@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>

view details

Anna Henningsen

commit sha 1b1c2993a5bc9a64cb4d417509d2fc35a64182f4

src: cleanup DestroyParam when Environment exits Otherwise, this leaks memory if the weak callback is never called. PR-URL: https://github.com/nodejs/node/pull/32421 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Xavier Stouder

commit sha 191fb3c2f29c8c5827a99258d45163b148824faf

src: check for empty maybe local Using ToLocalChecked on MaybeLocal without verifying it's empty can lead to unattempted crash. PR-URL: https://github.com/nodejs/node/pull/32339 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Juan José Arboleda

commit sha 6791ac0a472cdc968f8d97187c3a8a3d1b272341

src: clean v8 namespaces in env.cc file PR-URL: https://github.com/nodejs/node/pull/32374 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

Anna Henningsen

commit sha c3204a8787452e3c3727353ab397de7ee407e5cb

test: use common.buildType in embedding test This un-breaks testing in the case of `./configure --debug-node`. PR-URL: https://github.com/nodejs/node/pull/32422 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Alba Mendez

commit sha c399e2664b9939a8b803f11062a2499293300793

doc: add mildsunrise to collaborators PR-URL: https://github.com/nodejs/node/pull/32525 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Rich Trott

commit sha 436c71db6656b6b48b8a3771c382d093c79e4d1a

test: revise test-http-client-default-headers-exist * Remove assert.strictEqual where assert.ok suffices * Replace countdown with Promise.all() PR-URL: https://github.com/nodejs/node/pull/32493 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Gabriel Schulhof

commit sha fa3fd78c8855379f4d785a5a40176e7cf604f857

src: simplify large pages mapping code * Introduce `OnScopeLeave` handler for cleaning up mmap()ed range(s). * Factor out failure scenario at the bottom of the function with `fail` label for use with `goto`. * Do not allocate temporary range (`nmem`) on FreeBSD, because it is not used. The intention is that the steps involved in re-mapping to large pages become more clearly visible. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl> PR-URL: https://github.com/nodejs/node/pull/32396 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com>

view details

Rich Trott

commit sha a1686e00ab726f70d83241fbea53d577b94ee3a7

test: replace Map with Array in test-cluster-net-listen-ipv6only-false Signed-off-by: Rich Trott <rtrott@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32398 Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Rich Trott

commit sha 2565442ac0215cbea398d7f0dc1faa49e9632a93

test: use Promise.all() in test-cluster-net-listen-ipv6only-false Use Promise.all() instead of countdown in test-cluster-net-listen-ipv6only-false. Signed-off-by: Rich Trott <rtrott@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32398 Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

himself65

commit sha a744dad589cdfe35f322f28d199968559cd4953a

src: remove excess v8 namespace PR-URL: https://github.com/nodejs/node/pull/32191 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

James M Snell

commit sha 7d3791a3a4fced7ab524cfd34ecb3b9805d86e28

fs: fixup error message for invalid options.recursive Use "options.recursive" instead of just "recursive" Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32472 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

James M Snell

commit sha 05aa67aa21b77933033027615eb30df70338c735

console: fixup error message Use "options.inspectOptions" instead of just "inspectOptions" Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32475 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Daniel Bevenius

commit sha cd1db2db48d28db805227e7f6ade79a106d85bc6

src: fix compiler warnings in node_report_module Currently, the following compiler warnings are generated: ../src/node_report_module.cc: In function ‘void report::ShouldReportOnFatalError( const v8::FunctionCallbackInfo<v8::Value>&)’: ../src/node_report_module.cc:132:16: warning: unused variable ‘env’ [-Wunused-variable] 132 | Environment* env = Environment::GetCurrent(info); | ^~~ ../src/node_report_module.cc: In function ‘void report::SetReportOnFatalError( const v8::FunctionCallbackInfo<v8::Value>&)’: ../src/node_report_module.cc:138:16: warning: unused variable ‘env’ [-Wunused-variable] 138 | Environment* env = Environment::GetCurrent(info); | ^~~ This commit removes the unused variables. PR-URL: https://github.com/nodejs/node/pull/32498 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

push time in 3 days

issue commentnodejs/node

worker_threads consuming so much memory and crash

@oh-frontend1 what do you mean by "500 network IO"? Is it 500 client connections? If that's true and your application is I/O bound, Node should be able to handle much more than that. In most cases, you just need to follow the golden rule of Node (don't block the event loop).

And if it's CPU-bound, then it's better to keep the number of worker threads close to number of CPU cores and queue tasks when all members are busy (just like ThreadPoolExecutor in Java does it). Otherwise, if you run CPU-bound tasks on a large number of threads, you will be wasting memory (due to the footprint per each worker thread) and CPU time spent on context switching on OS level.

Sorry in the advance, if I misunderstood your needs.

oh-frontend1

comment created time in 5 days

issue openedhazelcast/hazelcast-nodejs-client

Remove serializationConfig.stringSerializationPolicy config option

As in 4.0 members and all clients follows UTF-8 standard (RFC 3629) for string serialization, we don't need to keep serializationConfig.stringSerializationPolicy config option for compatibility with other clients and members. So, we should remove it.

created time in 5 days

issue openedhazelcast/hazelcast-nodejs-client

Change minimal Node.js version to v8.0 and remove safe-buffer dependency

Node.js v4.0-7.0 are not supported for a long time (see https://nodejs.org/en/about/releases/), so we should change minimal Node.js version to v8.0 as a part of 4.0 release.

Once we do it, we can remove safe-buffer library from deps and use Buffer API directly.

created time in 5 days

pull request commentnodejs/node

benchmark: benchmarking impacts of async hooks on promises

@puzpuzpuz Yeah, your result is quite similar in my local reproduction. I'm trying to find out improvements. But, alas, if you have any idea you can go ahead .

I was thinking of optimizations for AsyncLocalStorage scenario, i.e. when only init hook is present. Maybe, some corners can be cut in this case, but I don't have anything specific on my mind yet. Going to do some more experiments to gather ideas.

legendecas

comment created time in 5 days

push eventpuzpuzpuz/node

AshCripps

commit sha a621608f12988fac81d63043f4d147850d57c4c2

build: update macos deployment target to 10.13 for 14.x Update the macos deployment target to 10.13 (High Sierra) for Node 14 refs: https://github.com/nodejs/build/issues/2168 PR-URL: https://github.com/nodejs/node/pull/32454 Refs: https://github.com/nodejs/build/issues/2168 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Victor

commit sha afb5639119c91afc8c6f5c078468fe6f7775f8a2

doc: update async_hooks.md Typo `runAndReturn` -> `runSyncAndReturn` PR-URL: https://github.com/nodejs/node/pull/32382 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Rich Trott

commit sha bdfbbf6c68da7a413d5e7101ce135ea41e4e81f4

doc: trim wording in n-api.md text about exceptions PR-URL: https://github.com/nodejs/node/pull/32457 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>

view details

Rich Trott

commit sha 7e4381318b3d4dacc6ed7c050ba8d00e3546a2f7

doc: remove unnecessary "obvious(ly)" modifiers in esm.md Remove "obvious" and "obviously" in two places in esm.md. It may be obvious to some, but likely not everyone or else it probably wouldn't be worth mentioning/documenting. PR-URL: https://github.com/nodejs/node/pull/32457 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>

view details

Rich Trott

commit sha 498415b4abd879a81333f48123cc31ca8f32b6f5

doc: remove extraneous sentence in events.md Since the previous sentence describes `10` as a default, and the following sentence explains how to modify that default, it is unnecessary to explain that "Obviously, not all events should be limited to just 10 listeners." PR-URL: https://github.com/nodejs/node/pull/32457 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>

view details

Ruy Adorno

commit sha b2e1a01516cbbf9dd1a90e8e0cba188db0b67062

deps: upgrade npm to 6.14.4 PR-URL: https://github.com/nodejs/node/pull/32495 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gus Caplan <me@gus.host>

view details

Robert Nagy

commit sha 0d0f151a46b36483af15e355afc81d1693c98fb0

stream: emit 'pause' on unpipe unpipe should use pause() instead of mutating state.flowing directly so that pausing side effects such as emitting 'pause' are properly performed. Fixes: https://github.com/nodejs/node/issues/32470 PR-URL: https://github.com/nodejs/node/pull/32476 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

view details

Myles Borins

commit sha 113c04c524062b3dcd642e9f9f6784346924360e

2020-03-26 Version 13.12.0 (Current) macOS package notarization and a change in builder configuration: The macOS binaries for this release, and future 13.x releases, are now being compiled on macOS 10.15 (Catalina) with Xcode 11 to support package notarization, a requirement for installing on .pkg files on macOS 10.15 and later. Previous builds of Node.js 13.x were compiled on macOS 10.11 (El Capitan) with Xcode 10. As binaries are still being compiled to support a minimum of macOS 10.10 (Yosemite) we do not anticipate this having a negative impact on Node.js 13.x users with older versions of macOS. Notable changes: * build: * macOS package notarization (Rod Vagg) https://github.com/nodejs/node/pull/31459 * deps: * upgrade npm to 6.14.4 (Ruy Adorno) https://github.com/nodejs/node/pull/32495 * update to uvwasi 0.0.6 (Colin Ihrig) https://github.com/nodejs/node/pull/32309 * upgrade to libuv 1.35.0 (Colin Ihrig) https://github.com/nodejs/node/pull/32204 * lib: * add --disable-proto option to cli (Gus Caplan) https://github.com/nodejs/node/pull/32279 * node_report: * move diagnostic reports to stable (Colin Ihrig) https://github.com/nodejs/node/pull/32242 * worker: * allow URL in Worker constructor (Antoine du HAMEL) https://github.com/nodejs/node/pull/31664 * util: * use a global symbol for `util.promisify.custom` (ExE Boss) https://github.com/nodejs/node/pull/31672 PR-URL: https://github.com/nodejs/node/pull/32376

view details

push time in 5 days

pull request commentnodejs/node

benchmark: benchmarking impacts of async hooks on promises

Is there an issue for continuation of this work (I mean further optimization)?

I did a simple experiment recently. I have removed emit resolve call from PromiseWrap, so that C++ to JS calls (at least, for resolve hook) don't happen in this benchmark. It did almost no impact on the benchmark result: increase for the async_hooks enabled scenario was around 10-15%. This makes me thinking that C++ to JS calls are less expensive than PromiseWrap itself, at least in this benchmark.

legendecas

comment created time in 6 days

Pull request review commenthazelcast/hazelcast

fix: measure ReplicatedMap operations latency in nanoseconds and report in milliseconds

 public long getPutOperationCount() {         return putCount;     } -    public void incrementPuts(long latency) {+    public void incrementPutsNanos(long latencyNanos) {         PUT_COUNT.incrementAndGet(this);-        TOTAL_PUT_LATENCIES.addAndGet(this, latency);-        setMax(this, MAX_PUT_LATENCY, latency);+        TOTAL_PUT_LATENCIES.addAndGet(this, latencyNanos);+        setMax(this, MAX_PUT_LATENCY, latencyNanos);     }      @Override     public long getGetOperationCount() {         return getCount;     } -    public void incrementGets(long latency) {+    public void incrementGetsNanos(long latencyNanos) {         GET_COUNT.incrementAndGet(this);-        TOTAL_GET_LATENCIES.addAndGet(this, latency);-        setMax(this, MAX_GET_LATENCY, latency);+        TOTAL_GET_LATENCIES.addAndGet(this, latencyNanos);+        setMax(this, MAX_GET_LATENCY, latencyNanos);     }      @Override     public long getRemoveOperationCount() {         return removeCount;     } -    public void incrementRemoves(long latency) {+    public void incrementRemovesNanos(long latencyNanos) {         REMOVE_COUNT.incrementAndGet(this);-        TOTAL_REMOVE_LATENCIES.addAndGet(this, latency);-        setMax(this, MAX_REMOVE_LATENCY, latency);+        TOTAL_REMOVE_LATENCIES.addAndGet(this, latencyNanos);+        setMax(this, MAX_REMOVE_LATENCY, latencyNanos);     } +    @Probe(name = REPLICATED_MAP_METRIC_TOTAL_PUT_LATENCIES, unit = MS)     @Override     public long getTotalPutLatency() {-        return totalPutLatencies;+        return convertNanosToMillis(totalPutLatenciesNanos);     } +    @Probe(name = REPLICATED_MAP_METRIC_TOTAL_GET_LATENCIES, unit = MS)     @Override     public long getTotalGetLatency() {-        return totalGetLatencies;+        return convertNanosToMillis(totalGetLatenciesNanos);     } +    @Probe(name = REPLICATED_MAP_METRIC_TOTAL_REMOVE_LATENCIES, unit = MS)     @Override     public long getTotalRemoveLatency() {-        return totalRemoveLatencies;+        return convertNanosToMillis(totalRemoveLatenciesNanos);     } +    @Probe(name = REPLICATED_MAP_MAX_GET_LATENCY, unit = MS)     @Override     public long getMaxPutLatency() {-        return maxPutLatency;+        return maxPutLatencyNanos;

Nice catch. I don't know why I didn't notice this. 😅

alex-dukhno

comment created time in 6 days

pull request commentnodejs/node

async_hooks: move to lazy destroy hook registration in AsyncResource

@puzpuzpuz it's on the list rn, but I need a bit more time as I have a lot to do in the next few days.

I didn't know that. Thanks for the clarification!

puzpuzpuz

comment created time in 6 days

pull request commentnodejs/node

async_hooks: move to lazy destroy hook registration in AsyncResource

@vdeturckheim is it too much to ask you to take a look at this PR?

puzpuzpuz

comment created time in 6 days

push eventpuzpuzpuz/hazelcast-jet

Andrey Pechkurov

commit sha 693939f227ac1891199c29d22defae9d3ad2c747

Fix test compilation

view details

push time in 6 days

issue commentnodejs/node

AsyncLocalStorage benchmark broken

@mcollina thanks for reporting this issue. For some reasons, I was able to reproduce it only with wrk, but not with autocannon. Nevertheless, it should be fixed by #32503.

mcollina

comment created time in 6 days

push eventpuzpuzpuz/node

Andrey Pechkurov

commit sha 39374a2243ae41daf6651e893593c19b8a00351d

benchmark: fix error on server close in AsyncLocalStorage benchmark

view details

push time in 6 days

PR opened nodejs/node

benchmark: fix error on server close in ALS benchmark

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md -->

Closes #32501

Fixes AsyncLocalStorage type from benchmark/async_hooks/async-resource-vs-destroy.js by adding undefined check for the store (CLS context). Before this fix it could fail when the server is closed (and ALS instance is disabled), which may lead to calls to getCLS() method of the benchmark in the following part of the request handling code:

   setTimeout(() => {
      // the server may be already closed when this (and the next one) callback is run
      readFile(__filename, () => {
        res.setHeader('content-type', 'application/json');
        res.end(JSON.stringify({ cls: getCLS() }));
      });
    }, 10);

Other types within the benchmark already had similar checks, so that's why they weren't failing.

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x] tests and/or benchmarks are included
  • [x] commit message follows commit guidelines

<!-- Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

+6 -0

0 comment

1 changed file

pr created time in 6 days

push eventpuzpuzpuz/node

Andrey Pechkurov

commit sha 7fda47327fdfebf13d8ee399f042c91db1c1b17e

benchmark: fix error on server close in ALS benchmark

view details

push time in 6 days

create barnchpuzpuzpuz/node

branch : fix-async-resource-vs-destroy-benchmark

created branch time in 6 days

push eventpuzpuzpuz/node

Robert Nagy

commit sha eeccd52b4ef2db3219fc76737bb00c1da669aea2

net: make readable/writable start as true `net.Socket` is slightly breaking stream invariants by having readable/writable going from `false` to `true`. Streams assume that readable/writable starts out `true` and then goes to `false` through `push(null)`/`end()` after which it never goes back to `true`, e.g. once a stream is `writable == false` it is assumed it will never become `true`. This PR changes 2 things: Unless explicitly set to `false` through options: - starts as `readable`/`writable` `true` by default. - uses `push(null)`/`end()` to set `readable`/`writable` to `false`. Note that this would cause the socket to emit the `'end'`/`'finish'` events, which it did not do previously. In the case it is explicitly set to `false` through options` it is assumed to never become `true`. PR-URL: https://github.com/nodejs/node/pull/32272 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Eric Dobbertin

commit sha f92df338321ac528747ea2374dd72d95bdd1059a

doc: import clarifications with links to MDN PR-URL: https://github.com/nodejs/node/pull/31479 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>

view details

Richard Lau

commit sha f467b9b5e2cddc66c875d776aa49aed236d7b0c2

build: annotate markdown lint failures in pull requests Add a problem matcher for output from remark-lint to our lint-md GitHub Actions CI workflow so that any markdown linter failures are annotated in the pull request in the web UI. Signed-off-by: Richard Lau <riclau@uk.ibm.com> PR-URL: https://github.com/nodejs/node/pull/32391 Refs: https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md Refs: https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>

view details

Rich Trott

commit sha 43922a55ea35c2ceb376e9c62e542ee4f696f1d0

doc: improve wording in esm.md Simplify complex sentence. Remove use of "straightforward". PR-URL: https://github.com/nodejs/node/pull/32427 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Rich Trott

commit sha c78d3f22560fb6d7080713c3a77b3759b088dfd0

doc: improve wording in vm.md Simplify complex sentence. Remove use of "straightforward". PR-URL: https://github.com/nodejs/node/pull/32427 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

James M Snell

commit sha d0c0e20bc2b2e122919b05697df7b4874678be3b

test: refactoring / cleanup on child-process tests PR-URL: https://github.com/nodejs/node/pull/32078 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Richard Lau

commit sha 066bdec64352278ed324a1bb680f5422e00a3aa5

doc: fix lint warning in doc/api/esm.md Signed-off-by: Richard Lau <riclau@uk.ibm.com> PR-URL: https://github.com/nodejs/node/pull/32462 Refs: https://github.com/nodejs/node/pull/31479 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Michael Dawson

commit sha f4153c2fe7b54744e2201e397e1ac8345f222432

doc: add new TSC members Refs: https://github.com/nodejs/TSC/issues/829 Refs: https://github.com/nodejs/TSC/issues/832 Refs: https://github.com/nodejs/TSC/issues/831 Signed-off-by: Michael Dawson <michael_dawson@ca.ibm.com> PR-URL: https://github.com/nodejs/node/pull/32473 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Robert Nagy

commit sha 9e3eddc75dde9df9356264b42bd30facb82583cd

stream: add pipeline test for destroy of returned stream Adds a test to ensure that destroying the returned stream of pipeline will cause a premature close error. PR-URL: https://github.com/nodejs/node/pull/32425 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

view details

Robert Nagy

commit sha 05f1df520064475a255d8956f9e1b6f4bf4c8543

stream: fix pipeline with dest in objectMode pipeline did not support destination with generator that does not return strings or buffers. PR-URL: https://github.com/nodejs/node/pull/32414 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Robert Nagy

commit sha 388cef61e8a4859b7505f7b5cf988eba27ce17b4

stream: align stream.Duplex with net.Socket stream.Duplex and net.Socket slightly differs in behavior. Especially when it comes to the case where one side never becomes readable or writable. This aligns Duplex with the behavior of Socket. PR-URL: https://github.com/nodejs/node/pull/32139 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Harshitha KP

commit sha 2fa74e3e38bb028339e48763138456b3ed10ed97

report: handle on-fatalerror better --report-on-fatalerror was not honored properly, as there was no way to check the value which was stored in the Environment pointer which can be inaccessible under certain fatal error situations. Move the flag out of Environment pointer so that this is doable. Co-authored-by: Shobhit Chittora schittora@paypal.com PR-URL: https://github.com/nodejs/node/pull/32207 Fixes: https://github.com/nodejs/node/issues/31576 Refs: https://github.com/nodejs/node/pull/29881 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>

view details

Anna Henningsen

commit sha b950daf8368cb9ab7f190b74774e55b20e17dec9

src: use single ObjectTemplate for TextDecoder `ObjectTemplate`s are not garbage-collected like regular objects (for some reason). It is sufficient to create a single template anyway, so do that to address the memory leak. Fixes: https://github.com/nodejs/node/issues/32424 PR-URL: https://github.com/nodejs/node/pull/32426 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

view details

himself65

commit sha dade90db9c64040f3bfc0ebb6d7556277e7de5a1

src: enhance C++ sprintf utility PR-URL: https://github.com/nodejs/node/pull/32385 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>

view details

Rich Trott

commit sha f0a33d99ec4656b87bebb97162837047b52eb6f8

doc: simplify and correct example descriptions in net.md Instead of indicating that examples show lines to change in previous examples, present the examples as standalone items. They suffice on their own. In the first of these, it says to change "the second line" of a previous example, but if it were literally changed to the provided line, it would result in a syntax error. In the second of these, it gives the wrong line to change. All of this is unnecessary and probably makes the examples harder to follow. So simplify and treat each one as a separate example. PR-URL: https://github.com/nodejs/node/pull/32451 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

push time in 6 days

issue commentnodejs/node

AsyncLocalStorage benchmark broken

Thanks for CCing me @vdeturckheim

I'll also try to reproduce the problem on my machine today.

mcollina

comment created time in 6 days

PR opened hazelcast/hazelcast-jet

Bump IMDG dependency to 4.0.1-SNAPSHOT

EE counterpart PR: https://github.com/hazelcast/hazelcast-jet-enterprise/pull/113

+1 -1

0 comment

1 changed file

pr created time in 6 days

create barnchpuzpuzpuz/hazelcast-jet

branch : v4.0.z/bump-imdg-dependency

created branch time in 6 days

fork puzpuzpuz/hazelcast-jet

Open-Source Distributed Stream and Batch Processing

https://jet-start.sh

fork in 6 days

delete branch puzpuzpuz/hazelcast-simulator

delete branch : fix-readme-typos

delete time in 6 days

Pull request review commenthazelcast/hazelcast

fix: measure ReplicatedMap operations latency in nanoseconds and report in milliseconds

 private Object remove(InternalReplicatedMapStorage<K, V> storage, Object key) {             storage.remove(marshalledKey, current);         }         if (replicatedMapConfig.isStatisticsEnabled()) {-            getStats().incrementRemoves(Clock.currentTimeMillis() - time);+            getStats().incrementRemoves(System.nanoTime() - time);

This call with nanos instead of millis as the argument automatically changes unit for maxRemoveLatency (and other max*Latency fields) in LocalReplicatedMapStatsImpl to nanos. Thus, they should be converted when reading the probe and when serializing stats to JSON, like it's done in LocalMapStatsImpl.

alex-dukhno

comment created time in 6 days

Pull request review commenthazelcast/hazelcast

fix: measure ReplicatedMap operations latency in nanoseconds and report in milliseconds

 private Object remove(InternalReplicatedMapStorage<K, V> storage, Object key) {             storage.remove(marshalledKey, current);         }         if (replicatedMapConfig.isStatisticsEnabled()) {-            getStats().incrementRemoves(Clock.currentTimeMillis() - time);+            getStats().incrementRemoves(System.nanoTime() - time);

nit: rename argument of #incrementRemoves() to latencyNanos and, optionally, rename the method itself to #incrementRemovesLatencyNanos (see LocalMapStatsImpl for example). The same consideration applies to other #increment*() methods.

alex-dukhno

comment created time in 6 days

Pull request review commenthazelcast/hazelcast

fix: measure ReplicatedMap operations latency in nanoseconds and report in milliseconds

 public void fromJson(JsonObject json) {         ownedEntryCount = getLong(json, "ownedEntryCount", -1L);         ownedEntryMemoryCost = getLong(json, "ownedEntryMemoryCost", -1L);         creationTime = getLong(json, "creationTime", -1L);-        totalGetLatencies = getLong(json, "totalGetLatencies", -1L);-        totalPutLatencies = getLong(json, "totalPutLatencies", -1L);-        totalRemoveLatencies = getLong(json, "totalRemoveLatencies", -1L);+        totalGetLatenciesNanos = convertMillisToNanos(getLong(json, "totalGetLatencies", -1L));+        totalPutLatenciesNanos = convertMillisToNanos(getLong(json, "totalPutLatencies", -1L));+        totalRemoveLatenciesNanos = convertMillisToNanos(getLong(json, "totalRemoveLatencies", -1L));         maxGetLatency = getLong(json, "maxGetLatency", -1L);         maxPutLatency = getLong(json, "maxPutLatency", -1L);         maxRemoveLatency = getLong(json, "maxRemoveLatency", -1L);     } +    private static long convertNanosToMillis(long nanos) {

nit: extract this and the following one methods into a common module (say, TimeUtil) and reuse them here and in LocalMapStats.

alex-dukhno

comment created time in 6 days

issue closednodejs/node

FinalizationGroup in combination with buffers seems to allocate memory without releasing it

<!-- Thank you for reporting a possible bug in Node.js.

Please fill in as much of the template below as you can.

Version: output of node -v Platform: output of uname -a (UNIX), or version and 32 or 64-bit (Windows) Subsystem: if known, please specify the affected core module name

If possible, please provide code that demonstrates the problem, keeping it as simple and free of external dependencies as you can. -->

  • Version: v12.13.1
  • Platform: Linux apechkurov-laptop 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: Buffer, FinalizationGroup API

<!-- Please provide more details below this comment. -->

Recently I was working on an experimental Buffer pool implementation based on FinalizationGroup API (see #30683) and encountered a weirdness that I'd like clarify. It seems that node doesn't free memory when FinalizationGroup is used to track Buffers (as "holdings") under certain conditions. This issue may be related with off-heap memory allocator or OS memory behavior, but I'd like to confirm that.

Here is the most simple reproducer that I could find:

'use strict';

const fg = new FinalizationGroup(finalizer);

// 8 ticks, 1GB per each => 8GB total
const ticks = 8;
const bufsPerTick = 1024;
const size = 1024 * 1024;

let slices = [];
let tick = 0;
setInterval(() => {
  tick += 1;
  if (tick === ticks) console.log('Registered all slices');
  if (tick > ticks) {
    slices = [];
    return;
  }

  slices = [];
  for (let i = 0; i < bufsPerTick; i++) {
    const buf = Buffer.alloc(size);
    const slice = buf.slice();
    slices.push(slice);
    fg.register(slice, buf);
  }
}, 500);

let finalized = 0;
function finalizer(iter) {
  for (const _ of iter) {
    finalized += 1;
    if (finalized === ticks * bufsPerTick)
      console.log('All finalizer callbacks are triggered');
  }
}

When this script is run under --harmony-weak-refs flag, node process consumes about 2GB of physical memory on my machine (and about 2.5GB of virtual memory) and that value doesn't decrease even after 10 minutes.

On the other hand, if you comment the fg.register(slice, buf); line, you'll see that resident memory consumption eventually goes down to ~32KB (virtual is ~600MB).

Once again, I'm not sure if that's a bug, but I'd like to understand the reason of such behavior.

closed time in 6 days

puzpuzpuz

issue commentnodejs/node

FinalizationGroup in combination with buffers seems to allocate memory without releasing it

Closing this one, as it doesn't seem to be related with node or v8. Feel free to comment if you also experience the same behavior.

puzpuzpuz

comment created time in 6 days

delete branch puzpuzpuz/hazelcast

delete branch : v4.0.1/defect/random-target-invocation-for-invoke-on-target-mc-ops

delete time in 7 days

push eventhazelcast/hazelcast

Andrey Pechkurov

commit sha 236031ac71ba98d96a0b3bd6a04ffd08049d655a

Disallow random target invocation for certain MC operations (#16797)

view details

push time in 7 days

PR merged hazelcast/hazelcast

Disallow random target invocation for certain MC operations Team: Management Center Type: Defect
  • Mitigates https://github.com/hazelcast/management-center/issues/2753 by marking invoke-on-exact-member MC operations with invocation.disallowRetryOnRandom()
  • IOExceptions thrown in the edge case when the target is not yet known by the client will be handled on MC side
+26 -3

0 comment

2 changed files

puzpuzpuz

pr closed time in 7 days

push eventpuzpuzpuz/hazelcast

Andrey Pechkurov

commit sha d06bb3c19158830e30268978add2d4bb32a2a0a5

Fix tests

view details

push time in 7 days

push eventpuzpuzpuz/hazelcast

Andrey Pechkurov

commit sha 43c1170680145bc627fba7f19027b5613a78a692

Fix tests

view details

push time in 7 days

PR opened hazelcast/hazelcast

Disallow random target invocation for certain MC operations Team: Management Center Type: Defect
  • Mitigates https://github.com/hazelcast/management-center/issues/2753 by marking invoke-on-exact-member MC operations with invocation.disallowRetryOnRandom()
  • IOExceptions thrown in the edge case when the target is not yet known by the client will be handled on MC side
+19 -0

0 comment

1 changed file

pr created time in 7 days

push eventpuzpuzpuz/hazelcast

Andrey Pechkurov

commit sha bb148f0e53018f3ba5192e31d1cdf756a69a4c4a

Disallow random target invocation for certain MC operations

view details

push time in 7 days

push eventpuzpuzpuz/hazelcast

Andrey Pechkurov

commit sha 878406371f4567d962f58074a8e90cc35063b74d

Convert MC message tasks to AbstractTargetMessageTask (early draft)

view details

push time in 7 days

PR closed hazelcast/hazelcast

Fix MC related message tasks that execute operation on exact member Source: Internal Team: Management Center Type: Defect
  • Fixes the following issue related with MC client operations: https://github.com/hazelcast/management-center/issues/2753
+29401 -207

1 comment

40 changed files

puzpuzpuz

pr closed time in 7 days

pull request commenthazelcast/hazelcast

Fix MC related message tasks that execute operation on exact member

Closing this PR as it's not relevant for 4.0.z. See https://github.com/hazelcast/management-center/issues/2753#issuecomment-603722944 for more details.

puzpuzpuz

comment created time in 7 days

Pull request review commenthazelcast/hazelcast

fix: measure ReplicatedMap gets latency in milliseconds

 public Object removeWithVersion(Object key, long version) {     @SuppressWarnings("unchecked")     private Object remove(InternalReplicatedMapStorage<K, V> storage, Object key) {         isNotNull(key, "key");-        long time = Clock.currentTimeMillis();+        long time = System.nanoTime();

Changes in this class seem to be unrelated. #16781 is meant to address the problem across the whole code base.

alex-dukhno

comment created time in 7 days

Pull request review commenthazelcast/hazelcast

fix: measure ReplicatedMap gets latency in milliseconds

 protected Object processResponseBeforeSending(Object response) {         ReplicatedMapService replicatedMapService = getService(ReplicatedMapService.SERVICE_NAME);         if (replicatedMapService.getReplicatedMapConfig(parameters.name).isStatisticsEnabled()) {             LocalReplicatedMapStatsImpl stats = replicatedMapService.getLocalReplicatedMapStatsImpl(parameters.name);-            stats.incrementGets(System.nanoTime() - startTimeNanos);+            stats.incrementGets(TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTimeNanos));

I believe this is the right way to do.

I agree. We should do the same here.

alex-dukhno

comment created time in 8 days

pull request commenthazelcast/hazelcast

fix: measure ReplicatedMap gets latency in milliseconds

@blazember could you take a look at this PR?

alex-dukhno

comment created time in 8 days

push eventpuzpuzpuz/hazelcast-client-protocol

Andrey Pechkurov

commit sha 14b567ac99e56c4d8bc8ec359604e1e28b107395

Add member UUID parameters to run-on-target MC operations

view details

push time in 8 days

push eventpuzpuzpuz/hazelcast

Andrey Pechkurov

commit sha a2d2fabd13ffb67de5102fb39a45950421726772

Update client codecs for MC operations

view details

push time in 8 days

push eventpuzpuzpuz/hazelcast-client-protocol

Andrey Pechkurov

commit sha 4d7651b98d2cd8790fb978e828ab3ecaadd1d6c5

Add member UUID parameters to run-on-target MC operations

view details

push time in 8 days

push eventpuzpuzpuz/hazelcast

Andrey Pechkurov

commit sha 2396d92fdd693623438deb1c3a56c7110595d84f

Convert ReadMetricsMessageTask into AbstractTargetMessageTask

view details

push time in 8 days

push eventpuzpuzpuz/hazelcast-client-protocol

Andrey Pechkurov

commit sha f5ef16f08850599398e428c60c18221072713a4a

Add member UUID parameters to run-on-target MC operations

view details

push time in 8 days

push eventpuzpuzpuz/hazelcast-client-protocol

Metin Dumandag

commit sha 9152338ccbc2a5273d43464f6a47eb73d3849f14

[BACKPORT] Add codec versioning support (#310) * add ability to add new parameters to codecs * update implementation * Removed the hasNext check from the custom codec tempalate since custom codecs always have an end frame at the end. We should only check whether or not the next frame is an end frame or not. * Put newly added fix sized params to begin frame We don't encode an initial frame if the custom type does not have any fix sized parameters. However, if the custom type is extended with a new fix sized parameter, new codecs will try to encode/decode an initial frame which will broke the communication between old clients/members since they don't expect an initial frame. Therefore, if the custom type is extended with a fix sized parameter, we encode the data into the begin frame * relax schma validation for the since values and check ordering of parameters

view details

Andrey Pechkurov

commit sha 117fb41f907da4c294b15040c602907de27f469c

Add member UUID parameters to run-on-target MC operations

view details

push time in 8 days

push eventpuzpuzpuz/hazelcast

Can Gencer

commit sha d7835dddd75a2c755e85d6dfbf3e31813d7f545b

Make logging of version, cluster name and ip optional (#16630) Currently these are always logged, creating a lot of noise in logs. If you just have a single node running, this information isn’t useful but makes the logs much harder to read, obscuring important messages. This PR introduces the “hazelcast.logging.details.enabled” property which makes this optional.

view details

Grzegorz Gierlach

commit sha a97c79dfe406e23148dcbcceb9226866559ba8ef

Expose BufferObjectDataInput creation based on byte[] and offset (#16716)

view details

Mesut Celik

commit sha 06d826806490869fe1212debf8f99891fd268b2b

dependency version upgrades for hazelcast 4.0

view details

Mesut Celik

commit sha 5e52d15d473394d3de7b77759b7688f832c41c62

Merge pull request #16731 from mesutcelik/dep [BACKPORT] dependency version upgrades for hazelcast 4.0

view details

Grzegorz Gierlach

commit sha 001ee35a30b5daaabdb724d22cb2e9896db96ed7

Add Serializer unique type id javadoc (#16735)

view details

Grzegorz Gierlach

commit sha 8b1d7d90bb6eb1379900b23887a1c86a07659cb3

Allow AbstractSerializationService.serializerFor() to be overridden (#16721) Allow AbstractSerializationService.serializerFor() to be overridden

view details

Grzegorz Gierlach

commit sha ed53d6dcade283b4d39472c4646464e5df3130e9

Add default Serializer.destroy(). (#16733)

view details

Metin Dumandag

commit sha 942b4afa6f42160bdc31a602a2cdbb6609b58bad

[BACKPORT] add codec versioning support (#16719) * add codec versioning support * improve messagec comparision logic to handle addition of new custom types to custom types

view details

Grzegorz Gierlach

commit sha c7a0675accce5244c416eb1443227b17546e76ee

Remove dependency to InternalSerializationService from StreamSerializerAdapter (#16764)

view details

sancar

commit sha e49e2f92473bfb3263510853271c8619b5a78536

Add class loading related exceptions to client factory (cherry picked from commit 03db8a090484d3730d358818dea0cebcd500a657)

view details

sancar

commit sha 8a8b630a54345336e2d92a1c73ad9f998843f648

Improve failed client authentication message fixes https://github.com/hazelcast/hazelcast/issues/15099 (cherry picked from commit d228db51820396c0499710e305a0c396e8a03096)

view details

Zoltán Baranyi

commit sha 7ce74e7e8214384023df89027ab239e02c8267bf

[BACKPORT] Add type information to the Metrics MBeans (#16748) Fixes #16729

view details

Alex Dukhno

commit sha 98bdabbf69c293eb6488a866ca4f5162010aefb1

added executor creation time metric (#16774) * exposed executor creation time metric * added creation time to executor jmx bean

view details

sancar

commit sha 21e00d4d1698f36f39591a6f673525f08509de1c

Fix reliable topic and ring buffer client permissions Missing ring buffer and reliable topic permission tests are added. In this pr, we add a ring buffer config per reliable topic config into the permissions list as fix. fixes https://github.com/hazelcast/hazelcast/issues/16703 (cherry picked from commit 454ba85f2249cc419fd41a490f50a606090db180)

view details

Grzegorz Gierlach

commit sha 0384245b66c0d06c56bf9c205fc7facf8ff8585e

Promote IMap.putAllAsync and IMap.submitToKeys to public API (#16771) Promote IMap.putAllAsync and IMap.submitToKeys to public API Backport of https://github.com/hazelcast/hazelcast/pull/16704

view details

Josef Cacek

commit sha efdc2e86ae0c57ea2513a29f3ebd1badaef1e32f

Allow to protect management operations on client protocol (#16759) * Allow to protect management operations on client protocol. The protection is based on client connection source IP address.

view details

sancar

commit sha b29edb9d784fddd210fbd714b6108603051f9169

Add ability to disallow on random target for ClientInvocations New API usage: ClientInvocation invocation = new ClientInvocation(client, request, objectName, target); invocation.disallowRetryOnRandom(); invocation.invoke() fixes https://github.com/hazelcast/hazelcast/issues/16653 (cherry picked from commit 4930f2efec2de7b42d042cd5031ef70f574fdb3a)

view details

Andrey Pechkurov

commit sha 35de3923a4d7435c85c7c9e9765da2582b8681bc

Convert ReadMetricsMessageTask into AbstractTargetMessageTask

view details

push time in 8 days

push eventpuzpuzpuz/node

Jan Krems

commit sha 07a1fb953e1ecbd98c93cde96b6b0bca7e3aecbd

module: add hook for global preload code PR-URL: https://github.com/nodejs/node/pull/32068 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>

view details

Hassaan Pasha

commit sha 116a30b04f2ee254c0f9a7d1b747580affa4bd0e

deps: upgrade openssl sources to 1.1.1e This updates all sources in deps/openssl/openssl by: $ cd deps/openssl/ $ rm -rf openssl $ tar zxf ~/tmp/openssl-1.1.1e.tar.gz $ mv openssl-1.1.1e openssl $ git add --all openssl $ git commit openssl PR-URL: https://github.com/nodejs/node/pull/32328 Fixes: https://github.com/nodejs/node/issues/32210 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Hassaan Pasha

commit sha 425b9620310f182d0a1f0126500b6de2b061255b

deps: adjust openssl configuration for 1.1.1e The scripts used by make were modified to correctly reference the source files that were originially in crypto/include/internal, but got moved to include/crypto. The base path has been left unaltered since that would require too many changes PR-URL: https://github.com/nodejs/node/pull/32328 Fixes: https://github.com/nodejs/node/issues/32210 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Hassaan Pasha

commit sha ec144d562825a042b4002951035f844920c16bd9

deps: update archs files for OpenSSL-1.1.1e 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/include PR-URL: https://github.com/nodejs/node/pull/32328 Fixes: https://github.com/nodejs/node/issues/32210 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Hassaan Pasha

commit sha 3d0f2257be48eb881c30c14e2bd7275533be3011

test: discard data received by client This test was timing out after update to OpenSSL-1.1.1e. PR-URL: https://github.com/nodejs/node/pull/32328 Fixes: https://github.com/nodejs/node/issues/32210 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Sam Roberts

commit sha 6b5f82d7f8fd865f2a009a58dcad1af3adf464c8

test: end tls connection with some data In openssl-1.1.1e the client doesn't seem to like having the TLS connection shut down with no data sent, so send an empty string. A number of related issues showed up in the TLS1.3 port, so this is not entirely surprising. PR-URL: https://github.com/nodejs/node/pull/32328 Fixes: https://github.com/nodejs/node/issues/32210 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Anna Henningsen

commit sha f2cc28aec3e7e938d070f04466055509961d7acb

test: use InitializeNodeWithArgs in cctest Refs: https://github.com/nodejs/node/commit/d7f11077f15f52a2db191d3a5bcc41581cb7361f Fixes: https://github.com/nodejs/node/issues/30257 PR-URL: https://github.com/nodejs/node/pull/32406 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Anna Henningsen

commit sha 678e1be6aa145b99397342bb4a00440ba4bf4999

src: delete CallbackInfo when cleared from cleanup hook Fixes: https://github.com/nodejs/node/issues/32400 PR-URL: https://github.com/nodejs/node/pull/32405 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Anna Henningsen

commit sha f2b0fb270d23489524a66812642964b0bd3c21bc

src: simplify IsolateData shortcut accesses PR-URL: https://github.com/nodejs/node/pull/32407 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>

view details

Anna Henningsen

commit sha 668bc11c1bbca429281ffdc78a9d4dda3d34af30

src: delete BaseObjectWeakPtr data when pointee is gone Fix the condition for deleting the underlying data pointed to by a `BaseObjectWeakPtr`, which erroneously skipped that deletion when `ptr->get()` was `nullptr`. This fixes a memory leak reported by some of the tests. Refs: https://github.com/nodejs/node/pull/30374#issuecomment-601848973 PR-URL: https://github.com/nodejs/node/pull/32393 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Rod Vagg

commit sha 10d8e2687e9217ff3c5722b2b3293cf1f0e81ae9

doc: add note re term-size commit on top of npm Until npm updates update-notifier to a newer version, the dependency tree will contain a version of term-size that has an unsigned macOS binary. This will fail .pkg notarization and will result in failed release builds. We built and signed a term-size and contributed it back to the project for this purpose, but the dependency chain is long enough that it's not likely to be included in a new npm very quickly. Until it is, we need to cherry-pick commit d2f08a1bdb ontop of any npm updates to master and any other release branch that includes notarization. PR-URL: https://github.com/nodejs/node/pull/32403 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Rich Trott

commit sha 96f06e6482b36e90687c9f767356020279f1bd9e

test: use mustCall in place of countdown in timers test Use common.mustCall() in place of countdown in test-timers-immediate-unref. PR-URL: https://github.com/nodejs/node/pull/32416 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

push time in 8 days

issue commenthazelcast/hazelcast-nodejs-client

Hazelcast queue - Write in queue with REST CLIENT and poll entry with NodeJs client

I've tried to reproduce this issue locally and here is what I've found. When an item is added into a queue, it's implicitly serialized with RestValue type. On the other hand, Node.js client doesn't support this type and that's why you see this error.

Looks like we should add support for RestValue into the client.

@NutellaTorte As a temp workaround, you could register a custom serializer for this type. Please let me know if this option works for you and I'll implement it and share the result with you with some instructions.

burakcelebi

comment created time in 9 days

PR opened nodejs/node

async_hooks: move to lazy destroy hook registration in AsyncResource

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md -->

Adds a check into AsyncResource constructor, so that registerDestroyHook only gets called when requireManualDestroy is false and there are no active destroy hooks (previously the check only included requireManualDestroy value). As below benchmark shows this eliminates a certain overhead related with additional tracking of these objects as a part of GC cycle.

This scenario is important considering AsyncLocalStorage API which only uses init hooks.

Important note. Obviously, this PR changes the behavior in the following edge case: previously when an AsyncResource was created (but not yet destroyed) before enabling the first destroy hook, the hook would be called for the resource. With this change it's not called.

Related discussion thread: https://github.com/petkaantonov/bluebird/pull/1472#issuecomment-352104689

cc @addaleax @vdeturckheim @Qard @Flarna (sorry for such long CC list, but I think all of you might be interested)

Benchmarks

Before this change:

$ ./node benchmark/async_hooks/gc-tracking.js 
async_hooks/gc-tracking.js method="trackingEnabled" n=1000000: 3,338,788.791796874
async_hooks/gc-tracking.js method="trackingDisabled" n=1000000: 79,598,226.36048095

After this change:

$ ./node benchmark/async_hooks/gc-tracking.js 
async_hooks/gc-tracking.js method="trackingEnabled" n=1000000: 73,493,075.92334495
async_hooks/gc-tracking.js method="trackingEnabledWithDestroyHook" n=1000000: 2,497,582.277915421
async_hooks/gc-tracking.js method="trackingDisabled" n=1000000: 79,170,025.7848857

Note: trackingEnabledWithDestroyHook scenario was added as a replacement for the old trackingEnabled scenario.

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x] tests and/or benchmarks are included
  • [x] documentation is changed or added
  • [x] commit message follows commit guidelines

<!-- Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

+14 -2

0 comment

3 changed files

pr created time in 10 days

push eventpuzpuzpuz/node

Andrey Pechkurov

commit sha 61f84965c17da773004345ce0c78894743421534

async_hooks: move to lazy destroy hook registration in AsyncResource

view details

push time in 10 days

create barnchpuzpuzpuz/node

branch : async-resource-lazy-destroy

created branch time in 10 days

push eventpuzpuzpuz/node

Rod Vagg

commit sha 78a2dc7de2139cc51cf4992da7d835eed0b69c32

deps: update term-size with signed version PR-URL: https://github.com/nodejs/node/pull/31459 Refs: https://github.com/nodejs/node/issues/29216 Refs: https://github.com/sindresorhus/macos-term-size/pull/3 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ash Cripps <ashley.cripps@ibm.com> Signed-off-by: Rod Vagg <rod@vagg.org>

view details

Anna Henningsen

commit sha d7bc5816a5d88e18d7ede081042d87f48a2bc54b

src: make `FreeEnvironment()` perform all necessary cleanup Make the calls `stop_sub_worker_contexts()`, `RunCleanup()` part of the public API for easier embedding. (Note that calling `RunAtExit()` is idempotent because the at-exit callback queue is cleared after each call.) PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha 288382a4ce4c1eb5d6eaccf698099804f6a3697d

src: fix memory leak in CreateEnvironment when bootstrap fails PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha 64c01222d9b62942f356048026742a7c8d778cef

src: move worker_context from Environment to IsolateData Workers are fully in control of their Isolates, and this helps avoid a problem with later changes to `CreateEnvironment()` because now we can run the boostrapping code inside the latter. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha 084c3796483a15da102480b2c5a1496417b5d7cf

src: associate is_main_thread() with worker_context() In our codebase, the assumption generally is that `!is_main_thread()` means that the current Environment belongs to a Node.js Worker thread. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha a9fb51f9be570001accfce8a057e885827655a2f

src: align worker and main thread code with embedder API This addresses some long-standing TODOs by Joyee and me about making the embedder API more powerful and us less reliant on internal APIs for creating the main thread and Workers. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha c44edec4daff9f478eb9b5820d03da6c71253787

src: provide a variant of LoadEnvironment taking a callback This allows embedders to flexibly control how they start JS code rather than using `third_party_main`. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha 7dead8440c7ee28131cf496daa7c286eecfd90c7

src: add LoadEnvironment() variant taking a string Allow passing a string as the main module rather than using the callback variant. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha 2561484dcb17035f847705940cb61634493196c8

test: re-enable cctest that was commented out Refs: https://github.com/nodejs/node/pull/31910 PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha 821e21de8cb96bb549ea01bcb59c8bb0e27e218a

src: add unique_ptr equivalent of CreatePlatform This makes this bit of the embedder situation a bit easier to use. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha d7f11077f15f52a2db191d3a5bcc41581cb7361f

src: make InitializeNodeWithArgs() official public API This is a decent replacement for the to-be-deprecated Init() API. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha 7e0264d9328d823c5f7d49391d5e2ec44d84c35c

src: add ability to look up platform based on `Environment*` This should eventually remove any necessity to use the global-state `GetMainThreadMultiIsolatePlatform()`. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha 887b6a143b132b1820d161c50d439db38d09aeb1

src: allow non-Node.js TracingControllers We do not need a Node.js-provided `v8::TracingController`, generally. Loosen that restriction in order to make it easier for embedders to provide their own subclass of `v8::TracingController`, or none at all. Refs: https://github.com/electron/electron/commit/9c36576dddfaecde1298ff3e089d21a6e54fe67f PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Jichan

commit sha 0e576740dc9ef10203884fd631cef4456b0f3a7c

src: fix what a dispose without checking If created platform with CreatePlatform, the crash occurs because it does not check if it was initialized to v8_platform when DisposePlatform was called. Refs: https://github.com/nodejs/node/pull/31260 Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha a8cf886de723437cecbf220ad4e32eef301fde71

src: shutdown platform from FreePlatform() There is currently no way to properly do this. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha 43d32b073f42a1544ebd907f4050d03c9a65f26d

src,test: add full-featured embedder API test PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha e04f599258bb8e733a507867d42d5e46d35d7bca

doc: add basic embedding example documentation PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Anna Henningsen

commit sha 2061c336709939fec9549254d6d8b072b3685fbd

test: add extended embedder cctest Add an embedder cctest that also covers a multi-Environment situation, including worker_threads-style inspector support. Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com> PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Michaël Zasso

commit sha d23eed256b2ba2c594011f6957fbabe2568c8751

src: remove calls to deprecated ArrayBuffer methods v8::ArrayBuffer::IsExternal and v8::ArrayBuffer::Externalize are no longer necessary. PR-URL: https://github.com/nodejs/node/pull/32358 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>

view details

Sam Roberts

commit sha 1d49558273adec600a947596b7dbff236953c3d2

Revert "build: add asan check in Github action" This reverts commit 3ec4b21b1c438255df6f1652377011080dc28052. See: https://github.com/nodejs/node/issues/32257 PR-URL: https://github.com/nodejs/node/pull/32324 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>

view details

push time in 10 days

issue commentnodejs/node

Deprecate destroy hook of async_hooks

Interesting. Thanks for sharing this context!

I guess that as a user-land overhead mitigation a Promise library, like bluebird, could be used instead of native promises. But most of such libraries aren't integrated with AsyncResource.

legendecas

comment created time in 10 days

issue commentnodejs/node

Deprecate destroy hook of async_hooks

Thanks for the clarification, @addaleax

If the overhead is in C++ to JS calls, it's not that simple to get rid of it.

legendecas

comment created time in 10 days

issue commentnodejs/node

Deprecate destroy hook of async_hooks

I’m not sure I understand – this is what’s already happening, for all hooks, right? They are not emitted, and there is no call from C++ to JS, when there are no listeners.

Hmm, then my understanding seems to be wrong. Is RegisterDestroyHook and its callers the right place to look in to understand how it's implemented?

Do you also have any hints on why Promises usage increase the overhead of AsyncLocalStorage (and, thus, init async hook) when compared with plain callbacks?

legendecas

comment created time in 10 days

issue commentnodejs/node

Deprecate destroy hook of async_hooks

Does it make sense to create another issue for not emitting destroy events for async resources (including promises) when there are no active destroy hooks?

I don't know how expensive AsyncWrap::WeakCallback is (I may be wrong when pointing to this method) and whether this or something else in PromiseWrap acts as a bottleneck in AsyncLocalStorage use case, so any feedback from async_hooks maintainers is welcome.

legendecas

comment created time in 10 days

startednodejs/node

started time in 11 days

push eventpuzpuzpuz/node

Bartosz Sosnowski

commit sha 1a844a6f3a6695c9a6ad88218b13d473359833a2

doc: expand fs.watch caveats Document Windows specific fs.watch caveats. Fixes: https://github.com/nodejs/node/issues/31702 PR-URL: https://github.com/nodejs/node/pull/32176 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Ruben Bridgewater

commit sha 9c18ff64405776ac6fff6e48f24ed0214423bcb2

repl: align preview with the actual executed code This adds preview output for input that may not be wrapped. PR-URL: https://github.com/nodejs/node/pull/32154 Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Ruben Bridgewater

commit sha e322f74ce1f8ff3ce1224a7ea9264542871aec3b

test: refactor and simplify test-repl-preview Use an object to indicate which part belongs to the input and which to the output. On top of that this also simplifies the expected output by automatically inserting the default repl line for previews and by automatically checking for the correct output line length. PR-URL: https://github.com/nodejs/node/pull/32154 Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Guy Bedford

commit sha 04028aac3a59548a57f4c79b03b9e8a0c6b4b25d

doc: update conditional exports recommendations Co-Authored-By: Geoffrey Booth <GeoffreyBooth@users.noreply.github.com> PR-URL: https://github.com/nodejs/node/pull/32098 Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>

view details

Antoine du HAMEL

commit sha a8b3d7b26b8be875a60cf3b137e6614f1fc8bffb

worker: allow URL in Worker constructor The explicit goal is to let users use `import.meta.url` to re-load thecurrent module inside a Worker instance. Fixes: https://github.com/nodejs/node/issues/30780 PR-URL: https://github.com/nodejs/node/pull/31664 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

view details

Harshitha KP

commit sha 4fedb702b221469a65f0f2bc267ae08c8159e72a

test: use portable EOL The test wanted to cut huge string into 1KB strings, for which a new line character was inserted at appropriate places. The value is different in Windows (10, 13). Make it portable, by making use of os.EOL semantics Refs: https://github.com/nodejs/node/issues/25988 PR-URL: https://github.com/nodejs/node/pull/32104 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Mateusz Krawczuk

commit sha 4ffb39bdfe033353f6f3a35698c04af51ab08d99

http2: rename counter in `mapToHeaders` inner loop This change is to prevent potential bugs - e.g., someone might automatically use the variable `k` instead of `key`, that is used in vicinity of this loop. Also changed postincrement to preincrement in iteration steps. It is probably done by the optimizer anyway, but otherwise it will save an opcode each iteration. And it is a good practice. PR-URL: https://github.com/nodejs/node/pull/32012 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Harshitha KP

commit sha 16cce385c0e6d1fc633e0499d70e99be561ad76f

test: add new scenario for async-local storage Add a new scenario of multiple clients sharing a single data callback function managing their response data through AsyncLocalStorage APIs Refs: https://github.com/nodejs/node/pull/32063 Refs: https://github.com/nodejs/node/issues/32060 Refs: https://github.com/nodejs/node/issues/32062#issuecomment-593957787 Co-authored-by: Gireesh Punathil <gpunathi@in.ibm.com> PR-URL: https://github.com/nodejs/node/pull/32082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Matheus Marchini

commit sha 75da64c0587f2925319cd9c1717a19b647b93511

deps: V8: cherry-pick f9257802c1c0 Original commit message: Fix scanner-level error reporting for hashbang When the file begins with a hashbang, the scanner is in a failed state when SkipHashbang() is called. This is usually not an issue but when the parser encounters an ILLEGAL token, it will reset the SyntaxError location because of it. Bug: v8:10110 Change-Id: I1c7344bf5ad20079cff80130c991f3bff4d7e9a8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1995312 Reviewed-by: Toon Verwaest <verwaest@chromium.org> Commit-Queue: Toon Verwaest <verwaest@chromium.org> Cr-Commit-Position: refs/heads/master@{#66038} Refs: https://github.com/v8/v8/commit/f9257802c1c0a0663a1d05bacf662283f6bd9050 Fixes: https://github.com/nodejs/node/issues/31284 Signed-off-by: Matheus Marchini <mmarchini@netflix.com> PR-URL: https://github.com/nodejs/node/pull/32180 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Bradley Farias

commit sha 417d847de2b5e7d1eec96f099f6e20593e1a97b8

util: text decoding allows SharedArrayBuffer PR-URL: https://github.com/nodejs/node/pull/32203 Fixes: https://github.com/nodejs/node/issues/32199 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

Anna Henningsen

commit sha 605615e5f33df41a307a0921f451b6dabb89410c

esm: port loader code to JS There is no reason for this to be in C++. Using JavaScript means that the code is more accessible to more developers, which is important for any Node.js feature. This also simplifies the code significantly in some areas. On the technical side, this potentially also enables making some of the file system operations that are involved asynchronous. PR-URL: https://github.com/nodejs/node/pull/32201 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>

view details

cjihrig

commit sha ec204d86b06e4cc9259c1308e365a3e104212a16

test: verify that WASI errors are rethrown This commit adds a test to verify that exceptions thrown from a WASI application are properly caught and rethrown. This also gets the code coverage in lib/wasi.js back to 100%. PR-URL: https://github.com/nodejs/node/pull/32157 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

cjihrig

commit sha 907bcad8757534b2a3cfe9bf6b8325313f01050d

deps: upgrade to libuv 1.35.0 Notable changes: - The UV_UDP_MMSG_CHUNK UDP flag has been added. - Support has been dropped for FreeBSD < 10. - The FreeBSD and Linux system call logic has been simplified to assume the presence of features covered by libuv's minimum system requirements. - Listening on IPC pipes is no longer allowed. - Fix iOS and Android builds. PR-URL: https://github.com/nodejs/node/pull/32204 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

view details

Rich Trott

commit sha 3967f865e12a98152ceb4196adf0ae2a3c8bb304

tools: update to acorn@7.1.1 Update acorn to 7.1.1 in the dev dependencies for the markdown linter. Refs: https://app.snyk.io/vuln/SNYK-JS-ACORN-559469 Signed-off-by: Rich Trott <rtrott@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32259 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>

view details

Matheus Marchini

commit sha 86f146a2c0ff08df79fd99efb238e44c75b73381

test: make test-memory-usage predictable The current test relies on undeterministic behavior from V8 GC, and on newer versions of V8 this test ocasionally fails because that behavior changed. Prevent that from happening using --predictable-gc-schedule. If this test fails in the future, it should fail consistently instead of ocasionally, which should help debug. Ref: https://github.com/nodejs/node-v8/issues/144#issuecomment-597945219 Signed-off-by: Matheus Marchini <mmarchini@netflix.com> PR-URL: https://github.com/nodejs/node/pull/32239 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

cjihrig

commit sha 8617508d6b44a31abd904173cba6ca934bc094d2

src: fix warn_unused_result compiler warning ../src/node_file.cc:386:7: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result] PR-URL: https://github.com/nodejs/node/pull/32241 Refs: https://github.com/nodejs/node/pull/31972 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

cjihrig

commit sha a6bd2c2f81a0a238bf0f45174fee70b7870f8ef2

src: unconditionally include report feature This commit removes all #ifdef NODE_REPORT checks in the src directory. PR-URL: https://github.com/nodejs/node/pull/32242 Fixes: https://github.com/nodejs/node/issues/26293 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

view details

cjihrig

commit sha f1d3d927e1225f0b8a959d36024788bd65600c5b

build: remove node_report option in node.gyp PR-URL: https://github.com/nodejs/node/pull/32242 Fixes: https://github.com/nodejs/node/issues/26293 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

view details

cjihrig

commit sha 765c3759eff73851bdc5c4f1f8f63819eed9a2e9

build: make --without-report a no-op This commit makes the configure --without-report flag a no-op. This commit also updates a test that depends on the report CLI flags being conditionally present. PR-URL: https://github.com/nodejs/node/pull/32242 Fixes: https://github.com/nodejs/node/issues/26293 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

view details

cjihrig

commit sha 4c64e7c59a655142367a361bae873683208b9f9b

test: remove common.skipIfReportDisabled() The report feature won't ever be disabled moving forward, so checking for its existence in the tests is no longer needed. PR-URL: https://github.com/nodejs/node/pull/32242 Fixes: https://github.com/nodejs/node/issues/26293 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

view details

push time in 11 days

issue openedhazelcast/hazelcast

Migrate from System.currentTimeMillis() to System.nanoTime() based clock for elapsed time measurements

Current code base uses com.hazelcast.internal.util.Clock (backed by System.currentTimeMillis()) in many places where we need to measure passed time. Here are some of them:

  • https://github.com/hazelcast/hazelcast/blob/97ff57ba92dc1fbfa77720885e7db40757999080/hazelcast/src/main/java/com/hazelcast/client/impl/connection/nio/HeartbeatManager.java#L75 - client heart beats
  • https://github.com/hazelcast/hazelcast/blob/97ff57ba92dc1fbfa77720885e7db40757999080/hazelcast/src/main/java/com/hazelcast/client/impl/connection/nio/WaitStrategy.java#L55 - client reconnect strategies
  • https://github.com/hazelcast/hazelcast/blob/97ff57ba92dc1fbfa77720885e7db40757999080/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java#L1363 - Raft heart beats

And it seems that we don't do anything to prevent problems related with the lack of monotonicity of System.currentTimeMillis(). So, we need to introduce another method in Clock interface (or a separate interface for elapsed time measurements, like it's done in #16780) backed by System.nanoTime() and start using it in such places in both IMDG OSS and EE.

created time in 12 days

Pull request review commenthazelcast/hazelcast

Allow to protect management operations on client protocol

+/*+ * Copyright (c) 2008-2020, Hazelcast, Inc. All Rights Reserved.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++package com.hazelcast.client.impl.management;++import static java.util.concurrent.TimeUnit.SECONDS;+import static org.hamcrest.CoreMatchers.instanceOf;+import static org.hamcrest.CoreMatchers.is;+import static org.junit.Assert.assertFalse;+import static org.junit.Assert.assertThat;+import static org.junit.Assert.assertTrue;+import static org.junit.Assert.fail;++import java.security.AccessControlException;+import java.util.ArrayList;+import java.util.Random;+import java.util.UUID;+import java.util.concurrent.ExecutionException;++import org.junit.After;+import org.junit.Before;+import org.junit.Test;+import org.junit.experimental.categories.Category;+import org.junit.runner.RunWith;++import com.hazelcast.client.AuthenticationException;+import com.hazelcast.client.config.ClientConfig;+import com.hazelcast.client.impl.ClientDelegatingFuture;+import com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl;+import com.hazelcast.client.impl.clientside.HazelcastClientProxy;+import com.hazelcast.client.impl.protocol.ClientMessage;+import com.hazelcast.client.impl.protocol.codec.MCAddWanBatchPublisherConfigCodec;+import com.hazelcast.client.impl.protocol.codec.MCApplyMCConfigCodec;+import com.hazelcast.client.impl.protocol.codec.MCChangeClusterStateCodec;+import com.hazelcast.client.impl.protocol.codec.MCChangeClusterVersionCodec;+import com.hazelcast.client.impl.protocol.codec.MCChangeWanReplicationStateCodec;+import com.hazelcast.client.impl.protocol.codec.MCCheckWanConsistencyCodec;+import com.hazelcast.client.impl.protocol.codec.MCClearWanQueuesCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetCPMembersCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetClusterMetadataCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetMapConfigCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetMemberConfigCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetSystemPropertiesCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetThreadDumpCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetTimedMemberStateCodec;+import com.hazelcast.client.impl.protocol.codec.MCInterruptHotRestartBackupCodec;+import com.hazelcast.client.impl.protocol.codec.MCMatchMCConfigCodec;+import com.hazelcast.client.impl.protocol.codec.MCPollMCEventsCodec;+import com.hazelcast.client.impl.protocol.codec.MCPromoteLiteMemberCodec;+import com.hazelcast.client.impl.protocol.codec.MCPromoteToCPMemberCodec;+import com.hazelcast.client.impl.protocol.codec.MCRemoveCPMemberCodec;+import com.hazelcast.client.impl.protocol.codec.MCResetCPSubsystemCodec;+import com.hazelcast.client.impl.protocol.codec.MCRunConsoleCommandCodec;+import com.hazelcast.client.impl.protocol.codec.MCRunGcCodec;+import com.hazelcast.client.impl.protocol.codec.MCRunScriptCodec;+import com.hazelcast.client.impl.protocol.codec.MCShutdownClusterCodec;+import com.hazelcast.client.impl.protocol.codec.MCShutdownMemberCodec;+import com.hazelcast.client.impl.protocol.codec.MCTriggerForceStartCodec;+import com.hazelcast.client.impl.protocol.codec.MCTriggerHotRestartBackupCodec;+import com.hazelcast.client.impl.protocol.codec.MCTriggerPartialStartCodec;+import com.hazelcast.client.impl.protocol.codec.MCUpdateMapConfigCodec;+import com.hazelcast.client.impl.protocol.codec.MCWanSyncMapCodec;+import com.hazelcast.client.impl.spi.impl.ClientInvocation;+import com.hazelcast.client.impl.spi.impl.ClientInvocationFuture;+import com.hazelcast.client.test.TestHazelcastFactory;+import com.hazelcast.config.Config;+import com.hazelcast.core.HazelcastInstance;+import com.hazelcast.test.HazelcastParallelClassRunner;+import com.hazelcast.test.HazelcastTestSupport;+import com.hazelcast.test.annotation.ParallelJVMTest;+import com.hazelcast.test.annotation.QuickTest;++@RunWith(HazelcastParallelClassRunner.class)+@Category({ QuickTest.class, ParallelJVMTest.class })+public class MCTrustedInterfacesTest extends HazelcastTestSupport {++    HazelcastInstance client;+    HazelcastInstance member;+    private TestHazelcastFactory factory;++    @Before+    public void setUp() {+        factory = new TestHazelcastFactory();++        Config config = smallInstanceConfig();+        config.getManagementCenterConfig().addTrustedInterface("222.222.222.222");+        member = factory.newHazelcastInstance(config);+        client = factory.newHazelcastClient();+    }++    @After+    public void tearDown() {+        factory.shutdownAll();+    }++    @Test+    public void testGetSystemPropertiesMessageTask_passing() throws Exception {+        HazelcastInstance client = factory.newHazelcastClient(new ClientConfig(), "222.222.222.222");+        HazelcastClientInstanceImpl clientImpl = ((HazelcastClientProxy) client).client;+        ClientInvocation invocation = new ClientInvocation(+                clientImpl,+                MCGetSystemPropertiesCodec.encodeRequest(),+                null+        );++        ClientDelegatingFuture<MCGetSystemPropertiesCodec.ResponseParameters> future = new ClientDelegatingFuture<>(+                invocation.invoke(),+                clientImpl.getSerializationService(),+                MCGetSystemPropertiesCodec::decodeResponse+        );++        MCGetSystemPropertiesCodec.ResponseParameters response = future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS);+        assertFalse(response.systemProperties.isEmpty());+    }+++    @Test+    public void testAddWanBatchPublisherConfigMessageTask() throws Exception {+        Random random = new Random();++        ClientMessage clientMessage = MCAddWanBatchPublisherConfigCodec.encodeRequest(randomString(), randomString(),+                randomString(), randomString(), random.nextInt(), random.nextInt(), random.nextInt(), random.nextInt(),+                random.nextInt(), random.nextInt());++        assertFailureOnUntrustedInterface(clientMessage);+    }++    @Test+    public void testApplyMCConfigMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCApplyMCConfigCodec.encodeRequest(randomString(), 999, new ArrayList<>()));+    }++    @Test+    public void testChangeClusterStateMessageTask() throws Exception {+        ClientMessage clientMessage = MCChangeClusterStateCodec.encodeRequest(888);+        assertFailureOnUntrustedInterface(clientMessage);+    }++    @Test+    public void testChangeClusterVersionMessageTask() throws Exception {+        ClientMessage clientMessage = MCChangeClusterVersionCodec.encodeRequest((byte) 8, (byte) 10);+        assertFailureOnUntrustedInterface(clientMessage);+    }++    @Test+    public void testChangeWanReplicationStateMessageTask() throws Exception {+        ClientMessage clientMessage = MCChangeWanReplicationStateCodec.encodeRequest(randomString(), randomString(),+                (byte) 127);+        assertFailureOnUntrustedInterface(clientMessage);+    }++    @Test+    public void testCheckWanConsistencyMessageTask() throws Exception {+        ClientMessage clientMessage = MCCheckWanConsistencyCodec.encodeRequest(randomString(), randomString(), randomString());+        assertFailureOnUntrustedInterface(clientMessage);+    }++    @Test+    public void testClearWanQueuesMessageTask() throws Exception {+        ClientMessage clientMessage = MCClearWanQueuesCodec.encodeRequest(randomString(), randomString());+        assertFailureOnUntrustedInterface(clientMessage);+    }++    @Test+    public void testGetClusterMetadataMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCGetClusterMetadataCodec.encodeRequest());+    }++    @Test+    public void testGetCPMembersMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCGetCPMembersCodec.encodeRequest());+    }++    @Test+    public void testGetMapConfigMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCGetMapConfigCodec.encodeRequest(randomString()));+    }++    @Test+    public void testGetMemberConfigMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCGetMemberConfigCodec.encodeRequest());+    }++    @Test+    public void testGetSystemPropertiesMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCGetSystemPropertiesCodec.encodeRequest());+    }++    @Test+    public void testGetThreadDumpMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCGetThreadDumpCodec.encodeRequest(false));+    }++    @Test+    public void testGetTimedMemberStateMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCGetTimedMemberStateCodec.encodeRequest());+    }++    @Test+    public void testHotRestartInterruptBackupMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCInterruptHotRestartBackupCodec.encodeRequest());+    }++    @Test+    public void testHotRestartTriggerBackupMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCTriggerHotRestartBackupCodec.encodeRequest());+    }++    @Test+    public void testHotRestartTriggerForceStartMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCTriggerForceStartCodec.encodeRequest());+    }++    @Test+    public void testHotRestartTriggerPartialStartMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCTriggerPartialStartCodec.encodeRequest());+    }++    @Test+    public void testMatchMCConfigMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCMatchMCConfigCodec.encodeRequest(randomString()));+    }++    @Test+    public void testPollMCEventsMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCPollMCEventsCodec.encodeRequest());+    }++    @Test+    public void testPromoteLiteMemberMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCPromoteLiteMemberCodec.encodeRequest());+    }++    @Test+    public void testPromoteToCPMemberMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCPromoteToCPMemberCodec.encodeRequest());+    }++    @Test+    public void testRemoveCPMemberMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCRemoveCPMemberCodec.encodeRequest(UUID.randomUUID()));+    }++    @Test+    public void testResetCPSubsystemMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCResetCPSubsystemCodec.encodeRequest());+    }++    @Test+    public void testRunConsoleCommandMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCRunConsoleCommandCodec.encodeRequest(randomString(), "help"));+    }++    @Test+    public void testRunGCMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCRunGcCodec.encodeRequest());+    }++    @Test+    public void testRunScriptMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCRunScriptCodec.encodeRequest(randomString(), randomString()));+    }++    @Test+    public void testShutdownClusterMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCShutdownClusterCodec.encodeRequest());+        assertTrue(member.getLifecycleService().isRunning());+    }++    @Test+    public void testShutdownMemberMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCShutdownMemberCodec.encodeRequest());+        assertTrue(member.getLifecycleService().isRunning());+    }++    @Test+    public void testUpdateMapConfigMessageTask() throws Exception {+        assertFailureOnUntrustedInterface(MCUpdateMapConfigCodec.encodeRequest(randomString(), 100, 200, 0, false, 100, 0));+    }++    @Test+    public void testWanSyncMapMessageTask() throws Exception {+        ClientMessage clientMessage = MCWanSyncMapCodec.encodeRequest(randomString(), randomString(), 0, randomString());+        assertFailureOnUntrustedInterface(clientMessage);+    }++    private void assertFailureOnUntrustedInterface(ClientMessage clientMessage) throws Exception {+        ClientInvocation invocation = new ClientInvocation(((HazelcastClientProxy) client).client, clientMessage, null);+        ClientInvocationFuture future = invocation.invoke();+        try {+            future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS);+            fail("AuthenticationException was expected.");

nit: change to AccessControlException was expected.

kwart

comment created time in 12 days

Pull request review commenthazelcast/hazelcast

Allow to protect management operations on client protocol

+/*+ * Copyright (c) 2008-2020, Hazelcast, Inc. All Rights Reserved.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++package com.hazelcast.client.impl.management;++import static java.util.concurrent.TimeUnit.SECONDS;+import static org.hamcrest.CoreMatchers.instanceOf;+import static org.hamcrest.CoreMatchers.is;+import static org.junit.Assert.assertFalse;+import static org.junit.Assert.assertThat;+import static org.junit.Assert.assertTrue;+import static org.junit.Assert.fail;++import java.security.AccessControlException;+import java.util.ArrayList;+import java.util.Random;+import java.util.UUID;+import java.util.concurrent.ExecutionException;++import org.junit.After;+import org.junit.Before;+import org.junit.Test;+import org.junit.experimental.categories.Category;+import org.junit.runner.RunWith;++import com.hazelcast.client.AuthenticationException;+import com.hazelcast.client.config.ClientConfig;+import com.hazelcast.client.impl.ClientDelegatingFuture;+import com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl;+import com.hazelcast.client.impl.clientside.HazelcastClientProxy;+import com.hazelcast.client.impl.protocol.ClientMessage;+import com.hazelcast.client.impl.protocol.codec.MCAddWanBatchPublisherConfigCodec;+import com.hazelcast.client.impl.protocol.codec.MCApplyMCConfigCodec;+import com.hazelcast.client.impl.protocol.codec.MCChangeClusterStateCodec;+import com.hazelcast.client.impl.protocol.codec.MCChangeClusterVersionCodec;+import com.hazelcast.client.impl.protocol.codec.MCChangeWanReplicationStateCodec;+import com.hazelcast.client.impl.protocol.codec.MCCheckWanConsistencyCodec;+import com.hazelcast.client.impl.protocol.codec.MCClearWanQueuesCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetCPMembersCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetClusterMetadataCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetMapConfigCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetMemberConfigCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetSystemPropertiesCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetThreadDumpCodec;+import com.hazelcast.client.impl.protocol.codec.MCGetTimedMemberStateCodec;+import com.hazelcast.client.impl.protocol.codec.MCInterruptHotRestartBackupCodec;+import com.hazelcast.client.impl.protocol.codec.MCMatchMCConfigCodec;+import com.hazelcast.client.impl.protocol.codec.MCPollMCEventsCodec;+import com.hazelcast.client.impl.protocol.codec.MCPromoteLiteMemberCodec;+import com.hazelcast.client.impl.protocol.codec.MCPromoteToCPMemberCodec;+import com.hazelcast.client.impl.protocol.codec.MCRemoveCPMemberCodec;+import com.hazelcast.client.impl.protocol.codec.MCResetCPSubsystemCodec;+import com.hazelcast.client.impl.protocol.codec.MCRunConsoleCommandCodec;+import com.hazelcast.client.impl.protocol.codec.MCRunGcCodec;+import com.hazelcast.client.impl.protocol.codec.MCRunScriptCodec;+import com.hazelcast.client.impl.protocol.codec.MCShutdownClusterCodec;+import com.hazelcast.client.impl.protocol.codec.MCShutdownMemberCodec;+import com.hazelcast.client.impl.protocol.codec.MCTriggerForceStartCodec;+import com.hazelcast.client.impl.protocol.codec.MCTriggerHotRestartBackupCodec;+import com.hazelcast.client.impl.protocol.codec.MCTriggerPartialStartCodec;+import com.hazelcast.client.impl.protocol.codec.MCUpdateMapConfigCodec;+import com.hazelcast.client.impl.protocol.codec.MCWanSyncMapCodec;+import com.hazelcast.client.impl.spi.impl.ClientInvocation;+import com.hazelcast.client.impl.spi.impl.ClientInvocationFuture;+import com.hazelcast.client.test.TestHazelcastFactory;+import com.hazelcast.config.Config;+import com.hazelcast.core.HazelcastInstance;+import com.hazelcast.test.HazelcastParallelClassRunner;+import com.hazelcast.test.HazelcastTestSupport;+import com.hazelcast.test.annotation.ParallelJVMTest;+import com.hazelcast.test.annotation.QuickTest;++@RunWith(HazelcastParallelClassRunner.class)+@Category({ QuickTest.class, ParallelJVMTest.class })+public class MCTrustedInterfacesTest extends HazelcastTestSupport {

Looks like a test for MCReadMetricsCodec is missing in this test.

kwart

comment created time in 12 days

issue commenthazelcast/hazelcast

Management Center beans broken

Hi @ofek

Clustered JMX and REST APIs in Hazelcast Management Center are Enterprise features. That means that you need to configure a license key in order to use them.

ofek

comment created time in 12 days

Pull request review commenthazelcast/hazelcast

Allow to protect management operations on client protocol

 public String getMethodName() {     public Object[] getParameters() {         return new Object[] {parameters.uuid, parameters.fromSequence};     }++    @Override+    public boolean isManagementTask() {

Sounds good. Marking this one as resolved.

kwart

comment created time in 13 days

Pull request review commenthazelcast/hazelcast

exposed executor creation time metric

             .newUpdater(LocalExecutorStatsImpl.class, "totalStartLatency");     private static final AtomicLongFieldUpdater<LocalExecutorStatsImpl> TOTAL_EXECUTION_TIME = AtomicLongFieldUpdater             .newUpdater(LocalExecutorStatsImpl.class, "totalExecutionTime");++    @Probe(name = EXECUTOR_METRIC_CREATION_TIME, unit = MS)     private long creationTime;

This field has to be marked as volatile or final in order to guarantee safe publication.

@blazember I can see that we use volatile for the same field in LocalMapStatsImpl, but not in LocalQueueStatsImpl, or LocalTopicStatsImpl, or LocalPNCounterStatsImpl, or many other stats classes. It looks like incorrect concurrent code to me. Maybe I'm missing something. Do you happen to know the reason for this?

alex-dukhno

comment created time in 14 days

Pull request review commenthazelcast/hazelcast

exposed executor creation time metric

 protected ExecutorServiceMBean(IExecutorService managedObject, ManagementService         this.objectName = service.createObjectName("IExecutorService", managedObject.getName());     } +    @ManagedAnnotation("localCreationTime")+    @ManagedDescription("the creation time of this executor on this member.")+    public long getCreationTime() {

It's better to rename this method to #getLocalCreationTime for the sake of consistency with other methods from this bean.

alex-dukhno

comment created time in 14 days

Pull request review commenthazelcast/hazelcast

exposed executor creation time metric

 protected ExecutorServiceMBean(IExecutorService managedObject, ManagementService         this.objectName = service.createObjectName("IExecutorService", managedObject.getName());     } +    @ManagedAnnotation("localCreationTime")+    @ManagedDescription("the creation time of this executor on this member.")

nit: remove the trailing dot (it's not used in descriptions for other fields here)

alex-dukhno

comment created time in 14 days

Pull request review commenthazelcast/hazelcast

Add ability to disallow on random target for ClientInvocations

 private void invokeOnSelection() {             if (!urgent) {                 invocationService.checkInvocationAllowed();             }++             if (isBindToSingleConnection()) {-                invocationService.invokeOnConnection(this, (ClientConnection) connection);-            } else if (partitionId != -1) {-                invocationService.invokeOnPartitionOwner(this, partitionId);-            } else if (uuid != null) {-                invocationService.invokeOnTarget(this, uuid);+                boolean invoked = invocationService.invokeOnConnection(this, (ClientConnection) connection);+                if (!invoked) {+                    notifyException(new IOException("Could not invoke on connection " + connection));+                }+                return;+            }++            boolean invoked;+            if (isSmartRoutingEnabled) {+                if (partitionId != -1) {+                    invoked = invocationService.invokeOnPartitionOwner(this, partitionId);+                } else if (uuid != null) {+                    invoked = invocationService.invokeOnTarget(this, uuid);+                } else {+                    invoked = invocationService.invokeOnRandomTarget(this);+                }+                if (allowRetryOnRandom && !invoked) {+                    invoked = invocationService.invokeOnRandomTarget(this);+                }             } else {-                invocationService.invokeOnRandomTarget(this);+                invoked = invocationService.invokeOnRandomTarget(this);

How about invokeOnAvailableTarget name for this method?

sancar

comment created time in 14 days

issue openedhazelcast/hazelcast-nodejs-client

Update year in copyright headers

We need to update year to 2020.

created time in 14 days

issue commenthazelcast/hazelcast

Switch latency traking in DS stats to System.nanoTime()

cc @pveentjer

puzpuzpuz

comment created time in 14 days

issue openedhazelcast/hazelcast

Switch latency traking in DS stats to System.nanoTime()

@alex-dukhno found that we use System.currentTimeMillis() for latency tracking in maps: https://github.com/hazelcast/hazelcast/blob/40cadaef1f4e944d17f77a220704e964c9af6351/hazelcast/src/main/java/com/hazelcast/replicatedmap/impl/record/AbstractReplicatedRecordStore.java#L195

So, under certain conditions we may have zero or even negative latency values. We should start using System.nanoTime() (for latency tracking, at least) which has better granularity and monotonicity guarantees. That could be implemented by changing default implementation of com.hazelcast.internal.util.Clock, but such change should be made very cautiously to avoid regressions in other modules that consume Clock implementations.

cc @emre-aydin @mmedenjak

created time in 14 days

Pull request review commenthazelcast/hazelcast

Allow to protect management operations on client protocol

 public String getMethodName() {     public Object[] getParameters() {         return new Object[] {parameters.uuid, parameters.fromSequence};     }++    @Override+    public boolean isManagementTask() {

The thing is that MC connection (the one with MCJVM connection type) is not not reliable marker for security restrictions. That's why this PR implements restrictions on per operation basis.

As for marking "read metrics" task as a non-MC one (thus, removing the whitelist restriction), I don't see this clearly stated in requirements. But as it may make some sense in future, I decided to start this discussion.

kwart

comment created time in 14 days

pull request commentnodejs/node

[v12.x backport] async_hooks: add executionAsyncResource

CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/2310/

Overall this needs to be watched carefully as it might introduce regressions.

Thanks for running a CITGM build. The changes in this PR may introduce some regressions, indeed.

I can see 20 failures in this build, but I'm not sure if they're related with this PR or they're false positives. I can see that other builds also fail with similar (if not the same) errors.

puzpuzpuz

comment created time in 15 days

Pull request review commenthazelcast/hazelcast

Allow to protect management operations on client protocol

 default void init(Properties properties) {      */     Credentials newCredentials(); +    /**+     * Creates new {@link Credentials} object for given target {@link Address}.+     *+     * @param address Target {@link Address} (may be {@code null})+     * @return+     */+    default Credentials newCredentials(Address address) {

Is this change related with the purpose of the PR? Probably, it's used somewhere, but I'd like to double check.

kwart

comment created time in 15 days

Pull request review commenthazelcast/hazelcast

Allow to protect management operations on client protocol

+/*+ * Copyright (c) 2008-2020, Hazelcast, Inc. All Rights Reserved.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++package com.hazelcast.internal.cluster;++import com.hazelcast.cluster.Address;++/**+ *

nit: write a javadoc instead of this empty stub.

kwart

comment created time in 15 days

Pull request review commenthazelcast/hazelcast

Allow to protect management operations on client protocol

 public String getMethodName() {     public Object[] getParameters() {         return new Object[] {parameters.uuid, parameters.fromSequence};     }++    @Override+    public boolean isManagementTask() {

I'm not sure if we need to mark "read metrics" task as an MC operation and restrict the access to it when trusted interfaces config option is in use. Potentially, we may use it elsewhere, say, build a Jet source that reads IMDG metrics.

@emre-aydin @blazember WDYT?

kwart

comment created time in 15 days

Pull request review commenthazelcast/hazelcast

Allow to protect management operations on client protocol

 protected Throwable peelIfNeeded(Throwable t) {          return peel(t);     }+++    /**+     * The default implementation returns false. Child classes which implements a logic related to a management operation should

nit: typo - Child classes which implements should be Child classes which implement

kwart

comment created time in 15 days

pull request commenthazelcast/hazelcast

Add type information to the Metrics MBeans

Test failure seems to be related with #16206

blazember

comment created time in 15 days

Pull request review commenthazelcast/hazelcast

Add type information to the Metrics MBeans

 public void when_shutdown_noMBeansLeak() throws Exception {     private MetricDescriptor newDescriptor() {         return DEFAULT_DESCRIPTOR_SUPPLIER.get();     }++    private BiTuple<String, List<TriTuple<String, Number, Type>>> metric(String objectName,+                                                                           List<TriTuple<String, Number, Type>> measurements) {

nit: padding seems wrong here (2 extra spaces)

blazember

comment created time in 15 days

pull request commentnodejs/node

test: add new scenario for async-local storage

v12 backport: #32318

HarshithaKP

comment created time in 15 days

pull request commentnodejs/node

[v12.x backport] async_hooks: add executionAsyncResource

Created #32318 as a follow-up backport PR

puzpuzpuz

comment created time in 15 days

pull request commentnodejs/node

async_hooks: add sync enterWith to async storage

v12 backport: #32318

Qard

comment created time in 15 days

pull request commentnodejs/node

async_hooks: fix context loss after nested calls to AsyncLocalStorage

v12 backport: #32318

puzpuzpuz

comment created time in 15 days

pull request commentnodejs/node

test: add GC test for disabled AsyncLocalStorage

v12 backport: #32318

puzpuzpuz

comment created time in 15 days

pull request commentnodejs/node

test: improve disable AsyncLocalStorage test

v12 backport: #32318

puzpuzpuz

comment created time in 15 days

pull request commentnodejs/node

async_hooks: introduce mandatory store argument in AsyncLocalStorage run methods

v12 backport: #32318

puzpuzpuz

comment created time in 15 days

pull request commentnodejs/node

async-hooks: introduce async-storage API

v12 backport: #32318

vdeturckheim

comment created time in 15 days

PR opened nodejs/node

[v12.x backport] async_hooks: add AsyncLocalStorage

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md -->

Depends on #32131

Backports AsyncLocalStorage into v12. Includes the following PRs:

  • #26540
  • #31930
  • #31998
  • #31995
  • #32085
  • #31945
  • #32082
Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x] tests and/or benchmarks are included
  • [x] documentation is changed or added
  • [x] commit message follows commit guidelines

<!-- Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

+1560 -75

0 comment

36 changed files

pr created time in 15 days

push eventpuzpuzpuz/node

vdeturckheim

commit sha ca8bd5e6b1217984208eed0d5848305a8b124807

async_hooks: introduce async-context API Adding AsyncLocalStorage class to async_hooks module. This API provide a simple CLS-like set of features. Co-authored-by: Andrey Pechkurov <apechkurov@gmail.com> PR-URL: https://github.com/nodejs/node/pull/26540 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>

view details

Andrey Pechkurov

commit sha 128eae1f82ddca346088b3180446d68cac62706b

async_hooks: add store arg in AsyncLocalStorage This commit introduces store as the first argument in AsyncLocalStorage's run methods. The change is motivated by the following expectation: most users are going to use a custom object as the store and an extra Map created by the previous implementation is an overhead for their use case. Important note. This is a backwards incompatible change. It was discussed and agreed an incompatible change is ok since the API is still experimental and the modified methods were only added within the last week so usage will be minimal to none. PR-URL: https://github.com/nodejs/node/pull/31930 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Andrey Pechkurov

commit sha 922e2b39ef5d155b6738173758caae3fd3a4e527

test: improve disable AsyncLocalStorage test PR-URL: https://github.com/nodejs/node/pull/31998 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Andrey Pechkurov

commit sha 183754e138cf451cf1cf5ee53e5845294cb86392

test: add GC test for disabled AsyncLocalStorage PR-URL: https://github.com/nodejs/node/pull/31995 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Andrey Pechkurov

commit sha 81ae09caf6c4424ad8dea709629dadf2396c4f35

async_hooks: fix ctx loss after nested ALS calls PR-URL: https://github.com/nodejs/node/pull/32085 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Stephen Belanger

commit sha 7bf98220ceec6d937e534257ec7c1c58cbb6458f

async_hooks: add sync enterWith to ALS This allows transitioning the entire following sync and async execution sub-tree to the given async storage context. With this one can be sure the context binding will remain for any following sync activity and all descending async execution whereas the `run*(...)` methods must wrap everything that is intended to exist within the context. This is helpful for scenarios such as prepending a `'connection'` event to an http server which binds everything that occurs within each request to the given context. This is helpful for APMs to minimize the need for patching and especially adding closures. PR-URL: https://github.com/nodejs/node/pull/31945 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Harshitha KP

commit sha 0abbc6179c6b1ae99cc55995188d9ab6f91da3c7

test: add new scenario for async-local storage Add a new scenario of multiple clients sharing a single data callback function managing their response data through AsyncLocalStorage APIs Refs: https://github.com/nodejs/node/pull/32063 Refs: https://github.com/nodejs/node/issues/32060 Refs: https://github.com/nodejs/node/issues/32062#issuecomment-593957787 Co-authored-by: Gireesh Punathil <gpunathi@in.ibm.com> PR-URL: https://github.com/nodejs/node/pull/32082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

push time in 16 days

create barnchpuzpuzpuz/node

branch : async-local-storage-backport

created branch time in 16 days

pull request commentnodejs/node

[v12.x backport] async_hooks: add executionAsyncResource

Rebased over the latest v12.x-staging. Should be able to pass CI build now.

puzpuzpuz

comment created time in 16 days

push eventpuzpuzpuz/node

Robert Nagy

commit sha 492218431007cd3ddb1f7cdeab7ec3701344d224

doc: fix stream async iterator sample The for await loop into writable loop could cause an unhandled exception in the case where we are waiting for data from the async iterable and this no `'error'` handler is registered on the writable. Fixes: https://github.com/nodejs/node/issues/31222 PR-URL: https://github.com/nodejs/node/pull/31252 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Robert Nagy

commit sha e398137020328a8eff9a72e6d82cadc4f4e9a187

doc: rename iterator to iterable in examples PR-URL: https://github.com/nodejs/node/pull/31252 Fixes: https://github.com/nodejs/node/issues/31222 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Anna Henningsen

commit sha 63af1ab60f7290ae462e0a6f9647ba181244f085

doc: update description of `External` The previous description did not mention what an `External` is and instead only provided some hints around what it is not. Update the description to be more accurate. PR-URL: https://github.com/nodejs/node/pull/31255 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Sebastien Ahkrin

commit sha 2147c29de0b8c53c2f9a8094a1df089099aa413a

lib: add Uint16Array primordials PR-URL: https://github.com/nodejs/node/pull/31210 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Geoffrey Booth

commit sha 97c12f120ee7dc72a67cbac48d8b94e7a0d7ceea

doc: add GeoffreyBooth to collaborators PR-URL: https://github.com/nodejs/node/pull/31306 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>

view details

Alexander Wang

commit sha dd9a6c6c22ccd6981b8a18e9d86bc0ba840d5eb4

doc: fix a code example in zlib.md PR-URL: https://github.com/nodejs/node/pull/31264 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Shelley Vohr

commit sha 21bcc96f92b33751b4b55cc76549f8cde2b7cd5c

src: include uv.h in node_binding header This was removed in https://github.com/nodejs/node/commit/3bb085dbad4d23030c731834e35b2804c8a50b23 but is needed by Electron on Windows, as otherwise compilation errors will occur as a result of unknown libuv types. PR-URL: https://github.com/nodejs/node/pull/31265 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

carterbancroft

commit sha cb40a1a90faf8498c3e0d161983486697ac79938

doc: update README to make Node.js description clearer Fixes: https://github.com/nodejs/node/issues/24872 PR-URL: https://github.com/nodejs/node/pull/31266 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Shelley Vohr

commit sha c719f7ab36b6e3bfb421774ac0baa16212294545

test: allow disabling crypto tests PR-URL: https://github.com/nodejs/node/pull/31268 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Anna Henningsen

commit sha 1fe0065a51d7b8174c2aeee77306114695b77725

fs: add missing HandleScope to FileHandle.close Fixes: https://github.com/nodejs/node/issues/31202 PR-URL: https://github.com/nodejs/node/pull/31276 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

dev-313

commit sha fa0762d663b16508d5d6d0dd24b2482c55aa5a32

doc: improve doc v8.getHeapSpaceStatistics() 'GetHeapSpaceStatistics' Link replaced in v8 getHeapSpaceStatistics function because it was showing 404 page not found. Fixes: https://github.com/nodejs/node/issues/31181 PR-URL: https://github.com/nodejs/node/pull/31274 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Anna Henningsen

commit sha f910f645b943c908cb7b0acf704d427d0fb9f881

http2: skip creating native ShutdownWrap `ShutdownWrap` instances are being used to carry context between the start and the asynchronous end of shutting down the writable side of a `StreamBase`. HTTP/2 streams always perform this action synchronously, so no such object is necessary. PR-URL: https://github.com/nodejs/node/pull/31283 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

gengjiawen

commit sha 6f71efa0ede2572952494c2b1d365b677bd2ea77

tools: add clang-tidy rule in src PR-URL: https://github.com/nodejs/node/pull/26840 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

cclauss

commit sha f6a6638d0c2c1851a8addad508d70fadeb74c068

build: test Python 3 using GitHub Actions-based CI PR-URL: https://github.com/nodejs/node/pull/29474 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Rod Vagg

commit sha 0f4a9e26ef0ee8ca1b9ee242d1a92c0758aeb73d

tools: ensure consistent perms of signed release files Fixes: https://github.com/nodejs/build/issues/1904 PR-URL: https://github.com/nodejs/node/pull/29350 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Anatoli Papirovski

commit sha 597431b1f22629010b02ac2ac55f2fec32db6191

async_hooks: remove internal only error checking This error checking is mostly unnecessary and is just a Node core developer nicety, rather than something that is needed for the user-land. It can be safely removed without any practical impact while making nextTick, timers, immediates and AsyncResource substantially faster. PR-URL: https://github.com/nodejs/node/pull/30967 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Rich Trott

commit sha 20f857fa0171dbcbaba4de06837f985e569b7b76

tools: update JSON header parsing for backticks Methods, events, and so on in headers in our documentation may (and should) be set off with backticks in the raw markdown. When that happens, the headers is misinterpreted by tools/json.js as not being a method or event. Update the JSON tool generator to accommodate backticks in this situation and add a test for this situation. Fixes: https://github.com/nodejs/node/issues/31290 PR-URL: https://github.com/nodejs/node/pull/31294 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

Ruben Bridgewater

commit sha 20167fec5f2f2df2c336a1aa3f3119f154dc112d

test: stricten readline keypress failure test condition This verifies that the thrown error is the expected one. That was not tested before. PR-URL: https://github.com/nodejs/node/pull/31300 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Ruy Adorno

commit sha 7a8963bc755a3e84be70d1ff6c5f2222ed6a9f52

deps: upgrade npm to 6.13.6 PR-URL: https://github.com/nodejs/node/pull/31304 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Robert Nagy

commit sha 6e76752a7b308734d39daf6d675f638680d74992

stream: simplify push PR-URL: https://github.com/nodejs/node/pull/31150 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

push time in 16 days

delete branch puzpuzpuz/node

delete branch : fix-repl-doc-link

delete time in 16 days

PR closed nodejs/node

[v12.x] doc: remove reverse-i-search link doc repl v12.x

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md -->

This PR fixes a make -j4 test error that may be occurs on v12.x-staging:

Running JS linter...
/home/puzpuzpuz/projects/node/tools/doc/allhtml.js:87
  if (!ids.has(match[1])) throw new Error(`link not found: ${match[1]}`);
                          ^

Error: link not found: repl_reverse_i_search
    at Object.<anonymous> (/home/puzpuzpuz/projects/node/tools/doc/allhtml.js:87:33)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    ...
    at internal/main/run_main_module.js:18:47
Makefile:754: recipe for target 'out/doc/api/all.html' failed

The reason for this error is the following. #31256 was backported (https://github.com/nodejs/node/commit/c72fff6711f2157add405cb606a27224e0cda0a0), but it included this this change which depends on #31006 (and this PR wasn't backported).

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x] documentation is changed or added
  • [x] commit message follows commit guidelines

<!-- Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

+74286 -55046

3 comments

1020 changed files

puzpuzpuz

pr closed time in 16 days

pull request commentnodejs/node

[v12.x] doc: remove reverse-i-search link

Closing this one as not relevant anymore.

puzpuzpuz

comment created time in 16 days

pull request commentnodejs/node

async_hooks: prevent async storage methods leaking to outer context

@Qard could you update PR description? Looks like it's outdated (at least, the enabled flag related part of it).

Qard

comment created time in 16 days

Pull request review commentnodejs/node

async_hooks: prevent async storage methods leaking to outer context

 class AsyncLocalStorage {     resource[this.kResourceStore] = store;   } -  runSyncAndReturn(store, callback, ...args) {-    const resource = executionAsyncResource();-    const outerStore = resource[this.kResourceStore];-    this.enterWith(store);-    try {+  run(store, callback, ...args) {+    const resource = new AsyncResource('AsyncLocalStorage');

Considering the fact that AsyncResource is only instantiated here, we could leave it as is, but I'm also fine with both options.

Qard

comment created time in 16 days

more