bullmq 1.91.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/classes/child-processor.js +0 -20
- package/dist/cjs/classes/child-processor.js.map +1 -1
- package/dist/cjs/classes/index.d.ts +0 -2
- package/dist/cjs/classes/index.js +0 -2
- package/dist/cjs/classes/index.js.map +1 -1
- package/dist/cjs/classes/queue-getters.d.ts +1 -0
- package/dist/cjs/classes/queue-getters.js +27 -2
- package/dist/cjs/classes/queue-getters.js.map +1 -1
- package/dist/cjs/classes/redis-connection.d.ts +2 -1
- package/dist/cjs/classes/redis-connection.js +5 -0
- package/dist/cjs/classes/redis-connection.js.map +1 -1
- package/dist/cjs/classes/scripts.js +6 -4
- package/dist/cjs/classes/scripts.js.map +1 -1
- package/dist/cjs/classes/worker.d.ts +11 -0
- package/dist/cjs/classes/worker.js +54 -21
- package/dist/cjs/classes/worker.js.map +1 -1
- package/dist/{esm/commands/addJob-9.lua → cjs/commands/addJob-8.lua} +10 -2
- package/dist/cjs/commands/includes/checkStalledJobs.lua +136 -0
- package/dist/cjs/commands/includes/getNextDelayedTimestamp.lua +13 -0
- package/dist/cjs/commands/includes/moveJobFromWaitToActive.lua +3 -10
- package/dist/cjs/commands/includes/promoteDelayedJobs.lua +57 -0
- package/dist/cjs/commands/moveStalledJobsToWait-8.lua +4 -102
- package/dist/cjs/commands/moveToActive-9.lua +67 -0
- package/dist/cjs/commands/moveToFinished-12.lua +29 -5
- package/dist/cjs/commands/promote-6.lua +6 -0
- package/dist/cjs/interfaces/index.d.ts +0 -1
- package/dist/cjs/interfaces/index.js +0 -1
- package/dist/cjs/interfaces/index.js.map +1 -1
- package/dist/cjs/interfaces/sandboxed-job.d.ts +0 -1
- package/dist/cjs/interfaces/worker-options.d.ts +10 -0
- package/dist/esm/classes/child-processor.js +0 -20
- package/dist/esm/classes/child-processor.js.map +1 -1
- package/dist/esm/classes/index.d.ts +0 -2
- package/dist/esm/classes/index.js +0 -2
- package/dist/esm/classes/index.js.map +1 -1
- package/dist/esm/classes/queue-getters.d.ts +1 -0
- package/dist/esm/classes/queue-getters.js +27 -2
- package/dist/esm/classes/queue-getters.js.map +1 -1
- package/dist/esm/classes/redis-connection.d.ts +2 -1
- package/dist/esm/classes/redis-connection.js +5 -0
- package/dist/esm/classes/redis-connection.js.map +1 -1
- package/dist/esm/classes/scripts.js +6 -4
- package/dist/esm/classes/scripts.js.map +1 -1
- package/dist/esm/classes/worker.d.ts +11 -0
- package/dist/esm/classes/worker.js +54 -21
- package/dist/esm/classes/worker.js.map +1 -1
- package/dist/{cjs/commands/addJob-9.lua → esm/commands/addJob-8.lua} +10 -2
- package/dist/esm/commands/includes/checkStalledJobs.lua +136 -0
- package/dist/esm/commands/includes/getNextDelayedTimestamp.lua +13 -0
- package/dist/esm/commands/includes/moveJobFromWaitToActive.lua +3 -10
- package/dist/esm/commands/includes/promoteDelayedJobs.lua +57 -0
- package/dist/esm/commands/moveStalledJobsToWait-8.lua +4 -102
- package/dist/esm/commands/moveToActive-9.lua +67 -0
- package/dist/esm/commands/moveToFinished-12.lua +29 -5
- package/dist/esm/commands/promote-6.lua +6 -0
- package/dist/esm/interfaces/index.d.ts +0 -1
- package/dist/esm/interfaces/index.js +0 -1
- package/dist/esm/interfaces/index.js.map +1 -1
- package/dist/esm/interfaces/sandboxed-job.d.ts +0 -1
- package/dist/esm/interfaces/worker-options.d.ts +10 -0
- package/package.json +1 -1
- package/dist/cjs/classes/compat.d.ts +0 -320
- package/dist/cjs/classes/compat.js +0 -682
- package/dist/cjs/classes/compat.js.map +0 -1
- package/dist/cjs/classes/queue-scheduler.d.ts +0 -75
- package/dist/cjs/classes/queue-scheduler.js +0 -199
- package/dist/cjs/classes/queue-scheduler.js.map +0 -1
- package/dist/cjs/commands/moveToActive-8.lua +0 -54
- package/dist/cjs/interfaces/queue-scheduler-options.d.ts +0 -23
- package/dist/cjs/interfaces/queue-scheduler-options.js +0 -3
- package/dist/cjs/interfaces/queue-scheduler-options.js.map +0 -1
- package/dist/esm/classes/compat.d.ts +0 -320
- package/dist/esm/classes/compat.js +0 -678
- package/dist/esm/classes/compat.js.map +0 -1
- package/dist/esm/classes/queue-scheduler.d.ts +0 -75
- package/dist/esm/classes/queue-scheduler.js +0 -195
- package/dist/esm/classes/queue-scheduler.js.map +0 -1
- package/dist/esm/commands/moveToActive-8.lua +0 -54
- package/dist/esm/interfaces/queue-scheduler-options.d.ts +0 -23
- package/dist/esm/interfaces/queue-scheduler-options.js +0 -2
- package/dist/esm/interfaces/queue-scheduler-options.js.map +0 -1
@@ -23,7 +23,6 @@
|
|
23
23
|
KEYS[6] 'priority'
|
24
24
|
KEYS[7] 'completed'
|
25
25
|
KEYS[8] events stream key
|
26
|
-
KEYS[9] delay stream key
|
27
26
|
|
28
27
|
ARGV[1] msgpacked arguments array
|
29
28
|
[1] key prefix,
|
@@ -61,6 +60,7 @@ local parentData
|
|
61
60
|
--- @include "includes/addJobWithPriority"
|
62
61
|
--- @include "includes/getTargetQueueList"
|
63
62
|
--- @include "includes/trimEvents"
|
63
|
+
--- @include "includes/getNextDelayedTimestamp"
|
64
64
|
|
65
65
|
if parentKey ~= nil then
|
66
66
|
if rcall("EXISTS", parentKey) ~= 1 then
|
@@ -139,7 +139,15 @@ elseif (delayedTimestamp ~= 0) then
|
|
139
139
|
rcall("ZADD", KEYS[5], timestamp, jobId)
|
140
140
|
rcall("XADD", KEYS[8], "*", "event", "delayed", "jobId", jobId, "delay",
|
141
141
|
delayedTimestamp)
|
142
|
-
|
142
|
+
-- If wait list is empty, and this delayed job is the next one to be processed,
|
143
|
+
-- then we need to signal the workers by adding a dummy job (jobId 0) to the wait list.
|
144
|
+
local target = getTargetQueueList(KEYS[3], KEYS[1], KEYS[2])
|
145
|
+
if rcall("LLEN", target) == 0 then
|
146
|
+
local nextTimestamp = getNextDelayedTimestamp(KEYS[5])
|
147
|
+
if delayedTimestamp < nextTimestamp then
|
148
|
+
rcall("LPUSH", target, 0)
|
149
|
+
end
|
150
|
+
end
|
143
151
|
else
|
144
152
|
local target = getTargetQueueList(KEYS[3], KEYS[1], KEYS[2])
|
145
153
|
|
@@ -0,0 +1,136 @@
|
|
1
|
+
--[[
|
2
|
+
Move stalled jobs to wait.
|
3
|
+
|
4
|
+
Input:
|
5
|
+
stalledKey 'stalled' (SET)
|
6
|
+
waitKey 'wait', (LIST)
|
7
|
+
activeKey 'active', (LIST)
|
8
|
+
failedKey 'failed', (ZSET)
|
9
|
+
stalledCheckKey 'stalled-check', (KEY)
|
10
|
+
metaKey 'meta', (KEY)
|
11
|
+
pausedKey 'paused', (LIST)
|
12
|
+
eventStreamKey 'event stream' (STREAM)
|
13
|
+
|
14
|
+
maxStalledJobCount Max stalled job count
|
15
|
+
queueKeyPrefix queue.toKey('')
|
16
|
+
timestamp timestamp
|
17
|
+
maxCheckTime max check time
|
18
|
+
|
19
|
+
Events:
|
20
|
+
'stalled' with stalled job id.
|
21
|
+
]] local rcall = redis.call
|
22
|
+
|
23
|
+
-- Includes
|
24
|
+
--- @include "batches"
|
25
|
+
--- @include "getTargetQueueList"
|
26
|
+
--- @include "removeJob"
|
27
|
+
--- @include "removeJobsByMaxAge"
|
28
|
+
--- @include "removeJobsByMaxCount"
|
29
|
+
--- @include "trimEvents"
|
30
|
+
|
31
|
+
-- Check if we need to check for stalled jobs now.
|
32
|
+
|
33
|
+
local function checkStalledJobs(stalledKey, waitKey, activeKey, failedKey, stalledCheckKey, metaKey, pausedKey, eventStreamKey, maxStalledJobCount, queueKeyPrefix, timestamp, maxCheckTime)
|
34
|
+
if rcall("EXISTS", stalledCheckKey) == 1 then
|
35
|
+
return {{}, {}}
|
36
|
+
end
|
37
|
+
|
38
|
+
rcall("SET", stalledCheckKey, timestamp, "PX", maxCheckTime)
|
39
|
+
|
40
|
+
-- Trim events before emiting them to avoid trimming events emitted in this script
|
41
|
+
trimEvents(metaKey, eventStreamKey)
|
42
|
+
|
43
|
+
-- Move all stalled jobs to wait
|
44
|
+
local stalling = rcall('SMEMBERS', stalledKey)
|
45
|
+
local stalled = {}
|
46
|
+
local failed = {}
|
47
|
+
if (#stalling > 0) then
|
48
|
+
rcall('DEL', stalledKey)
|
49
|
+
|
50
|
+
local MAX_STALLED_JOB_COUNT = tonumber(maxStalledJobCount)
|
51
|
+
|
52
|
+
-- Remove from active list
|
53
|
+
for i, jobId in ipairs(stalling) do
|
54
|
+
|
55
|
+
if jobId == '0' then
|
56
|
+
-- If the jobId is a delay marker ID we just remove it.
|
57
|
+
local removed = rcall("LREM", activeKey, 1, jobId)
|
58
|
+
else
|
59
|
+
local jobKey = queueKeyPrefix .. jobId
|
60
|
+
|
61
|
+
-- Check that the lock is also missing, then we can handle this job as really stalled.
|
62
|
+
if (rcall("EXISTS", jobKey .. ":lock") == 0) then
|
63
|
+
-- Remove from the active queue.
|
64
|
+
local removed = rcall("LREM", activeKey, 1, jobId)
|
65
|
+
|
66
|
+
if (removed > 0) then
|
67
|
+
-- If this job has been stalled too many times, such as if it crashes the worker, then fail it.
|
68
|
+
local stalledCount =
|
69
|
+
rcall("HINCRBY", jobKey, "stalledCounter", 1)
|
70
|
+
if (stalledCount > MAX_STALLED_JOB_COUNT) then
|
71
|
+
local rawOpts = rcall("HGET", jobKey, "opts")
|
72
|
+
local opts = cjson.decode(rawOpts)
|
73
|
+
local removeOnFailType = type(opts["removeOnFail"])
|
74
|
+
rcall("ZADD", failedKey, timestamp, jobId)
|
75
|
+
local failedReason =
|
76
|
+
"job stalled more than allowable limit"
|
77
|
+
rcall("HMSET", jobKey, "failedReason", failedReason,
|
78
|
+
"finishedOn", timestamp)
|
79
|
+
rcall("XADD", eventStreamKey, "*", "event", "failed", "jobId",
|
80
|
+
jobId, 'prev', 'active', 'failedReason',
|
81
|
+
failedReason)
|
82
|
+
|
83
|
+
if removeOnFailType == "number" then
|
84
|
+
removeJobsByMaxCount(opts["removeOnFail"], failedKey,
|
85
|
+
queueKeyPrefix)
|
86
|
+
elseif removeOnFailType == "boolean" then
|
87
|
+
if opts["removeOnFail"] then
|
88
|
+
removeJob(jobId, false, queueKeyPrefix)
|
89
|
+
rcall("ZREM", failedKey, jobId)
|
90
|
+
end
|
91
|
+
elseif removeOnFailType ~= "nil" then
|
92
|
+
local maxAge = opts["removeOnFail"]["age"]
|
93
|
+
local maxCount = opts["removeOnFail"]["count"]
|
94
|
+
|
95
|
+
if maxAge ~= nil then
|
96
|
+
removeJobsByMaxAge(timestamp, maxAge, failedKey,
|
97
|
+
queueKeyPrefix)
|
98
|
+
end
|
99
|
+
|
100
|
+
if maxCount ~= nil and maxCount > 0 then
|
101
|
+
removeJobsByMaxCount(maxCount, failedKey, queueKeyPrefix)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
table.insert(failed, jobId)
|
106
|
+
else
|
107
|
+
local target = getTargetQueueList(metaKey, waitKey,
|
108
|
+
pausedKey)
|
109
|
+
|
110
|
+
-- Move the job back to the wait queue, to immediately be picked up by a waiting worker.
|
111
|
+
rcall("RPUSH", target, jobId)
|
112
|
+
rcall("XADD", eventStreamKey, "*", "event", "waiting", "jobId",
|
113
|
+
jobId, 'prev', 'active')
|
114
|
+
|
115
|
+
-- Emit the stalled event
|
116
|
+
rcall("XADD", eventStreamKey, "*", "event", "stalled", "jobId",
|
117
|
+
jobId)
|
118
|
+
table.insert(stalled, jobId)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
-- Mark potentially stalled jobs
|
127
|
+
local active = rcall('LRANGE', activeKey, 0, -1)
|
128
|
+
|
129
|
+
if (#active > 0) then
|
130
|
+
for from, to in batches(#active, 7000) do
|
131
|
+
rcall('SADD', stalledKey, unpack(active, from, to))
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
return {failed, stalled}
|
136
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
--[[
|
2
|
+
Function to return the next delayed job timestamp.
|
3
|
+
]]
|
4
|
+
local function getNextDelayedTimestamp(delayedKey)
|
5
|
+
local result = rcall("ZRANGE", delayedKey, 0, 0, "WITHSCORES")
|
6
|
+
if #result then
|
7
|
+
local nextTimestamp = tonumber(result[2])
|
8
|
+
if (nextTimestamp ~= nil) then
|
9
|
+
nextTimestamp = nextTimestamp / 0x1000
|
10
|
+
end
|
11
|
+
return nextTimestamp
|
12
|
+
end
|
13
|
+
end
|
@@ -12,9 +12,6 @@
|
|
12
12
|
keys[6] rate limiter key
|
13
13
|
keys[7] delayed key
|
14
14
|
|
15
|
-
-- Delay events
|
16
|
-
keys[8] delay stream key
|
17
|
-
|
18
15
|
opts - token - lock token
|
19
16
|
opts - lockDuration
|
20
17
|
opts - limiter
|
@@ -57,7 +54,7 @@ local function moveJobFromWaitToActive(keys, keyPrefix, jobId, processedOn, opts
|
|
57
54
|
-- put job into delayed queue
|
58
55
|
rcall("ZADD", keys[7], timestamp * 0x1000 + bit.band(jobCounter, 0xfff), jobId);
|
59
56
|
rcall("XADD", keys[4], "*", "event", "delayed", "jobId", jobId, "delay", timestamp);
|
60
|
-
|
57
|
+
|
61
58
|
-- remove from active queue
|
62
59
|
rcall("LREM", keys[2], 1, jobId)
|
63
60
|
|
@@ -72,20 +69,16 @@ local function moveJobFromWaitToActive(keys, keyPrefix, jobId, processedOn, opts
|
|
72
69
|
|
73
70
|
local jobKey = keyPrefix .. jobId
|
74
71
|
local lockKey = jobKey .. ':lock'
|
75
|
-
|
72
|
+
|
76
73
|
-- get a lock
|
77
74
|
if opts['token'] ~= "0" then
|
78
75
|
rcall("SET", lockKey, opts['token'], "PX", opts['lockDuration'])
|
79
76
|
end
|
80
|
-
|
77
|
+
|
81
78
|
rcall("ZREM", keys[3], jobId) -- remove from priority
|
82
79
|
rcall("XADD", keys[4], "*", "event", "active", "jobId", jobId, "prev", "waiting")
|
83
80
|
rcall("HSET", jobKey, "processedOn", processedOn)
|
84
81
|
rcall("HINCRBY", jobKey, "attemptsMade", 1)
|
85
|
-
local len = rcall("LLEN", keys[1])
|
86
|
-
if len == 0 then
|
87
|
-
rcall("XADD", keys[4], "*", "event", "drained");
|
88
|
-
end
|
89
82
|
|
90
83
|
return {rcall("HGETALL", jobKey), jobId} -- get job data
|
91
84
|
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
--[[
|
2
|
+
Updates the delay set, by moving delayed jobs that should
|
3
|
+
be processed now to "wait".
|
4
|
+
|
5
|
+
Events:
|
6
|
+
'waiting'
|
7
|
+
]]
|
8
|
+
local rcall = redis.call
|
9
|
+
|
10
|
+
-- Includes
|
11
|
+
--- @include "getTargetQueueList"
|
12
|
+
|
13
|
+
-- Try to get as much as 1000 jobs at once, and returns the nextTimestamp if
|
14
|
+
-- there are more delayed jobs to process.
|
15
|
+
local function promoteDelayedJobs(delayedKey, waitKey, priorityKey, pausedKey,
|
16
|
+
metaKey, eventStreamKey, prefix, timestamp)
|
17
|
+
local jobs = rcall("ZRANGEBYSCORE", delayedKey, 0, (timestamp + 1) * 0x1000, "LIMIT", 0, 1000)
|
18
|
+
|
19
|
+
if (#jobs > 0) then
|
20
|
+
rcall("ZREM", delayedKey, unpack(jobs))
|
21
|
+
|
22
|
+
-- check if we need to use push in paused instead of waiting
|
23
|
+
local target = getTargetQueueList(metaKey, waitKey, pausedKey)
|
24
|
+
|
25
|
+
for _, jobId in ipairs(jobs) do
|
26
|
+
local priority =
|
27
|
+
tonumber(rcall("HGET", prefix .. jobId, "priority")) or 0
|
28
|
+
|
29
|
+
if priority == 0 then
|
30
|
+
-- LIFO or FIFO
|
31
|
+
rcall("LPUSH", target, jobId)
|
32
|
+
else
|
33
|
+
-- Priority add
|
34
|
+
rcall("ZADD", priorityKey, priority, jobId)
|
35
|
+
local count = rcall("ZCOUNT", priorityKey, 0, priority)
|
36
|
+
|
37
|
+
local len = rcall("LLEN", target)
|
38
|
+
local id = rcall("LINDEX", target, len - (count - 1))
|
39
|
+
if id then
|
40
|
+
rcall("LINSERT", target, "BEFORE", id, jobId)
|
41
|
+
else
|
42
|
+
rcall("RPUSH", target, jobId)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
-- Emit waiting event
|
47
|
+
rcall("XADD", eventStreamKey, "*", "event", "waiting", "jobId",
|
48
|
+
jobId, "prev", "delayed")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
local nextTimestamp = rcall("ZRANGE", delayedKey, 0, 0, "WITHSCORES")[2]
|
53
|
+
if (nextTimestamp ~= nil) then
|
54
|
+
nextTimestamp = nextTimestamp / 0x1000
|
55
|
+
end
|
56
|
+
return nextTimestamp
|
57
|
+
end
|
@@ -18,105 +18,7 @@
|
|
18
18
|
|
19
19
|
Events:
|
20
20
|
'stalled' with stalled job id.
|
21
|
-
]]
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
--- @include "includes/batches"
|
26
|
-
--- @include "includes/getTargetQueueList"
|
27
|
-
--- @include "includes/removeJob"
|
28
|
-
--- @include "includes/removeJobsByMaxAge"
|
29
|
-
--- @include "includes/removeJobsByMaxCount"
|
30
|
-
--- @include "includes/trimEvents"
|
31
|
-
|
32
|
-
-- Check if we need to check for stalled jobs now.
|
33
|
-
if rcall("EXISTS", KEYS[5]) == 1 then return {{}, {}} end
|
34
|
-
|
35
|
-
rcall("SET", KEYS[5], ARGV[3], "PX", ARGV[4])
|
36
|
-
|
37
|
-
-- Trim events before emiting them to avoid trimming events emitted in this script
|
38
|
-
trimEvents(KEYS[6], KEYS[8])
|
39
|
-
|
40
|
-
-- Move all stalled jobs to wait
|
41
|
-
local stalling = rcall('SMEMBERS', KEYS[1])
|
42
|
-
local stalled = {}
|
43
|
-
local failed = {}
|
44
|
-
if (#stalling > 0) then
|
45
|
-
rcall('DEL', KEYS[1])
|
46
|
-
|
47
|
-
local MAX_STALLED_JOB_COUNT = tonumber(ARGV[1])
|
48
|
-
|
49
|
-
-- Remove from active list
|
50
|
-
for i, jobId in ipairs(stalling) do
|
51
|
-
local jobKey = ARGV[2] .. jobId
|
52
|
-
|
53
|
-
-- Check that the lock is also missing, then we can handle this job as really stalled.
|
54
|
-
if (rcall("EXISTS", jobKey .. ":lock") == 0) then
|
55
|
-
-- Remove from the active queue.
|
56
|
-
local removed = rcall("LREM", KEYS[3], 1, jobId)
|
57
|
-
|
58
|
-
if (removed > 0) then
|
59
|
-
-- If this job has been stalled too many times, such as if it crashes the worker, then fail it.
|
60
|
-
local stalledCount = rcall("HINCRBY", jobKey, "stalledCounter",
|
61
|
-
1)
|
62
|
-
if (stalledCount > MAX_STALLED_JOB_COUNT) then
|
63
|
-
local rawOpts = rcall("HGET",jobKey, "opts")
|
64
|
-
local opts = cjson.decode(rawOpts)
|
65
|
-
local removeOnFailType = type(opts["removeOnFail"])
|
66
|
-
rcall("ZADD", KEYS[4], ARGV[3], jobId)
|
67
|
-
local failedReason = "job stalled more than allowable limit"
|
68
|
-
rcall("HMSET", jobKey, "failedReason",
|
69
|
-
failedReason, "finishedOn", ARGV[3])
|
70
|
-
rcall("XADD", KEYS[8], "*", "event", "failed", "jobId",
|
71
|
-
jobId, 'prev', 'active', 'failedReason',
|
72
|
-
failedReason)
|
73
|
-
|
74
|
-
if removeOnFailType == "number" then
|
75
|
-
removeJobsByMaxCount(opts["removeOnFail"], KEYS[4], ARGV[2])
|
76
|
-
elseif removeOnFailType == "boolean" then
|
77
|
-
if opts["removeOnFail"] then
|
78
|
-
removeJob(jobId, false, ARGV[2])
|
79
|
-
rcall("ZREM", KEYS[4], jobId)
|
80
|
-
end
|
81
|
-
elseif removeOnFailType ~= "nil" then
|
82
|
-
local maxAge = opts["removeOnFail"]["age"]
|
83
|
-
local maxCount = opts["removeOnFail"]["count"]
|
84
|
-
|
85
|
-
if maxAge ~= nil then
|
86
|
-
removeJobsByMaxAge(ARGV[3], maxAge, KEYS[4], ARGV[2])
|
87
|
-
end
|
88
|
-
|
89
|
-
if maxCount ~= nil and maxCount > 0 then
|
90
|
-
removeJobsByMaxCount(maxCount, KEYS[4], ARGV[2])
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
table.insert(failed, jobId)
|
95
|
-
else
|
96
|
-
local target = getTargetQueueList(KEYS[6], KEYS[2], KEYS[7])
|
97
|
-
|
98
|
-
-- Move the job back to the wait queue, to immediately be picked up by a waiting worker.
|
99
|
-
rcall("RPUSH", target, jobId)
|
100
|
-
rcall("XADD", KEYS[8], "*", "event", "waiting", "jobId",
|
101
|
-
jobId, 'prev', 'active')
|
102
|
-
|
103
|
-
-- Emit the stalled event
|
104
|
-
rcall("XADD", KEYS[8], "*", "event", "stalled", "jobId",
|
105
|
-
jobId)
|
106
|
-
table.insert(stalled, jobId)
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
-- Mark potentially stalled jobs
|
114
|
-
local active = rcall('LRANGE', KEYS[3], 0, -1)
|
115
|
-
|
116
|
-
if (#active > 0) then
|
117
|
-
for from, to in batches(#active, 7000) do
|
118
|
-
rcall('SADD', KEYS[1], unpack(active, from, to))
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
return {failed, stalled}
|
21
|
+
]] -- Includes
|
22
|
+
--- @include "includes/checkStalledJobs"
|
23
|
+
return checkStalledJobs(KEYS[1], KEYS[2], KEYS[3], KEYS[4], KEYS[5], KEYS[6],
|
24
|
+
KEYS[7], KEYS[8], ARGV[1], ARGV[2], ARGV[3], ARGV[4])
|
@@ -0,0 +1,67 @@
|
|
1
|
+
--[[
|
2
|
+
Move next job to be processed to active, lock it and fetch its data. The job
|
3
|
+
may be delayed, in that case we need to move it to the delayed set instead.
|
4
|
+
|
5
|
+
This operation guarantees that the worker owns the job during the lock
|
6
|
+
expiration time. The worker is responsible of keeping the lock fresh
|
7
|
+
so that no other worker picks this job again.
|
8
|
+
|
9
|
+
Input:
|
10
|
+
KEYS[1] wait key
|
11
|
+
KEYS[2] active key
|
12
|
+
KEYS[3] priority key
|
13
|
+
KEYS[4] stream events key
|
14
|
+
KEYS[5] stalled key
|
15
|
+
|
16
|
+
-- Rate limiting
|
17
|
+
KEYS[6] rate limiter key
|
18
|
+
KEYS[7] delayed key
|
19
|
+
|
20
|
+
-- Promote delayed jobs
|
21
|
+
KEYS[8] paused key
|
22
|
+
KEYS[9] meta key
|
23
|
+
|
24
|
+
-- Arguments
|
25
|
+
ARGV[1] key prefix
|
26
|
+
ARGV[2] timestamp
|
27
|
+
ARGV[3] optional job ID
|
28
|
+
ARGV[4] opts
|
29
|
+
|
30
|
+
opts - token - lock token
|
31
|
+
opts - lockDuration
|
32
|
+
opts - limiter
|
33
|
+
]]
|
34
|
+
local jobId
|
35
|
+
local rcall = redis.call
|
36
|
+
|
37
|
+
-- Includes
|
38
|
+
--- @include "includes/moveJobFromWaitToActive"
|
39
|
+
--- @include "includes/getNextDelayedTimestamp"
|
40
|
+
--- @include "includes/promoteDelayedJobs"
|
41
|
+
|
42
|
+
-- Check if there are delayed jobs that we can move to wait.
|
43
|
+
promoteDelayedJobs(KEYS[7], KEYS[1], KEYS[3], KEYS[8], KEYS[9], KEYS[4], ARGV[1], ARGV[2])
|
44
|
+
|
45
|
+
if (ARGV[3] ~= "") then
|
46
|
+
jobId = ARGV[3]
|
47
|
+
-- clean stalled key
|
48
|
+
rcall("SREM", KEYS[5], jobId)
|
49
|
+
else
|
50
|
+
-- no job ID, try non-blocking move from wait to active
|
51
|
+
jobId = rcall("RPOPLPUSH", KEYS[1], KEYS[2])
|
52
|
+
end
|
53
|
+
|
54
|
+
-- If jobId is special ID 0, then there is no job to process
|
55
|
+
if jobId == "0" then
|
56
|
+
rcall("LREM", KEYS[2], 1, 0)
|
57
|
+
elseif jobId then
|
58
|
+
local opts = cmsgpack.unpack(ARGV[4])
|
59
|
+
-- this script is not really moving, it is preparing the job for processing
|
60
|
+
return moveJobFromWaitToActive(KEYS, ARGV[1], jobId, ARGV[2], opts)
|
61
|
+
end
|
62
|
+
|
63
|
+
-- Return the timestamp for the next delayed job if any.
|
64
|
+
local nextTimestamp = getNextDelayedTimestamp(KEYS[7])
|
65
|
+
if (nextTimestamp ~= nil) then
|
66
|
+
return nextTimestamp - tonumber(ARGV[2])
|
67
|
+
end
|
@@ -15,8 +15,7 @@
|
|
15
15
|
KEYS[6] rate limiter key
|
16
16
|
KEYS[7] delayed key
|
17
17
|
|
18
|
-
|
19
|
-
KEYS[8] delay stream key
|
18
|
+
KEYS[8] paused key
|
20
19
|
|
21
20
|
KEYS[9] completed/failed key
|
22
21
|
KEYS[10] jobId key
|
@@ -62,6 +61,8 @@ local rcall = redis.call
|
|
62
61
|
--- @include "includes/trimEvents"
|
63
62
|
--- @include "includes/updateParentDepsIfNeeded"
|
64
63
|
--- @include "includes/collectMetrics"
|
64
|
+
--- @include "includes/getNextDelayedTimestamp"
|
65
|
+
--- @include "includes/promoteDelayedJobs"
|
65
66
|
|
66
67
|
local jobIdKey = KEYS[10]
|
67
68
|
if rcall("EXISTS", jobIdKey) == 1 then -- // Make sure job exists
|
@@ -160,13 +161,36 @@ if rcall("EXISTS", jobIdKey) == 1 then -- // Make sure job exists
|
|
160
161
|
-- Try to get next job to avoid an extra roundtrip if the queue is not closing,
|
161
162
|
-- and not rate limited.
|
162
163
|
if (ARGV[7] == "1") then
|
163
|
-
|
164
|
-
|
165
|
-
|
164
|
+
|
165
|
+
-- Check if there are delayed jobs that can be promoted
|
166
|
+
promoteDelayedJobs(KEYS[7], KEYS[1], KEYS[3], KEYS[8], KEYS[11], KEYS[4], ARGV[8], timestamp)
|
167
|
+
|
168
|
+
jobId = rcall("RPOPLPUSH", KEYS[1], KEYS[2])
|
169
|
+
|
170
|
+
if jobId == "0" then
|
171
|
+
rcall("LREM", KEYS[2], 1, 0)
|
172
|
+
elseif jobId then
|
166
173
|
return moveJobFromWaitToActive(KEYS, ARGV[8], jobId, timestamp, opts)
|
167
174
|
end
|
175
|
+
|
176
|
+
-- Return the timestamp for the next delayed job if any.
|
177
|
+
local nextTimestamp = getNextDelayedTimestamp(KEYS[7])
|
178
|
+
if (nextTimestamp ~= nil) then
|
179
|
+
-- The result is guaranteed to be positive, since the
|
180
|
+
-- ZRANGEBYSCORE command would have return a job otherwise.
|
181
|
+
return nextTimestamp - timestamp
|
182
|
+
end
|
168
183
|
end
|
169
184
|
|
185
|
+
local waitLen = rcall("LLEN", KEYS[1])
|
186
|
+
if waitLen == 0 then
|
187
|
+
local activeLen = rcall("LLEN", KEYS[2])
|
188
|
+
|
189
|
+
if activeLen == 0 then
|
190
|
+
rcall("XADD", KEYS[4], "*", "event", "drained")
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
170
194
|
return 0
|
171
195
|
else
|
172
196
|
return -1
|
@@ -25,6 +25,12 @@ if rcall("ZREM", KEYS[1], jobId) == 1 then
|
|
25
25
|
local priority = tonumber(rcall("HGET", ARGV[1] .. jobId, "priority")) or 0
|
26
26
|
local target = getTargetQueueList(KEYS[4], KEYS[2], KEYS[3])
|
27
27
|
|
28
|
+
-- Remove delayed "marker" from the wait list if there is any.
|
29
|
+
-- Since we are adding a job we do not need the marker anymore.
|
30
|
+
if rcall("LINDEX", target, 0) == "0" then
|
31
|
+
rcall("LPOP", target)
|
32
|
+
end
|
33
|
+
|
28
34
|
if priority == 0 then
|
29
35
|
-- LIFO or FIFO
|
30
36
|
rcall("LPUSH", target, jobId)
|
@@ -14,7 +14,6 @@ export * from './parent-command';
|
|
14
14
|
export * from './parent-message';
|
15
15
|
export * from './parent';
|
16
16
|
export * from './queue-options';
|
17
|
-
export * from './queue-scheduler-options';
|
18
17
|
export * from './rate-limiter-options';
|
19
18
|
export * from './redis-options';
|
20
19
|
export * from './redis-streams';
|
@@ -17,7 +17,6 @@ tslib_1.__exportStar(require("./parent-command"), exports);
|
|
17
17
|
tslib_1.__exportStar(require("./parent-message"), exports);
|
18
18
|
tslib_1.__exportStar(require("./parent"), exports);
|
19
19
|
tslib_1.__exportStar(require("./queue-options"), exports);
|
20
|
-
tslib_1.__exportStar(require("./queue-scheduler-options"), exports);
|
21
20
|
tslib_1.__exportStar(require("./rate-limiter-options"), exports);
|
22
21
|
tslib_1.__exportStar(require("./redis-options"), exports);
|
23
22
|
tslib_1.__exportStar(require("./redis-streams"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,4DAAkC;AAClC,0DAAgC;AAChC,0DAAgC;AAChC,uDAA6B;AAC7B,qDAA2B;AAC3B,2DAAiC;AACjC,qDAA2B;AAC3B,yDAA+B;AAC/B,sDAA4B;AAC5B,4DAAkC;AAClC,oDAA0B;AAC1B,2DAAiC;AACjC,2DAAiC;AACjC,mDAAyB;AACzB,0DAAgC;AAChC,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,4DAAkC;AAClC,0DAAgC;AAChC,0DAAgC;AAChC,uDAA6B;AAC7B,qDAA2B;AAC3B,2DAAiC;AACjC,qDAA2B;AAC3B,yDAA+B;AAC/B,sDAA4B;AAC5B,4DAAkC;AAClC,oDAA0B;AAC1B,2DAAiC;AACjC,2DAAiC;AACjC,mDAAyB;AACzB,0DAAgC;AAChC,iEAAuC;AACvC,0DAAgC;AAChC,0DAAgC;AAChC,2DAAiC;AACjC,oEAA0C;AAC1C,0DAAgC;AAChC,2DAAiC"}
|
@@ -6,7 +6,6 @@ import { JobsOptions } from './jobs-options';
|
|
6
6
|
export interface SandboxedJob<T = any, R = any> extends Omit<JobJson, 'data' | 'opts' | 'progress' | 'returnValue'> {
|
7
7
|
data: T;
|
8
8
|
opts: JobsOptions;
|
9
|
-
progress: (() => object | number) | ((value: object | number) => Promise<void>);
|
10
9
|
updateProgress: (value: object | number) => Promise<void>;
|
11
10
|
log: (row: any) => void;
|
12
11
|
update: (data: any) => Promise<void>;
|
@@ -29,6 +29,16 @@ export interface WorkerOptions extends QueueBaseOptions {
|
|
29
29
|
* @see {@link https://docs.bullmq.io/guide/metrics}
|
30
30
|
*/
|
31
31
|
metrics?: MetricsOptions;
|
32
|
+
/**
|
33
|
+
* Amount of times a job can be recovered from a stalled state
|
34
|
+
* to the `wait` state. If this is exceeded, the job is moved
|
35
|
+
* to `failed`.
|
36
|
+
*/
|
37
|
+
maxStalledCount?: number;
|
38
|
+
/**
|
39
|
+
* Number of milliseconds between stallness checks.
|
40
|
+
*/
|
41
|
+
stalledInterval?: number;
|
32
42
|
skipDelayCheck?: boolean;
|
33
43
|
drainDelay?: number;
|
34
44
|
lockDuration?: number;
|
@@ -128,27 +128,7 @@ function wrapJob(job) {
|
|
128
128
|
value: progress,
|
129
129
|
});
|
130
130
|
};
|
131
|
-
const progress = (progress) => {
|
132
|
-
console.warn([
|
133
|
-
'BullMQ: DEPRECATION WARNING! progress function in sandboxed processor is deprecated. This will',
|
134
|
-
'be removed in the next major release, you should use updateProgress method instead.',
|
135
|
-
].join(' '));
|
136
|
-
if (progress) {
|
137
|
-
return updateProgress(progress);
|
138
|
-
}
|
139
|
-
else {
|
140
|
-
// Return the last known progress value.
|
141
|
-
return progressValue;
|
142
|
-
}
|
143
|
-
};
|
144
131
|
return Object.assign(Object.assign({}, job), { data: JSON.parse(job.data || '{}'), opts: job.opts, returnValue: JSON.parse(job.returnvalue || '{}'),
|
145
|
-
/**
|
146
|
-
* @deprecated Use updateProgress instead.
|
147
|
-
* Emulate the real job `progress` function.
|
148
|
-
* If no argument is given, it behaves as a sync getter.
|
149
|
-
* If an argument is given, it behaves as an async setter.
|
150
|
-
*/
|
151
|
-
progress,
|
152
132
|
/*
|
153
133
|
* Emulate the real job `updateProgress` function, should works as `progress` function.
|
154
134
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"child-processor.js","sourceRoot":"","sources":["../../../src/classes/child-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAW,aAAa,EAAgB,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ACH,GAAG,EAAE,KAAK,EAAE,GAAQ,EAAE,EAAE;YACtB,SAAS,CAAC,OAAO,EAAE;gBACjB,GAAG,EAAE,aAAa,CAAC,GAAG;gBACtB,KAAK,EAAE,GAAG;aACX,CAAC,CAAC;QACL,CAAC;QACD;;WAEG;QACH,MAAM,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;YAC1B,SAAS,CAAC,OAAO,EAAE;gBACjB,GAAG,EAAE,aAAa,CAAC,MAAM;gBACzB,KAAK,EAAE,IAAI;aACZ,CAAC,CAAC;QACL,CAAC,IACD;AACJ,CAAC"}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
export * from './backoffs';
|
2
2
|
export * from './child-pool';
|
3
3
|
export * from './child-processor';
|
4
|
-
export * from './compat';
|
5
4
|
export * from './flow-producer';
|
6
5
|
export * from './job';
|
7
6
|
export * from './process-utils';
|
@@ -9,7 +8,6 @@ export * from './queue-base';
|
|
9
8
|
export * from './queue-events';
|
10
9
|
export * from './queue-getters';
|
11
10
|
export * from './queue-keys';
|
12
|
-
export * from './queue-scheduler';
|
13
11
|
export * from './queue';
|
14
12
|
export * from './redis-connection';
|
15
13
|
export * from './repeat';
|
@@ -1,7 +1,6 @@
|
|
1
1
|
export * from './backoffs';
|
2
2
|
export * from './child-pool';
|
3
3
|
export * from './child-processor';
|
4
|
-
export * from './compat';
|
5
4
|
export * from './flow-producer';
|
6
5
|
export * from './job';
|
7
6
|
// export * from './master'; this file must not be exported
|
@@ -10,7 +9,6 @@ export * from './queue-base';
|
|
10
9
|
export * from './queue-events';
|
11
10
|
export * from './queue-getters';
|
12
11
|
export * from './queue-keys';
|
13
|
-
export * from './queue-scheduler';
|
14
12
|
export * from './queue';
|
15
13
|
export * from './redis-connection';
|
16
14
|
export * from './repeat';
|