Skip to content

warning: error while sending push RangeError: Maximum call stack size exceeded #19

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

Closed
flovilmart opened this issue Jun 5, 2016 · 5 comments

Comments

@flovilmart
Copy link
Contributor

flovilmart commented Jun 5, 2016

Initiale posted by @fabuhelow on parse-community/parse-server#1966

Hi All,

I'm trying to push a new notification to "140,000" users and I have got the following exception:

index-3 (out): info: warning: error while sending push RangeError: Maximum call stack size exceeded index-3 (out): at GCM.send (/parse-server-gcm/node_modules/parse-server-push-adapter/lib/GCM.js:51:42) index-3 (out): at _loop (/parse-server-gcm/node_modules/parse-server-push-adapter/lib/ParsePushAdapter.js:114:38) index-3 (out): at ParsePushAdapter.send (/parse-server-gcm/node_modules/parse-server-push-adapter/lib/ParsePushAdapter.js:120:9) index-3 (out): at PushController.sendToAdapter (/parse-server-gcm/node_modules/parse-server/lib/Controllers/PushController.js:171:27) index-3 (out): at /parse-server-gcm/node_modules/parse-server/lib/Controllers/PushController.js:128:23 index-3 (out): at run (/parse-server-gcm/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:89:22) index-3 (out): at /parse-server-gcm/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:102:28 index-3 (out): at flush (/parse-server-gcm/node_modules/babel-polyfill/node_modules/core-js/modules/_microtask.js:18:9) index-3 (out): at _combinedTickCallback (internal/process/next_tick.js:67:7) index-3 (out): at process._tickDomainCallback (internal/process/next_tick.js:122:9)

Server specifications:

  • PM2 Threads: 4
  • Server CPU's : 4
  • HDD Space: 8 GB, Used 3 GB, Free 5 GB

- RAM: 16 GB, Free 14 GB

Any help about this issue ?

Thanks,

@iForests
Copy link

Same here. Failed to send push notification to 406K users.

I'm using parse-server-push-adapter 1.0.4, and crashed on GCM.js:49:42 which is:

// Make a new array
devices = new (Function.prototype.bind.apply(Array, [null].concat(_toConsumableArray(devices))))();

@flovilmart
Copy link
Contributor Author

PR are welcome, but attempting to send large number of pushes on a single parse-server will most likely fail.

Just so you realize, even if sending a push would only take 1ms, sending 400k would take about 6 minutes, saturating your instance and blocking anything else from happening.

@iForests
Copy link

Do you have any suggestion for sending a lot of push notifications based on parse-server's architecture? Thanks.

@flovilmart
Copy link
Contributor Author

That's quite tricky, and falls into the bucket of high scalability of systems. For now I suggest you don't rely on Parse-server for large volume push delivery

@jeacott1
Copy link
Contributor

jeacott1 commented Jan 3, 2017

this is actually a simple fix. the main issue was too much magic causing the device array to be converted to function args ref #49

you'll need this fix too if you don't want your server locking up post push though:
parse-community/parse-server#3264

still zero resilience/reliability though. should be pushed to a persistent queue/kafka/etc, and pulled from same to provide some.

the other potential issue with the existing code is the recursive nature of the split/1000 which will also fail at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants