GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — benchmark: fix error on server close in AsyncLocalStorage benchmark by puzpuzpuz · Pull Request #32503 · nodejs/node

Conversation

@puzpuzpuz

@puzpuzpuz puzpuzpuz commented Mar 26, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Closes AsyncLocalStorage benchmark broken #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.

  • Also removes redundant checks from executionAsyncResource type. Reason: the final implementation of executionAsyncResource() never returns null.
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot nodejs-github-bot added async_hooks Issues and PRs related to the async hooks subsystem. benchmark Issues and PRs related to Node.js benchmarks and benchmarking infrastructure. labels Mar 26, 2020
@puzpuzpuz puzpuzpuz changed the title benchmark: fix error on server close in ALS benchmark benchmark: fix error on server close in AsyncLocalStorage benchmark Mar 26, 2020
@puzpuzpuz
puzpuzpuz force-pushed the fix-async-resource-vs-destroy-benchmark branch from 7fda473 to 39374a2 Compare March 26, 2020 12:22
@puzpuzpuz puzpuzpuz mentioned this pull request Mar 26, 2020
AsyncLocalStorage benchmark broken #32501
Closed
vdeturckheim
vdeturckheim approved these changes Mar 26, 2020
View reviewed changes
mcollina
mcollina approved these changes Mar 26, 2020
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Flarna
Flarna approved these changes Mar 26, 2020
View reviewed changes
cjihrig
cjihrig approved these changes Mar 26, 2020
View reviewed changes
mhdawson
mhdawson approved these changes Apr 1, 2020
View reviewed changes

@mhdawson mhdawson left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mhdawson mhdawson added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Apr 1, 2020
@mhdawson

mhdawson commented Apr 1, 2020

Copy link
Copy Markdown
Member

CI run: https://ci.nodejs.org/job/node-test-pull-request/30348/

puzpuzpuz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Apr 1, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/30348/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@puzpuzpuz
benchmark: fix error on server close in AsyncLocalStorage benchmark
2239ecb
@puzpuzpuz
puzpuzpuz force-pushed the fix-async-resource-vs-destroy-benchmark branch from 39374a2 to 2239ecb Compare April 2, 2020 07:47
@puzpuzpuz

puzpuzpuz commented Apr 2, 2020

Copy link
Copy Markdown
Member Author

The test failure in test/node-api/test_buffer/test.js seems unrelated, but I did a rebase over the latest master, as it may be already fixed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Apr 2, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/30366/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina

mcollina commented Apr 2, 2020

Copy link
Copy Markdown
Member

Landed in 7e664a5

puzpuzpuz reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina mcollina closed this Apr 2, 2020
mcollina pushed a commit that referenced this pull request Apr 2, 2020
@puzpuzpuz @mcollina
benchmark: fix error on server close in AsyncLocalStorage benchmark
7e664a5
PR-URL: #32503
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@puzpuzpuz
puzpuzpuz deleted the fix-async-resource-vs-destroy-benchmark branch April 2, 2020 12:59
@puzpuzpuz puzpuzpuz mentioned this pull request Apr 2, 2020
[v12.x backport] async_hooks: add AsyncLocalStorage #32318
Closed
4 tasks done
@puzpuzpuz

puzpuzpuz commented Apr 2, 2020

Copy link
Copy Markdown
Member Author

v12.x backport PR: #32318

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

BethGriggs pushed a commit that referenced this pull request Apr 7, 2020
@puzpuzpuz @BethGriggs
benchmark: fix error on server close in AsyncLocalStorage benchmark
a2ff277
PR-URL: #32503
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
targos pushed a commit that referenced this pull request Apr 12, 2020
@puzpuzpuz @targos
benchmark: fix error on server close in AsyncLocalStorage benchmark
78b90d9
PR-URL: #32503
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@targos targos mentioned this pull request Apr 13, 2020
v13.13.0 release proposal #32813
Merged
puzpuzpuz added a commit to puzpuzpuz/node that referenced this pull request Apr 14, 2020
@puzpuzpuz
benchmark: fix error on server close in AsyncLocalStorage benchmark
45ad080
PR-URL: nodejs#32503
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@puzpuzpuz puzpuzpuz added the backported-to-v12.x label Apr 14, 2020
@targos targos removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Apr 25, 2020
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
@puzpuzpuz @targos
benchmark: fix error on server close in AsyncLocalStorage benchmark
df5d306
PR-URL: nodejs#32503
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
targos pushed a commit that referenced this pull request Apr 28, 2020
@puzpuzpuz @targos
benchmark: fix error on server close in AsyncLocalStorage benchmark
3861c69
PR-URL: #32503
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@targos targos mentioned this pull request May 2, 2020
v12.17.0 release proposal #33197
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mcollina mcollina mcollina approved these changes
@cjihrig cjihrig cjihrig approved these changes
@Flarna Flarna Flarna approved these changes
+2 more reviewers
@vdeturckheim vdeturckheim vdeturckheim approved these changes
@mhdawson mhdawson mhdawson approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

async_hooks Issues and PRs related to the async hooks subsystem. benchmark Issues and PRs related to Node.js benchmarks and benchmarking infrastructure.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AsyncLocalStorage benchmark broken

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@puzpuzpuz @mhdawson @nodejs-github-bot @mcollina @cjihrig @vdeturckheim @Flarna @targos
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.