node icon indicating copy to clipboard operation
node copied to clipboard

lib: disable default memory leak warning for AbortSignal

Open phryneas opened this issue 1 year ago • 12 comments

This change sets the default kMaxEventTargetListeners property for AbortSignal instances to 0, disabling the check per default, to enable users to write isomorphic library code. If desirable, the max event target listeners check can still be enabled for individual AbortSignal instances by calling setMaxListeners on them.

Refs: https://github.com/nodejs/node/issues/54758

I ran all the test I believe are relevant locally, but I can't run the full test suite as I'm working on a managed Mac and can't change firewall rules, so the test suite just explodes on me with popups.

phryneas avatar Nov 11 '24 13:11 phryneas

(I'm not allowed to add the notable-change label, so someone else will have to do that)

phryneas avatar Nov 11 '24 13:11 phryneas

@jasnell wdyt?

benjamingr avatar Nov 13 '24 19:11 benjamingr

Codecov Report

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

Project coverage is 88.00%. Comparing base (fe1dd26) to head (d0579b6). Report is 1510 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55816      +/-   ##
==========================================
+ Coverage   87.92%   88.00%   +0.08%     
==========================================
  Files         654      656       +2     
  Lines      187815   188984    +1169     
  Branches    35830    35997     +167     
==========================================
+ Hits       165139   166323    +1184     
+ Misses      15878    15832      -46     
- Partials     6798     6829      +31     
Files with missing lines Coverage Δ
lib/internal/abort_controller.js 98.06% <100.00%> (+<0.01%) :arrow_up:

... and 78 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Nov 27 '24 21:11 codecov[bot]

The commit message should be under subsystem lib

jazelly avatar Nov 27 '24 23:11 jazelly

@jazelly what's the correct course of action here? Amend the commit, rewrite the existing commit title and force push? I'm afraid that that will void all the commit approvals 😅

phryneas avatar Nov 28 '24 14:11 phryneas

what's the correct course of action here? Amend the commit, rewrite the existing commit title and force push?

Yes, the commit needs to be amended to pass the GHA, so that we can run CI.

I'm afraid that that will void all the commit approvals.

Technically, you just need one more approval / request re-review from the approvers after force pushing.

jazelly avatar Nov 28 '24 23:11 jazelly

@jazelly Okay, thank you for clarifying - I've adjusted the commit message!

Apart from the commit message, the commits are identical

phryneas avatar Nov 29 '24 11:11 phryneas

The first-line commit message needs to be less than 72 characters. Can you please update the commit?

More detailed guideline can be found here. Sorry, probably should've link that in my previous message.

jazelly avatar Nov 30 '24 03:11 jazelly

I followed that guide 😓

The first line should:

contain a short description of the change (preferably 50 characters or less, and no more than 72 characters)

✅ description is 51 characters, plus the lib: prefix

be entirely in lowercase with the exception of proper nouns, acronyms, and the words that refer to code, like function/variable names

✅ everything lowercase except for AbortController

be prefixed with the name of the changed subsystem and start with an imperative verb. Check the output of git log --oneline files/you/changed to find out what subsystems your changes touch.

From the suffix:

lib/*.js (assert, buffer, etc.)

which is why I came up with internal in the first place, because this is in lib/internal.


Looking at this, it seems I failed on the subsequent lines - one line is 76 chars long. I probably trusted my local editor which warns at 80.

Fixing...

phryneas avatar Dec 02 '24 08:12 phryneas

@jazelly I've run the check locally via

git rev-parse HEAD~0 | xargs npx -q core-validate-commit --no-validate-metadata --tap

and it seems to pass now.

phryneas avatar Dec 02 '24 08:12 phryneas

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

nodejs-github-bot avatar Dec 04 '24 11:12 nodejs-github-bot

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

nodejs-github-bot avatar Dec 04 '24 21:12 nodejs-github-bot

Landed in c1ccade02f29fd5585601bd496d4fb615a55b682

nodejs-github-bot avatar Dec 07 '24 10:12 nodejs-github-bot