mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
async_hooks: fix resource stack for deep stacks
460c81dc0e
introduced a bug where the execution resource was not
stored properly if we needed to call into C++ to extend the stack size.
Fix that bug by always storing the resource.
Refs: https://github.com/nodejs/node/pull/34319
Fixes: https://github.com/nodejs/node/issues/34556
PR-URL: https://github.com/nodejs/node/pull/34573
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Gus Caplan <me@gus.host>
This commit is contained in:
parent
a9c5b873ca
commit
2ba93e1db4
2 changed files with 16 additions and 1 deletions
15
test/parallel/test-async-local-storage-deep-stack.js
Normal file
15
test/parallel/test-async-local-storage-deep-stack.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
'use strict';
|
||||
const common = require('../common');
|
||||
const { AsyncLocalStorage } = require('async_hooks');
|
||||
|
||||
// Regression test for: https://github.com/nodejs/node/issues/34556
|
||||
|
||||
const als = new AsyncLocalStorage();
|
||||
|
||||
const done = common.mustCall();
|
||||
|
||||
function run(count) {
|
||||
if (count !== 0) return als.run({}, run, --count);
|
||||
done();
|
||||
}
|
||||
run(1000);
|
Loading…
Add table
Add a link
Reference in a new issue