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

fix(NA): MaxListenersExceededWarning on getLoggerStream #57133

Merged
merged 5 commits into from
Feb 10, 2020

Conversation

mistic
Copy link
Member

@mistic mistic commented Feb 7, 2020

That solves a recent warning we have been experiencing, since #55937 was merged, every time we start the server.

We just hit the default max listeners value for process.stdout due to the way the legacy logger works. That sets a new hard limit.

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:256:17)
    at WriteStream.prependListener (events.js:279:14)
    at prependListener (_stream_readable.js:56:20)
    at KbnLoggerStringFormat.pipe (_stream_readable.js:738:3)
    at getLoggerStream (/Users/nicholaspartridge/Documents/repos/kibana/src/legacy/server/logging/log_reporter.js:49:6)
    at loggingConfiguration (/Users/nicholaspartridge/Documents/repos/kibana/src/legacy/server/logging/configuration.js:50:24)
    at setupLogging (/Users/nicholaspartridge/Documents/repos/kibana/src/legacy/server/logging/index.js:28:14)
    at new LegacyLoggingServer (/Users/nicholaspartridge/Documents/repos/kibana/src/core/server/legacy/logging/legacy_logging_server.ts:103:5)
    at new LegacyAppender (/Users/nicholaspartridge/Documents/repos/kibana/src/core/server/legacy/logging/appenders/legacy_appender.ts:45:26)
    at Function.create (/Users/nicholaspartridge/Documents/repos/kibana/src/core/server/logging/appenders/appenders.ts:75:16)
    at LoggingService.upgrade (/Users/nicholaspartridge/Documents/repos/kibana/src/core/server/logging/logging_service.ts:71:49)
    at MapSubscriber.configService.getConfig$.pipe.config [as project] (/Users/nicholaspartridge/Documents/repos/kibana/src/core/server/root/index.ts:102:41)
    at MapSubscriber._next (/Users/nicholaspartridge/Documents/repos/kibana/node_modules/rxjs/src/internal/operators/map.ts:84:29)
    at MapSubscriber.Subscriber.next (/Users/nicholaspartridge/Documents/repos/kibana/node_modules/rxjs/src/internal/Subscriber.ts:99:12)
    at SwitchMapSubscriber.notifyNext (/Users/nicholaspartridge/Documents/repos/kibana/node_modules/rxjs/src/internal/operators/switchMap.ts:166:24)
    at InnerSubscriber._next (/Users/nicholaspartridge/Documents/repos/kibana/node_modules/rxjs/src/internal/InnerSubscriber.ts:17:17)

Thanks @spalger for the discussion and the ideas around it!

@mistic mistic added chore Team:Operations Team label for Operations Team v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.7.0 v7.6.1 labels Feb 7, 2020
@mistic mistic requested a review from a team as a code owner February 7, 2020 17:47
@mistic mistic self-assigned this Feb 7, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@mistic
Copy link
Member Author

mistic commented Feb 7, 2020

@elasticmachine merge upstream

Copy link
Contributor

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

LGTM! Ran locally and memory error is gone. 🎉

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mistic mistic merged commit bc689d3 into elastic:master Feb 10, 2020
mistic added a commit to mistic/kibana that referenced this pull request Feb 10, 2020
* fix(NA): possible EventEmitter memory leak detected with a passthrough for getLoggerStream

* chore(na): remove passthrough

Co-authored-by: Elastic Machine <[email protected]>
mistic added a commit to mistic/kibana that referenced this pull request Feb 10, 2020
* fix(NA): possible EventEmitter memory leak detected with a passthrough for getLoggerStream

* chore(na): remove passthrough

Co-authored-by: Elastic Machine <[email protected]>
@mistic
Copy link
Member Author

mistic commented Feb 10, 2020

7.x: cb550c9
7.6: 36b1dbb

mistic added a commit that referenced this pull request Feb 10, 2020
)

* fix(NA): possible EventEmitter memory leak detected with a passthrough for getLoggerStream

* chore(na): remove passthrough

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
mistic added a commit that referenced this pull request Feb 10, 2020
)

* fix(NA): possible EventEmitter memory leak detected with a passthrough for getLoggerStream

* chore(na): remove passthrough

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Feb 11, 2020
* master: (34 commits)
  [Index management] Server-side NP ready (elastic#56829)
  Webhook action - make user and password secrets optional (elastic#56823)
  [DOCS] Removes reference to IRC (elastic#57245)
  [Monitoring] NP migration: Local angular module (elastic#51823)
  [SIEM] Adds ECS link to help menu (elastic#57104)
  Ensure http interceptors are shares across lifecycle methods (elastic#57150)
  [Remote clusters] Migrate server code out of legacy (elastic#56781)
  fixes render bug in alert list (elastic#57152)
  siem 7.6 updates (elastic#57169)
  Make the update alert API key API work when AAD is out of sync (elastic#56640)
  fix(NA): MaxListenersExceededWarning on getLoggerStream (elastic#57133)
  [Metrics UI] Setup commonly used time ranges in timepicker (elastic#56701)
  [Maps] set filter.meta.key to geoFieldName so query passes filterMatchesIndex when ignoreFilterIfFieldNotInIndex is true (elastic#56692)
  Create plugin mock for event log plugin (elastic#57048)
  fix ts error on master (elastic#57236)
  Don't create API key for disabled alerts when calling create API (elastic#57041)
  Fix enable and disable API to still work when AAD is out of sync (elastic#56634)
  [DOCS] Canvas embed objects (elastic#57156)
  Delete autocomplete namespace (elastic#57187)
  Security - Inject logout url (elastic#57201)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.6.1 v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants