OptimalBits / bull

Premium Queue package for handling distributed jobs and messages in NodeJS.
Other
15.58k stars 1.43k forks source link

user_script:70: too many results to unpack #2764

Closed matt-moven closed 2 months ago

matt-moven commented 2 months ago

Description

See https://github.com/OptimalBits/bull/issues/2709 for reference

We also ran into this bug and traced it down to the collectMetrics function in "moveToFinished-9.lua". We set metrics.maxDataPoints to 1. In moveToFinished, collectMetrics tries to add the current metric and also fill in zero values for all the missed seconds, and then trims that list down to maxDataPoints. If a queue sees no jobs for enough time, and then processes a job and tries to update its metrics, the unpack() with one metric and many zeros fails with error "too many results to unpack".

https://github.com/OptimalBits/bull/blob/886d7643819dcf52902d2e92394267dbd495c71b/lib/commands/moveToFinished-9.lua#L70

Since the metric prevTS is not updated, all following jobs in the queue also throw the error.

Bull version

4.16.0

manast commented 2 months ago

:tada: This issue has been resolved in version 4.16.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: