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

events: getMaxListeners detects 0 listeners #56807

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KhafraDev
Copy link
Member

@KhafraDev KhafraDev commented Jan 28, 2025

With the removal of the max listeners warning from AbortSignal, a bug was surfaced with getMaxListeners.

> events.getMaxListeners(new AbortController().signal)
Uncaught:
TypeError [ERR_INVALID_ARG_TYPE]: The "emitter" argument must be an instance of EventEmitter or EventTarget. Received an instance of AbortSignal
    at Function.getMaxListeners (node:events:946:9) {
  code: 'ERR_INVALID_ARG_TYPE'
}

This causes performance issues for undici.

Refs: nodejs/undici#4032
Refs: c1ccade

@nodejs-github-bot nodejs-github-bot added events Issues and PRs related to the events subsystem / EventEmitter. needs-ci PRs that need a full CI run. labels Jan 28, 2025
Copy link

codecov bot commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.21%. Comparing base (f2d2747) to head (5d43e31).
Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #56807   +/-   ##
=======================================
  Coverage   89.21%   89.21%           
=======================================
  Files         663      663           
  Lines      192012   192012           
  Branches    36927    36928    +1     
=======================================
  Hits       171296   171296           
+ Misses      13586    13578    -8     
- Partials     7130     7138    +8     
Files with missing lines Coverage Δ
lib/events.js 99.75% <100.00%> (ø)

... and 24 files with indirect coverage changes

@slagiewka
Copy link

Forgive my lack of process knowledge: what is the flow to make sure this gets backported to v22 (as it follows the backported change)? Should this PR have a label to be picked up?

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina mentioned this pull request Jan 29, 2025
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 29, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 29, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@lpinca
Copy link
Member

lpinca commented Jan 29, 2025

@slagiewka, this can be backported once it has been on a Current release for at least two weeks, no label needed.

@KhafraDev KhafraDev added commit-queue Add this label to land a pull request using GitHub Actions. and removed needs-ci PRs that need a full CI run. labels Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit-queue Add this label to land a pull request using GitHub Actions. events Issues and PRs related to the events subsystem / EventEmitter.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants