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:
Make it very clear in the documentation that the prefix must not contain any characters other than [a-z][A-Z][0-9] just to be safe
Maybe check the Kue prefix to make sure its valid
If there is a LUA script error, log it somewhere or emit an error event on the Kue
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:
[a-z][A-Z][0-9]
just to be safeThanks