symphony 0.12.0 → 0.12.1

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: 0e183ac257c66fe624499aa023a5d718f8fc14478c7630a589014b90bda42e52
4
- data.tar.gz: 1e4a16de67ffe59e26fa27ad82c8ab01732b0ac8d616ce463c36805357d90a45
3
+ metadata.gz: 530b4399dc67b699e1f8e53155faa141f7602f3bda7c27bae2682f8bb082e528
4
+ data.tar.gz: af53f8b1cfe8e82aaabea43a3897c8df3856770cee858b8671e4b512452d451d
5
5
  SHA512:
6
- metadata.gz: 24620df94d92b8ecc79f96f80d27c5c06390e3d91b7f2d53b484f318c73676ddcfcd35bb166abbc5e9c898368c9a276b50872b4bc396b3d1e5466318eb558a8e
7
- data.tar.gz: e938e3c38f6af33f14903a957b14b9380e63b22ddb1f50fe319ad454eae1810fbc5a832ba4ba9c2476a1b69ebd16106451058e433958e311f65c9f0e98399414
6
+ metadata.gz: 1520a576d3a7f618d8a7a0f2717012a44fa091a44344316d0d7cc77694de6ff08c59cd6c05feac730fb6b60a6bb3b5abca2229a24cd1e71c07d8c6f89a45af00
7
+ data.tar.gz: e1143395288a3e770b2afb1ddb30ee11899c79306603d99a2393f4119e1c90aef346f27d53971d0360a16e8678a8df9202108a38b69f7d9f1449900311954e59
Binary file
data.tar.gz.sig CHANGED
Binary file
data/ChangeLog CHANGED
@@ -1,8 +1,28 @@
1
+ 2019-07-01 Michael Granger <ged@FaerieMUD.org>
2
+
3
+ @ * spec/symphony/task_group/longlived_spec.rb:
4
+ | Add a spec for closed-channel recovery
5
+ | [38701b4ddb53] [tip]
6
+ |
7
+ 2019-06-28 Mahlon E. Smith <mahlon@martini.nu>
8
+
9
+ o * lib/symphony/task_group/longlived.rb:
10
+ | Longlived workers: recover from a closed channel.
11
+ | [c2e7fccca675]
12
+ |
1
13
  2019-06-26 Michael Granger <ged@FaerieMUD.org>
2
14
 
3
- @ * History.rdoc, lib/symphony.rb:
15
+ o * .hgtags:
16
+ | Added tag v0.12.0 for changeset dab8bd9f4b44
17
+ | [f29b8df45b29]
18
+ |
19
+ o * .hgsigs:
20
+ | Added signature for changeset 0b40141657be
21
+ | [dab8bd9f4b44] [v0.12.0]
22
+ |
23
+ o * History.rdoc, lib/symphony.rb:
4
24
  | Bump the minor version, update history.
5
- | [0b40141657be] [tip]
25
+ | [0b40141657be]
6
26
  |
7
27
  o * lib/symphony/metrics.rb, lib/symphony/task.rb,
8
28
  | spec/symphony/task_spec.rb:
@@ -1,3 +1,11 @@
1
+ == v0.12.1 [2019-07-01] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ Bugfixes:
4
+
5
+ - Longlived workers: recover from a closed channel error on
6
+ the job-counting queue.
7
+
8
+
1
9
  == v0.12.0 [2019-06-26] Michael Granger <ged@FaerieMUD.org>
2
10
 
3
11
  Enhancements:
@@ -12,7 +12,7 @@ module Symphony
12
12
  Configurability
13
13
 
14
14
  # Library version constant
15
- VERSION = '0.12.0'
15
+ VERSION = '0.12.1'
16
16
 
17
17
  # Version-control revision constant
18
18
  REVISION = %q$Revision$
@@ -66,6 +66,10 @@ class Symphony::TaskGroup::LongLived < Symphony::TaskGroup
66
66
 
67
67
  count = @queue.message_count
68
68
  self.add_sample( count )
69
+
70
+ rescue Bunny::ChannelAlreadyClosed => err
71
+ self.log.debug "Unexpected queue state, resetting: "% [ err.message ]
72
+ @queue = nil
69
73
  end
70
74
 
71
75
 
@@ -217,6 +217,45 @@ describe Symphony::TaskGroup::LongLived do
217
217
  expect( task_group.workers.size ).to eq( 1 )
218
218
  end
219
219
 
220
+
221
+ it "reconnects if the message-count channel goes away" do
222
+ samples = [ 4, 3, 3 ]
223
+ task_group.sample_size = samples.size
224
+
225
+ allow( Process ).to receive( :setpgid )
226
+
227
+ channel1 = double( Bunny::Channel )
228
+ channel2 = double( Bunny::Channel )
229
+ queue1 = double( Bunny::Queue )
230
+ queue2 = double( Bunny::Queue )
231
+
232
+ expect( Symphony::Queue ).to receive( :amqp_channel ).
233
+ twice.
234
+ and_return( channel1, channel2 )
235
+
236
+ expect( channel1 ).to receive( :queue ).
237
+ with( task.queue_name, passive: true, prefetch: 0 ).
238
+ and_return( queue1 )
239
+ expect( queue1 ).to_not receive( :consumer_count )
240
+ expect( queue1 ).to receive( :message_count ).
241
+ and_raise( Bunny::ChannelAlreadyClosed.new("cannot use a closed channel!", channel1) )
242
+
243
+ expect( channel2 ).to receive( :queue ).
244
+ with( task.queue_name, passive: true, prefetch: 0 ).
245
+ and_return( queue2 )
246
+ expect( queue2 ).to receive( :consumer_count ) do
247
+ task_group.workers.size
248
+ end.at_least( :once )
249
+ expect( queue2 ).to receive( :message_count ).and_return( *samples )
250
+
251
+ start = 1414002605
252
+ start.upto( start + samples.size + 2 ) do |time|
253
+ Timecop.freeze( time ) do
254
+ task_group.adjust_workers
255
+ end
256
+ end
257
+ end
258
+
220
259
  end
221
260
 
222
261
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symphony
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -35,7 +35,7 @@ cert_chain:
35
35
  v4qqqa27Bs468d6SoPxjSm8a2mM9HZ4OdWhq4tFsbTeXDVquCfi64OTEaTt2xQdR
36
36
  JnC4lpJfCP6aCXa5h2XAQfPSH636cQap
37
37
  -----END CERTIFICATE-----
38
- date: 2019-06-26 00:00:00.000000000 Z
38
+ date: 2019-07-02 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: configurability
@@ -273,14 +273,14 @@ dependencies:
273
273
  requirements:
274
274
  - - "~>"
275
275
  - !ruby/object:Gem::Version
276
- version: '3.18'
276
+ version: '3.17'
277
277
  type: :development
278
278
  prerelease: false
279
279
  version_requirements: !ruby/object:Gem::Requirement
280
280
  requirements:
281
281
  - - "~>"
282
282
  - !ruby/object:Gem::Version
283
- version: '3.18'
283
+ version: '3.17'
284
284
  description: |-
285
285
  Symphony is a subscription-based asynchronous job system. It
286
286
  allows you to define jobs that watch for lightweight events from a
metadata.gz.sig CHANGED
Binary file