Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsyncLocalStorage benchmark broken #32501

Closed
mcollina opened this issue Mar 26, 2020 · 8 comments
Closed

AsyncLocalStorage benchmark broken #32501

mcollina opened this issue Mar 26, 2020 · 8 comments
Labels
async_hooks Issues and PRs related to the async hooks subsystem.

Comments

@mcollina
Copy link
Member

mcollina commented Mar 26, 2020

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

@mcollina mcollina added the async_hooks Issues and PRs related to the async hooks subsystem. label Mar 26, 2020
@mcollina
Copy link
Member Author

cc @vdeturckheim

@vdeturckheim
Copy link
Member

vdeturckheim commented Mar 26, 2020

Wow, I will take a look today.
cc @puzpuzpuz

@puzpuzpuz
Copy link
Member

Thanks for CCing me @vdeturckheim

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

@himself65
Copy link
Member

image

with macOS 10.15.3

@mcollina
Copy link
Member Author

mcollina commented Mar 26, 2020

My bad, I was running this on the Linux box, I have updated the bug report.

@puzpuzpuz
Copy link
Member

puzpuzpuz commented Mar 26, 2020

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

Update. Forgot to mention that it was an issue in the benchmark itself, not a context loss.

@vdeturckheim
Copy link
Member

@puzpuzpuz you just outspeeded me :D good finding!

@puzpuzpuz
Copy link
Member

As #32503 is merged, this issue should be closed.

@mcollina mcollina closed this as completed Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
async_hooks Issues and PRs related to the async hooks subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants