Automattic / kue

Kue is a priority job queue backed by redis, built for node.js.
http://automattic.github.io/kue
MIT License
9.45k stars 862 forks source link

Kue prefix should be checked for invalid characters #1108

Open Quilamir opened 6 years ago

Quilamir commented 6 years ago

I had a very annoying issue on our Kue where sometimes jobs would get stuck in the inactive state.

After understanding how Kue handles this problem with the watchStuckJobs I came to realize that the LUA script that is supposed to synchronize the Kue is using a regular expression with the Kue prefix.

If the Kue prefix contains any special characters this regular expression "breaks" and the LUA interpreter throws an error since the result of the regular expression returns as nil, this error never bubbles up, it just causes the watchStuckJobs to clear its interval and never run again.

I would propose to:

Thanks