Skip to content

http2: Prevent unnecessary listeners from being registered#27987

Closed
akukas wants to merge 6 commits intonodejs:masterfrom
akukas:patch-1
Closed

http2: Prevent unnecessary listeners from being registered#27987
akukas wants to merge 6 commits intonodejs:masterfrom
akukas:patch-1

Conversation

@akukas
Copy link
Copy Markdown
Contributor

@akukas akukas commented May 30, 2019

When multiple requests are started on a client HTTP/2 session while it it still connecting, a warning might get emitted: MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 connect listeners added to Http2Session

This PR modifies the offending code so that only one event listener is registered, no matter how many requests are started. A test for the fix is included.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. http2 Issues or PRs related to the http2 subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants