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

Memory leaks with APN token authentication #89

Closed
amangeot opened this issue Jun 13, 2018 · 6 comments
Closed

Memory leaks with APN token authentication #89

amangeot opened this issue Jun 13, 2018 · 6 comments

Comments

@amangeot
Copy link

Hello,
I'm running a job every hour that sends weather alerts to our users when necessary.
When using token instead of certificates for APN authentication, the memory is not released after running the job:

image

Here are my settings for token authentication. This was pushed in production where I wrote "Token" on the screenshot above. "Restart" simply is a restart of the server.

  apn: {
    token: {
      key: './src/pushNotifications/certificates/APNsAuthKey_KEYID.p8',
      keyId: 'KEYID',
      teamId: 'TEAMID',
      production: __PROD__,
    },
  },

This is running v1.0.21, on Amazon Linux AMI release 2017.03, with node v6.11.2

I'm not sure if I'm misusing the package or there are some memory leaks.

Thank you for releasing this package,

@alex-friedl
Copy link
Collaborator

Hello @amangeot ,
it could be related to #70.
Btw. your APN settings are not quite correct, due to a mistake I made in the README, which has since been corrected.

The production key should be outside the token object.

apn: {
    token: {
      key: './src/pushNotifications/certificates/APNsAuthKey_KEYID.p8',
      keyId: 'KEYID',
      teamId: 'TEAMID',
    },
   production: __PROD__,
  }

@amangeot
Copy link
Author

Thank you, I'll update my settings.

Regarding node-apn v3 I'm not in a big hurry to update my node versions as we run multiple projects and all sort of unexpected things may happen though that's one way to go!

@amangeot
Copy link
Author

I ran the script on my machine, and the script will not exit after finishing. I received these errors which I suspect come from this package but I also have a database connection using pg-promise:

(node:13712) Warning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit
(node:13712) Warning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit

Do you know if we should force closing the application with process.exit(0) or something similar to kill / close the push notifications tooling?

@miqmago
Copy link
Collaborator

miqmago commented Jun 19, 2018

Duplicate of #70, please reopen if it's not.

Possible solutions:

Waiting for node-apn/node-apn#518 to be solved...

@miqmago miqmago closed this as completed Jun 19, 2018
@vibhor1997a
Copy link

I am facing the exact issue in version 2.2.0.
(node:12020) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit (node:12020) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit (node:12020) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit (node:12020) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit (node:12020) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit (node:12020) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit

@miqmago
Copy link
Collaborator

miqmago commented Oct 17, 2018

Please reffer to #70

Repository owner locked and limited conversation to collaborators Oct 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants