Skip to content

@user_script:86: user_script:86: too many results to unpack #422

Closed
@hasparus

Description

Hi! That's my first issue, so firstly I wanted to thank you folks for BullMQ!
We're using it quite a lot with @andreasasprou and this is the first problem I encountered.

After scaling up our workers, we've noticed a new error

ERR Error running script (call to f_890be59efdd64a4df5f5121df9680b166a884036): @user_script:86: user_script:86: too many results to unpack

I looked around the repository, and found unpack in two places

Once in updateDelaySet-7.lua with a table at most 1000-elements big, and the second time in moveStalledJobsToWait-8.lua in line 86 with all jobs from KEYS[3] 'active'.

local active = rcall('LRANGE', KEYS[3], 0, -1)
if (#active > 0) then rcall('SADD', KEYS[1], unpack(active)) end

I'm reading that calling unpack with more than 8k elements is known to crash.

I wanted to ask about limits of bullmq — should we try to scale Bull and Redis instances when dealing tens of thousands of jobs?
Or is this just a software bug, that could be solved with iteration over active and calling unpack with batches of 7000 (unpack(active, from_index, to_index))?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions