Meteor-Community-Packages / meteor-publish-composite

Meteor.publishComposite provides a flexible way to publish a set of related documents from various collections using a reactive join
https://atmospherejs.com/reywood/publish-composite
MIT License
553 stars 58 forks source link

Unhandled promise rejection #165

Closed StorytellerCZ closed 12 months ago

StorytellerCZ commented 1 year ago

Had a nasty crash on Galaxy. While the main reason is out of memory, there is also a rejected promise in publication.js (on lines 43 and 88). I think we should look into this to make things more resilient for Meteor 3. I think adding some try/catch might help, or we should document how people should handle this so that they don't get unhandled promise rejection.

Thoughts @jankapunkt ?

The logs:

e0zjp
2023-10-11 08:09:12+02:00(node:7) UnhandledPromiseRejectionWarning: RangeError: Out of memory
2023-10-11 08:09:12+02:00 at Fiber.<anonymous> (/app/bundle/programs/server/node_modules/fibers/fibers.js:92:16)
2023-10-11 08:09:12+02:00 at Fibers.run (packages/mdg:meteor-apm-agent/lib/hijack/async.js:25:22)
2023-10-11 08:09:12+02:00 at makeNewFiber (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:71:11)
2023-10-11 08:09:12+02:00 at FiberPool.run (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:92:37)
2023-10-11 08:09:12+02:00 at Function.Promise.asyncApply (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:135:22)
2023-10-11 08:09:12+02:00 at Publication._publishChildrenOf (packages/reywood:publish-composite/lib/publication.js:88:31)
2023-10-11 08:09:12+02:00 at packages/reywood:publish-composite/lib/publication.js:43:22
2023-10-11 08:09:12+02:00 at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
2023-10-11 08:09:12+02:00(Use `node --trace-warnings ...` to show where the warning was created)
2023-10-11 08:09:12+02:00(node:7) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5)
2023-10-11 08:09:12+02:00(node:7) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
2023-10-11 08:09:12+02:00(node:7) UnhandledPromiseRejectionWarning: RangeError: Out of memory
2023-10-11 08:09:12+02:00 at Fiber.<anonymous> (/app/bundle/programs/server/node_modules/fibers/fibers.js:92:16)
2023-10-11 08:09:12+02:00 at Fibers.run (packages/mdg:meteor-apm-agent/lib/hijack/async.js:25:22)e0zjp
2023-10-11 08:09:12+02:00 at makeNewFiber (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:71:11)
2023-10-11 08:09:12+02:00 at FiberPool.run (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:92:37)
2023-10-11 08:09:12+02:00 at Function.Promise.asyncApply (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:135:22)
2023-10-11 08:09:12+02:00 at Publication._publishChildrenOf (packages/reywood:publish-composite/lib/publication.js:88:31)
2023-10-11 08:09:12+02:00 at packages/reywood:publish-composite/lib/publication.js:43:22
2023-10-11 08:09:12+02:00 at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
2023-10-11 08:09:12+02:00(node:7) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 6)
github-actions[bot] commented 1 year ago

Thank you for submitting this issue!

We, the Members of Meteor Community Packages take every issue seriously. Our goal is to provide long-term lifecycles for packages and keep up with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.

However, we contribute to these packages mostly in our free time. Therefore, we can't guarantee your issues to be solved within certain time.

If you think this issue is trivial to solve, don't hesitate to submit a pull request, too! We will accompany you in the process with reviews and hints on how to get development set up.

Please also consider sponsoring the maintainers of the package. If you don't know who is currently maintaining this package, just leave a comment and we'll let you know

StorytellerCZ commented 1 year ago

Could be releated to #167. Will try a deploy with v1.8.3, which most likely fixes that issue to see if it repeats.

StorytellerCZ commented 12 months ago

I think this is fixed in v1.8.4