sidekiq-pool 1.9.0 → 1.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a570cfb2092036b76f35e89ea276f9eb39b7b68645213257a739ae0e7b1d25d
4
- data.tar.gz: 10c418961feaa04d49c0e8c23faefe55c56a4d06a2ea1cf9b57e48958c0ec46d
3
+ metadata.gz: 403e1c51450636ac06842eed5212b20803149a6f9ce87fd91068482adfa47f36
4
+ data.tar.gz: e89c1e119f37f60f16cdc54918798a6d2559fb9e4f56914f8ffb2dc8774b7913
5
5
  SHA512:
6
- metadata.gz: 8f88af075fa30a0ef809ec9874cd04ee8794015152e118146bda044ea303828426a67c577e3b7cb141849676fe81dec2b6a41e04737e79a39d34ff39f68bec50
7
- data.tar.gz: e2384bb4207be796b44d45f3f83dbed467cdbbb2bb90b33abdb14cf870545d7e096a2fad8e615f8dd9b068bf18eae030ae300b291be16ea27f8856089dd07469
6
+ metadata.gz: 7203a83bc6e17c787e94526b5da917ac76c5a58bbb9fe9299b95d11a14b83b99ea03874eb0c9119cad41e79d2df3b75bba8a788106661807308a15fe6bca3842
7
+ data.tar.gz: 708b96c13fbe8dd0674b0487fe7b41bd57876f813d306f776d614788270ca07b3d4cee7c52fb8703f685595a10afcfb81499271310ad1dcb10a1b6c250bd603b
data/.gitignore CHANGED
@@ -1,7 +1,5 @@
1
- /.ruby-version
2
1
  /.bundle/
3
2
  /.yardoc
4
- /Gemfile.lock
5
3
  /_yardoc/
6
4
  /coverage/
7
5
  /doc/
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.2
data/Gemfile.lock ADDED
@@ -0,0 +1,129 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sidekiq-pool (1.9.3)
5
+ sidekiq (>= 3.0, < 7.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.8.0)
11
+ public_suffix (>= 2.0.2, < 5.0)
12
+ ast (2.4.2)
13
+ coderay (1.1.3)
14
+ connection_pool (2.2.5)
15
+ diff-lcs (1.5.0)
16
+ faraday (1.10.0)
17
+ faraday-em_http (~> 1.0)
18
+ faraday-em_synchrony (~> 1.0)
19
+ faraday-excon (~> 1.1)
20
+ faraday-httpclient (~> 1.0)
21
+ faraday-multipart (~> 1.0)
22
+ faraday-net_http (~> 1.0)
23
+ faraday-net_http_persistent (~> 1.0)
24
+ faraday-patron (~> 1.0)
25
+ faraday-rack (~> 1.0)
26
+ faraday-retry (~> 1.0)
27
+ ruby2_keywords (>= 0.0.4)
28
+ faraday-em_http (1.0.0)
29
+ faraday-em_synchrony (1.0.0)
30
+ faraday-excon (1.1.0)
31
+ faraday-httpclient (1.0.1)
32
+ faraday-multipart (1.0.3)
33
+ multipart-post (>= 1.2, < 3)
34
+ faraday-net_http (1.0.1)
35
+ faraday-net_http_persistent (1.2.0)
36
+ faraday-patron (1.0.0)
37
+ faraday-rack (1.0.0)
38
+ faraday-retry (1.0.3)
39
+ gitlab (4.18.0)
40
+ httparty (~> 0.18)
41
+ terminal-table (>= 1.5.1)
42
+ httparty (0.20.0)
43
+ mime-types (~> 3.0)
44
+ multi_xml (>= 0.5.2)
45
+ method_source (1.0.0)
46
+ mime-types (3.4.1)
47
+ mime-types-data (~> 3.2015)
48
+ mime-types-data (3.2022.0105)
49
+ multi_xml (0.6.0)
50
+ multipart-post (2.1.1)
51
+ octokit (4.22.0)
52
+ faraday (>= 0.9)
53
+ sawyer (~> 0.8.0, >= 0.5.3)
54
+ parallel (1.21.0)
55
+ parser (3.1.1.0)
56
+ ast (~> 2.4.1)
57
+ pronto (0.11.0)
58
+ gitlab (~> 4.4, >= 4.4.0)
59
+ httparty (>= 0.13.7)
60
+ octokit (~> 4.7, >= 4.7.0)
61
+ rainbow (>= 2.2, < 4.0)
62
+ rexml (~> 3.2)
63
+ rugged (>= 0.23.0, < 1.1.0)
64
+ thor (>= 0.20.3, < 2.0)
65
+ pronto-rubocop (0.11.1)
66
+ pronto (~> 0.11.0)
67
+ rubocop (>= 0.63.1, < 2.0)
68
+ pry (0.14.1)
69
+ coderay (~> 1.1)
70
+ method_source (~> 1.0)
71
+ public_suffix (4.0.6)
72
+ rack (2.2.3)
73
+ rainbow (3.1.1)
74
+ rake (13.0.6)
75
+ redis (4.6.0)
76
+ regexp_parser (2.2.1)
77
+ rexml (3.2.5)
78
+ rspec (3.11.0)
79
+ rspec-core (~> 3.11.0)
80
+ rspec-expectations (~> 3.11.0)
81
+ rspec-mocks (~> 3.11.0)
82
+ rspec-core (3.11.0)
83
+ rspec-support (~> 3.11.0)
84
+ rspec-expectations (3.11.0)
85
+ diff-lcs (>= 1.2.0, < 2.0)
86
+ rspec-support (~> 3.11.0)
87
+ rspec-mocks (3.11.0)
88
+ diff-lcs (>= 1.2.0, < 2.0)
89
+ rspec-support (~> 3.11.0)
90
+ rspec-support (3.11.0)
91
+ rubocop (1.26.0)
92
+ parallel (~> 1.10)
93
+ parser (>= 3.1.0.0)
94
+ rainbow (>= 2.2.2, < 4.0)
95
+ regexp_parser (>= 1.8, < 3.0)
96
+ rexml
97
+ rubocop-ast (>= 1.16.0, < 2.0)
98
+ ruby-progressbar (~> 1.7)
99
+ unicode-display_width (>= 1.4.0, < 3.0)
100
+ rubocop-ast (1.16.0)
101
+ parser (>= 3.1.1.0)
102
+ ruby-progressbar (1.11.0)
103
+ ruby2_keywords (0.0.5)
104
+ rugged (1.0.1)
105
+ sawyer (0.8.2)
106
+ addressable (>= 2.3.5)
107
+ faraday (> 0.8, < 2.0)
108
+ sidekiq (6.4.1)
109
+ connection_pool (>= 2.2.2)
110
+ rack (~> 2.0)
111
+ redis (>= 4.2.0)
112
+ terminal-table (3.0.2)
113
+ unicode-display_width (>= 1.1.1, < 3)
114
+ thor (1.2.1)
115
+ unicode-display_width (2.1.0)
116
+
117
+ PLATFORMS
118
+ ruby
119
+
120
+ DEPENDENCIES
121
+ bundler
122
+ pronto-rubocop (~> 0.10)
123
+ pry
124
+ rake (~> 13.0)
125
+ rspec (~> 3.0)
126
+ sidekiq-pool!
127
+
128
+ BUNDLED WITH
129
+ 2.2.22
@@ -11,7 +11,6 @@ module Sidekiq
11
11
  }
12
12
 
13
13
  def initialize
14
- @child_index = 0
15
14
  @pool = []
16
15
  @done = false
17
16
  @system_booted = false
@@ -74,10 +73,12 @@ module Sidekiq
74
73
  boot_system
75
74
 
76
75
  @types = @settings[:workers]
76
+ index = -1
77
77
  @types.each do |type|
78
78
  type[:amount].times do
79
+ index += 1
79
80
  sleep @fork_wait || DEFAULT_FORK_WAIT
80
- fork_child(type[:command])
81
+ fork_child(type[:command], index)
81
82
  end
82
83
  end
83
84
  drop_reload_marker
@@ -194,7 +195,7 @@ module Sidekiq
194
195
  end
195
196
  end
196
197
 
197
- def fork_child(command, wait_for_busy = true)
198
+ def fork_child(command, index, wait_for_busy = true)
198
199
  logger.info "Adding child with args: (#{command}) in #{working_directory}, waiting for busy: #{wait_for_busy}"
199
200
  if working_directory && !Dir.exist?(working_directory)
200
201
  logger.info "Working directory: #{working_directory} does not exist unable to fork"
@@ -207,14 +208,14 @@ module Sidekiq
207
208
  options.merge!(opts)
208
209
 
209
210
  @self_write.close
210
- $0 = 'sidekiq starting'
211
- @child_index += 1
212
- options[:index] = @child_index
211
+ $0 = "sidekiq #{Sidekiq::VERSION} worker #{index} starting"
212
+ options[:index] = index
213
213
 
214
214
  # reset child identity
215
215
  @@process_nonce = nil
216
216
  @@identity = nil
217
217
  options[:identity] = identity
218
+ options[:tag] = "worker #{index}"
218
219
 
219
220
  run_after_fork_hooks
220
221
  run_child
@@ -228,7 +229,7 @@ module Sidekiq
228
229
  sleep 1
229
230
  end if wait_for_busy
230
231
 
231
- @pool << { pid: pid, command: command }
232
+ @pool << { pid: pid, index: index, command: command }
232
233
  end
233
234
 
234
235
  def wait_for_signals
@@ -314,9 +315,9 @@ module Sidekiq
314
315
  end
315
316
 
316
317
  def handle_dead_child(child)
317
- logger.info "Child #{child[:pid]} died"
318
+ logger.info "Child #{child[:pid]} (worker #{child[:index]}) died"
318
319
  @pool.delete(child)
319
- fork_child(child[:command], false)
320
+ fork_child(child[:command], child[:index], false)
320
321
  end
321
322
 
322
323
  def alive?(pid)
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Pool
3
- VERSION = '1.9.0'
3
+ VERSION = '1.9.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vinted
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-17 00:00:00.000000000 Z
11
+ date: 2022-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
@@ -98,7 +98,9 @@ files:
98
98
  - ".gitignore"
99
99
  - ".rspec"
100
100
  - ".rubocop.yml"
101
+ - ".ruby-version"
101
102
  - Gemfile
103
+ - Gemfile.lock
102
104
  - LICENSE.txt
103
105
  - README.md
104
106
  - Rakefile