sidekiq-unique-jobs 7.1.8 → 7.1.12
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sidekiq-unique-jobs might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +46 -0
- data/README.md +1 -1
- data/lib/sidekiq_unique_jobs/lua/unlock.lua +6 -7
- data/lib/sidekiq_unique_jobs/orphans/ruby_reaper.rb +21 -5
- data/lib/sidekiq_unique_jobs/version.rb +1 -1
- metadata +4 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 636522bb794fcb282d02d8f0978f25764dea0c0eb07a80886d88be4212094529
|
4
|
+
data.tar.gz: 875231fe2ef546537ab6d152366c2555d664ca79951a4a1af563a78b7cd6efe8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db7884313d19f561be0ee68327f1068647123919450d72eee8ddba504d8105d16fa72b4930f990cc5904cea742b4307731ebdec6baeb00dc15e4271c9d8ab7d4
|
7
|
+
data.tar.gz: 923268a0919c0787ee835399c1a1b01e5a98b0c103cf59faf9361bc218fa7f19a5a2f13ed84b751588f25a7ea682bae67c36c0f0e8e5a7a90b3598b4bcac82dc
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,51 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v7.1.11](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.1.11) (2021-11-30)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.1.10...v7.1.11)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Fix ruby reaper edge case [\#661](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/661) ([mhenrixon](https://github.com/mhenrixon))
|
10
|
+
|
11
|
+
**Closed issues:**
|
12
|
+
|
13
|
+
- Question: Wait instead of cancelling if it is executing? [\#655](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/655)
|
14
|
+
- Expired Locks remain in zset of digests \[using "until\_expired" lock\] [\#653](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/653)
|
15
|
+
- \[Q&A\] Performance & Dead Locks [\#652](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/652)
|
16
|
+
- Sidekiq 6.3.0 includes Job module that clashes with sidekiq\_unique\_ext.rb class Job [\#651](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/651)
|
17
|
+
|
18
|
+
## [v7.1.10](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.1.10) (2021-10-18)
|
19
|
+
|
20
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.1.8...v7.1.10)
|
21
|
+
|
22
|
+
**Fixed bugs:**
|
23
|
+
|
24
|
+
- "IndexError: string not matched" when job is replaced on client [\#635](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/635)
|
25
|
+
|
26
|
+
**Merged pull requests:**
|
27
|
+
|
28
|
+
- Update URL for Sidekiq's Enterprise unique jobs [\#648](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/648) ([jsantos](https://github.com/jsantos))
|
29
|
+
|
30
|
+
## [v7.1.8](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.1.8) (2021-10-08)
|
31
|
+
|
32
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.13...v7.1.8)
|
33
|
+
|
34
|
+
**Fixed bugs:**
|
35
|
+
|
36
|
+
- undefined method `delete' for class `Sidekiq::Job' [\#634](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/634)
|
37
|
+
- INFO keys not persisted when job is enqueued [\#602](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/602)
|
38
|
+
- lock\_info set to true but no lock info showing up in web ui [\#589](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/589)
|
39
|
+
- Prevent too eager cleanup of lock info [\#645](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/645) ([mhenrixon](https://github.com/mhenrixon))
|
40
|
+
|
41
|
+
**Closed issues:**
|
42
|
+
|
43
|
+
- Compatibility with unreleased Sidekiq 6.3.0 [\#636](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/636)
|
44
|
+
|
45
|
+
**Merged pull requests:**
|
46
|
+
|
47
|
+
- Update docs [\#644](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/644) ([andypple](https://github.com/andypple))
|
48
|
+
|
3
49
|
## [v7.0.13](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.13) (2021-09-27)
|
4
50
|
|
5
51
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.1.7...v7.0.13)
|
data/README.md
CHANGED
@@ -1043,7 +1043,7 @@ There is a [![Join the chat at https://gitter.im/mhenrixon/sidekiq-unique-jobs](
|
|
1043
1043
|
|
1044
1044
|
You can find a list of contributors over on [Contributors][]
|
1045
1045
|
|
1046
|
-
[Enterprise unique jobs]: https://
|
1046
|
+
[Enterprise unique jobs]: https://github.com/mperham/sidekiq/wiki/Ent-Unique-Jobs
|
1047
1047
|
[Contributors]: https://github.com/mhenrixon/sidekiq-unique-jobs/graphs/contributors
|
1048
1048
|
[v4.0.18]: https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v4.0.18
|
1049
1049
|
[v5.0.10]: https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v5.0.10.
|
@@ -65,18 +65,12 @@ redis.call("LREM", queued, -1, job_id)
|
|
65
65
|
log_debug("LREM", primed, -1, job_id)
|
66
66
|
redis.call("LREM", primed, -1, job_id)
|
67
67
|
|
68
|
-
if limit and limit <= 1 and locked_count and locked_count <= 1 then
|
69
|
-
log_debug("ZREM", digests, digest)
|
70
|
-
redis.call("ZREM", digests, digest)
|
71
|
-
end
|
72
|
-
|
73
68
|
local redis_version = toversion(redisversion)
|
74
69
|
local del_cmd = "DEL"
|
75
70
|
|
76
71
|
if tonumber(redis_version["major"]) >= 4 then del_cmd = "UNLINK"; end
|
77
72
|
|
78
73
|
if lock_type ~= "until_expired" then
|
79
|
-
|
80
74
|
log_debug(del_cmd, digest, info)
|
81
75
|
redis.call(del_cmd, digest, info)
|
82
76
|
|
@@ -86,11 +80,16 @@ end
|
|
86
80
|
|
87
81
|
local locked_count = redis.call("HLEN", locked)
|
88
82
|
|
89
|
-
if
|
83
|
+
if locked_count and locked_count < 1 then
|
90
84
|
log_debug(del_cmd, locked)
|
91
85
|
redis.call(del_cmd, locked)
|
92
86
|
end
|
93
87
|
|
88
|
+
if limit and limit <= 1 and locked_count and locked_count <= 1 then
|
89
|
+
log_debug("ZREM", digests, digest)
|
90
|
+
redis.call("ZREM", digests, digest)
|
91
|
+
end
|
92
|
+
|
94
93
|
log_debug("LPUSH", queued, "1")
|
95
94
|
redis.call("LPUSH", queued, "1")
|
96
95
|
|
@@ -9,6 +9,7 @@ module SidekiqUniqueJobs
|
|
9
9
|
#
|
10
10
|
# @author Mikael Henriksson <mikael@mhenrixon.com>
|
11
11
|
#
|
12
|
+
# rubocop:disable Metrics/ClassLength
|
12
13
|
class RubyReaper < Reaper
|
13
14
|
#
|
14
15
|
# @return [String] the suffix for :RUN locks
|
@@ -54,13 +55,27 @@ module SidekiqUniqueJobs
|
|
54
55
|
#
|
55
56
|
# @return [Array<String>] an array of orphaned digests
|
56
57
|
#
|
57
|
-
def orphans
|
58
|
-
|
59
|
-
|
58
|
+
def orphans # rubocop:disable Metrics/MethodLength
|
59
|
+
page = 0
|
60
|
+
per = reaper_count * 2
|
61
|
+
orphans = []
|
62
|
+
results = conn.zrange(digests.key, page * per, (page + 1) * per)
|
60
63
|
|
61
|
-
|
62
|
-
|
64
|
+
while results.size.positive?
|
65
|
+
results.each do |digest|
|
66
|
+
next if belongs_to_job?(digest)
|
67
|
+
|
68
|
+
orphans << digest
|
69
|
+
break if orphans.size >= reaper_count
|
70
|
+
end
|
71
|
+
|
72
|
+
break if orphans.size >= reaper_count
|
73
|
+
|
74
|
+
page += 1
|
75
|
+
results = conn.zrange(digests.key, page * per, (page + 1) * per)
|
63
76
|
end
|
77
|
+
|
78
|
+
orphans
|
64
79
|
end
|
65
80
|
|
66
81
|
#
|
@@ -211,5 +226,6 @@ module SidekiqUniqueJobs
|
|
211
226
|
conn.zscan_each(key, match: "*#{digest}*", count: 1).to_a.any?
|
212
227
|
end
|
213
228
|
end
|
229
|
+
# rubocop:enable Metrics/ClassLength
|
214
230
|
end
|
215
231
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-unique-jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.1.
|
4
|
+
version: 7.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikael Henriksson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: brpoplpush-redis_script
|
@@ -215,11 +215,7 @@ homepage: https://mhenrixon.github.io/sidekiq-unique-jobs
|
|
215
215
|
licenses:
|
216
216
|
- MIT
|
217
217
|
metadata:
|
218
|
-
|
219
|
-
bug_tracker_uri: https://github.com/mhenrixon/sidekiq-unique-jobs/issues
|
220
|
-
documentation_uri: https://mhenrixon.github.io/sidekiq-unique-jobs
|
221
|
-
source_code_uri: https://github.com/mhenrixon/sidekiq-unique-jobs
|
222
|
-
changelog_uri: https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/CHANGELOG.md
|
218
|
+
rubygems_mfa_required: 'true'
|
223
219
|
post_install_message: |
|
224
220
|
IMPORTANT!
|
225
221
|
|
@@ -261,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
261
257
|
- !ruby/object:Gem::Version
|
262
258
|
version: '0'
|
263
259
|
requirements: []
|
264
|
-
rubygems_version: 3.2.
|
260
|
+
rubygems_version: 3.2.32
|
265
261
|
signing_key:
|
266
262
|
specification_version: 4
|
267
263
|
summary: Sidekiq middleware that prevents duplicates jobs
|