Closed
Description
- Version: master
- Platform: Linux
- Subsystem: async_hooks / AsyncLocalStorage
What steps will reproduce the bug?
$ ../node run.js async_hooks | tee out
async_hooks/async-resource-vs-destroy.js
async_hooks/async-resource-vs-destroy.js n=1000000 duration=5 connections=500 path="/" asyncMethod="callbacks" type="async-resource" benchmarker="wrk": 22,246.15
async_hooks/async-resource-vs-destroy.js n=1000000 duration=5 connections=500 path="/" asyncMethod="async" type="async-resource" benchmarker="wrk": 18,063.78
async_hooks/async-resource-vs-destroy.js n=1000000 duration=5 connections=500 path="/" asyncMethod="callbacks" type="destroy" benchmarker="wrk": 20,765.57
async_hooks/async-resource-vs-destroy.js n=1000000 duration=5 connections=500 path="/" asyncMethod="async" type="destroy" benchmarker="wrk": 15,926.41
async_hooks/async-resource-vs-destroy.js n=1000000 duration=5 connections=500 path="/" asyncMethod="callbacks" type="async-local-storage" benchmarker="wrk": 22,208.39
/home/matteo/repositories/node/benchmark/async_hooks/async-resource-vs-destroy.js:119
return store.state;
^
TypeError: Cannot read property 'state' of undefined
at getCLS (/home/matteo/repositories/node/benchmark/async_hooks/async-resource-vs-destroy.js:119:18)
at /home/matteo/repositories/node/benchmark/async_hooks/async-resource-vs-destroy.js:149:39
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3)
What is the expected behavior?
It seems it's losing track of the promise chain.