timgit / pg-boss

Queueing jobs in Postgres from Node.js like a boss
MIT License
2.13k stars 158 forks source link

Subscribe doesn't notice new jobs #95

Closed bjornhenriksson closed 6 years ago

bjornhenriksson commented 6 years ago

First of all: thank you so much for this amazing worker-framework!

Not sure if this is a real issue with code or not but didn't know exactly where to reach out.

We recently scaled up our pg boss to handle more jobs concurrently. But we've noticed after this change that our worker seems to stop listening for new jobs in queue(subscribe method), noticably when there are no more jobs to run. This morning we had thousands of created jobs but no completed and the dyno load was flat bottom. We've contacted heroku as well, but wanted to reach out and see if you know any common issues with either hosting pg-boss on heroku or the subscribe method not listening for new jobs?

The worker runs all the jobs as expected after a dyno restart.

Our config is:

teamSize: 12
teamConcurrency: 4

and standard intervals.

Thanks again!

All the best, Björn

bjornhenriksson commented 6 years ago

Turned out this was caused by a promise not resolving correctly(causing the polling to stall).