Skip to content

AsyncLocalStorage benchmark broken #32501

Closed
@mcollina

Description

@mcollina
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    async_hooksIssues and PRs related to the async hooks subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions