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

Errors when using with Firebase #206

Closed
daniestrijdom opened this issue Jul 31, 2018 · 7 comments · Fixed by #210
Closed

Errors when using with Firebase #206

daniestrijdom opened this issue Jul 31, 2018 · 7 comments · Fixed by #210
Labels
bug Something isn't working community integrations

Comments

@daniestrijdom
Copy link

HI,

We have an koa app that uses firebase realtime database, but when we initialise the firebase application in the project, then we get the following trace in our logs;

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:280:19)
    at TLSSocket.addListener (events.js:297:10)
    at TLSSocket.Readable.on (_stream_readable.js:772:35)
    at ClientRequest.req.on.socket (/pipeline/source/node_modules/dd-trace/src/plugins/http.js:50:16)
    at emitOne (events.js:121:20)
    at ClientRequest.emit (events.js:211:7)
    at tickOnSocket (_http_client.js:652:7)
    at onSocketNT (_http_client.js:668:5)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
@daniestrijdom
Copy link
Author

Just saw the issue on another app that doesn't have firebase, just a new microservice we're created with that also uses the newest version of dd-trace, other applications with older versions are not showing this error, so it is likely not isolated to firebase

@rochdev
Copy link
Member

rochdev commented Jul 31, 2018

Which versions of dd-trace and Node are you using?

@rochdev
Copy link
Member

rochdev commented Jul 31, 2018

Also, what was the version that didn't have the warning? Does the application still work or is this throwing an exception?

@daniestrijdom
Copy link
Author

hi @rochdev ;

Node version is 8.11.3 in every case

dd-trace version is 0.5.1 which is giving us issues - previous version we were on which didn't give the node warning is 0.3.2

The application still works and it's not an exception or error that crashes the app, however looking at the kubernetes pod today I can see that there was 1 restart in the last 24 hrs, not sure if related. What happens is that it prints out the warning below about once every hour or so.

(node:16) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit

@rochdev
Copy link
Member

rochdev commented Aug 1, 2018

This seems to happen because http reuses sockets from a pool when used with keepAlive: true and we attach an event handler to the socket on every request. I'll try to see if the listener could be removed sooner, and also if it would be possible to simply remove it.

@daniestrijdom
Copy link
Author

thanks @rochdev !!!!

@rochdev
Copy link
Member

rochdev commented Aug 3, 2018

Released in 0.5.3

@rochdev rochdev added bug Something isn't working community integrations labels Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community integrations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants