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

EventEmitter warning / memory leak #332

Closed
aneilbaboo opened this issue Oct 30, 2018 · 0 comments
Closed

EventEmitter warning / memory leak #332

aneilbaboo opened this issue Oct 30, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@aneilbaboo
Copy link
Contributor

aneilbaboo commented Oct 30, 2018

Getting a memory leak when running tests. It looks like it is due to the Winston logger:
(node --trace-warnings allows us to see the stack):

$ yarn test:trace
Loading test-offline.env environment
Serverless: Generating offline settings
 PASS  src/services/report/resolvers.test.ts
 PASS  src/services/report/services/smart-report/personalizer.test.ts
 PASS  src/services/system/service.test.ts
 PASS  src/services/variant-call/models.test.ts
 PASS  src/services/report/models.test.ts
 PASS  src/services/graphql/handler.test.ts
 PASS  src/services/report/schema.test.ts
 PASS  src/services/auth/auth0.test.ts
 PASS  src/services/models.test.ts
 PASS  src/services/report/services/smart-report/data-types/variant-call/function.test.ts
 PASS  src/services/system/models/variant-requirement.test.ts
 PASS  src/services/variant-call/service.test.ts
(node:60023) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unpipe listeners added. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:280:19)
    at Console.addListener (events.js:297:10)
    at DerivedLogger.Object.<anonymous>.Readable.pipe (/Users/aneil/code/precisely/web/app-backend/node_modules/readable-stream/lib/_stream_readable.js:564:8)
    at DerivedLogger.add (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:279:10)
    at transports.forEach.transport (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:79:44)
    at Array.forEach (<anonymous>)
    at DerivedLogger.configure (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:79:18)
    at new Logger (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:35:10)
    at new DerivedLogger (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/create-logger.js:28:5)
    at Object.<anonymous>.module.exports [as createLogger] (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/create-logger.js:81:3)
(node:60023) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:280:19)
    at Console.prependListener (events.js:304:14)
    at prependListener (/Users/aneil/code/precisely/web/app-backend/node_modules/readable-stream/lib/_stream_readable.js:92:69)
    at DerivedLogger.Object.<anonymous>.Readable.pipe (/Users/aneil/code/precisely/web/app-backend/node_modules/readable-stream/lib/_stream_readable.js:644:3)
    at DerivedLogger.add (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:279:10)
    at transports.forEach.transport (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:79:44)
    at Array.forEach (<anonymous>)
    at DerivedLogger.configure (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:79:18)
    at new Logger (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:35:10)
    at new DerivedLogger (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/create-logger.js:28:5)
(node:60023) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:280:19)
    at Console.addListener (events.js:297:10)
    at DerivedLogger.Object.<anonymous>.Readable.pipe (/Users/aneil/code/precisely/web/app-backend/node_modules/readable-stream/lib/_stream_readable.js:585:8)
    at DerivedLogger.add (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:279:10)
    at transports.forEach.transport (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:79:44)
    at Array.forEach (<anonymous>)
    at DerivedLogger.configure (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:79:18)
    at new Logger (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:35:10)
    at new DerivedLogger (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/create-logger.js:28:5)
    at Object.<anonymous>.module.exports [as createLogger] (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/create-logger.js:81:3)
(node:60023) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:280:19)
    at Console.addListener (events.js:297:10)
    at Console.once (events.js:341:8)
    at DerivedLogger.Object.<anonymous>.Readable.pipe (/Users/aneil/code/precisely/web/app-backend/node_modules/readable-stream/lib/_stream_readable.js:651:8)
    at DerivedLogger.add (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:279:10)
    at transports.forEach.transport (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:79:44)
    at Array.forEach (<anonymous>)
    at DerivedLogger.configure (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:79:18)
    at new Logger (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:35:10)
    at new DerivedLogger (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/create-logger.js:28:5)
(node:60023) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 finish listeners added. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:280:19)
    at Console.addListener (events.js:297:10)
    at Console.once (events.js:341:8)
    at DerivedLogger.Object.<anonymous>.Readable.pipe (/Users/aneil/code/precisely/web/app-backend/node_modules/readable-stream/lib/_stream_readable.js:657:8)
    at DerivedLogger.add (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:279:10)
    at transports.forEach.transport (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:79:44)
    at Array.forEach (<anonymous>)
    at DerivedLogger.configure (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:79:18)
    at new Logger (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/logger.js:35:10)
    at new DerivedLogger (/Users/aneil/code/precisely/web/app-backend/node_modules/winston/lib/winston/create-logger.js:28:5)

See: winstonjs/winston#1334

@aneilbaboo aneilbaboo added the bug Something isn't working label Oct 30, 2018
aneilbaboo added a commit that referenced this issue Nov 29, 2018
Fixes #332, the EventEmitter memory leak warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant