actionhero / node-resque

Node.js Background jobs backed by redis.
https://node-resque.actionherojs.com
Apache License 2.0
1.37k stars 151 forks source link

Queues: "*" bug #412

Closed glensc closed 4 years ago

glensc commented 4 years ago

Having "queues: *" has perhaps unwanted side-effect, it will pick up queues for processing that were present at the time of worker startup:

meaning, if more queues are created to redis while runner is working, it will not "see" those queues.

this should be either fixed or documented in readme.

also, the highlighted code stores this.originalQueue, but that's never used elsewhere, kind of dead code smell.

glensc commented 4 years ago

there's another flaw in that code, if redis has no queues present, the code keeps looping due this line assigning queues empty array:

evantahler commented 4 years ago

Responding just to https://github.com/actionhero/node-resque/issues/412#issuecomment-669159874, can you share more about what you mean by "the code keeps looping"?

I think the worker will never be 'ready' (which is OK as there are no queues to work), but it will sleep like normal and look for queues again the next time it tries worker#poll

evantahler commented 4 years ago

Oh wow! That's certainly unexpected behavior... I'll address this in https://github.com/actionhero/node-resque/pull/413 to check for new queues periodically.

glensc commented 4 years ago

Responding just to #412 (comment), can you share more about what you mean by "the code keeps looping"?

I think the worker will never be 'ready' (which is OK as there are no queues to work), but it will sleep like normal and look for queues again the next time it tries worker#poll

I mean if the original code intended to run-once the block, then that condition would make the code to be executed every time. so there's a bug to buggy code :)