node icon indicating copy to clipboard operation
node copied to clipboard

lib: ensure no holey array in fixed_queue

Open jazelly opened this issue 1 year ago β€’ 17 comments
trafficstars

Fixes: https://github.com/nodejs/node/issues/54472 Refs: https://github.com/nodejs/node/issues/54186#issuecomment-2276785038

jazelly avatar Aug 24 '24 10:08 jazelly

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.33%. Comparing base (e70bd47) to head (348536f). Report is 93 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54537      +/-   ##
==========================================
- Coverage   87.34%   87.33%   -0.01%     
==========================================
  Files         649      649              
  Lines      182524   182621      +97     
  Branches    35026    35044      +18     
==========================================
+ Hits       159420   159501      +81     
- Misses      16373    16395      +22     
+ Partials     6731     6725       -6     
Files with missing lines Coverage Ξ”
lib/internal/fixed_queue.js 100.00% <100.00%> (ΓΈ)

... and 48 files with indirect coverage changes

codecov[bot] avatar Aug 24 '24 12:08 codecov[bot]

Hi! Could you amend your commit message to begin with an active verb (after the subsystem)?

avivkeller avatar Aug 24 '24 12:08 avivkeller

I have run the benchmark for async_hooks and events, here are the results:

events: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1616/ async_hooks: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1615/

Does not look like this change would cause any performance regression. But would be happy to know if any benchmark that is missed.

jakecastelli avatar Aug 25 '24 01:08 jakecastelli

PR comments addressed. I have also updated the data structure comments in fixed_queue as it's no longer with [empty]

jazelly avatar Aug 25 '24 03:08 jazelly

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

nodejs-github-bot avatar Aug 26 '24 00:08 nodejs-github-bot

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

nodejs-github-bot avatar Aug 26 '24 01:08 nodejs-github-bot

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

nodejs-github-bot avatar Aug 26 '24 03:08 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/61469/ πŸ’š

nodejs-github-bot avatar Aug 26 '24 05:08 nodejs-github-bot

@joyeecheung @targos @benjamingr PTAL πŸ™

jakecastelli avatar Aug 26 '24 09:08 jakecastelli

I'm approving this even without a test but a test would be nice

benjamingr avatar Aug 26 '24 10:08 benjamingr

@benjamingr see this thread. I think (and I agree) the idea is that we don't want to show it as a wanted behaviour. We fix it to avoid hard crashes.

jazelly avatar Aug 26 '24 10:08 jazelly

a test would be nice

Thinking about this again, maybe we should add a test to the test/known_issues and put refs on the top. In this way, folks who read the test would not think this is a supported behaviour. Wdyt @jazelly

jakecastelli avatar Aug 27 '24 00:08 jakecastelli

Oh, I didn't know there are test/known_issues. I think it makes sense to place it there with a comment.

jazelly avatar Aug 27 '24 00:08 jazelly

Actually, this may not be a known issue anymore - especially with this patch. I added a test case in test-fixed-queue.js to assert the queue no longer being holey. PTAL

jazelly avatar Aug 27 '24 01:08 jazelly

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

nodejs-github-bot avatar Aug 27 '24 03:08 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/61528/ πŸ’š

nodejs-github-bot avatar Aug 27 '24 06:08 nodejs-github-bot

Do you have any objections on this one? @joyeecheung @legendecas πŸ‘€

jakecastelli avatar Aug 27 '24 15:08 jakecastelli

Landed in 981c7014009eee456bdc70adf4d9d5c89211cafe

nodejs-github-bot avatar Sep 02 '24 01:09 nodejs-github-bot