bunny 1.6.0 → 1.6.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cbe74ab78378681d5bf1f002e5710b94a1f16c6a
4
- data.tar.gz: 8acb0549066633a1e795439f96c8b382318706c1
3
+ metadata.gz: 65fac851747ba831f48433378fbe43ddfb96c57a
4
+ data.tar.gz: 3065bffd94f02c19738ea1352f238c223f8f5f90
5
5
  SHA512:
6
- metadata.gz: ab8f499e08442d75d9fc90d8192868ae6cc27b59369e46b20f2b3669b4d05afbec8a9d2afb897e0dcbabf0b82a96ee6408c9e12c4effa06613dcfd77be408277
7
- data.tar.gz: 32b4f57a6bcdee36ced4fd53b9f2725871b15e7d0ead57e6c510fdd359bd13771d473636cdf60280ab2a4ca4402dd385728b2297e046964fba8f0dbc566c3b2b
6
+ metadata.gz: 78bc0ff879a3d2d94b1f97c55dfb1524cfed7dce6ad37d8c7a32d442de9f2b547df3c05fc243e103c01a5c50558b6fafc7a8b2f7c56c62b6f3c942e42398ad31
7
+ data.tar.gz: 8aff7680586499e05cadf62da282b08b6866829e468c6aee4126a0da31de6773af93ed7299f36eab2e64c6f0d417b5a0a11984419f92835df6d66aec5f704f22
@@ -1,3 +1,11 @@
1
+ ## Changes between Bunny 1.6.0 and 1.6.1
2
+
3
+ ### Bunny::Session#with_channel Synchornisation Improvements
4
+
5
+ `Bunny::Session#with_channel` is now fully synchronised and won't run into `COMMAND_INVALID` errors
6
+ when used from multiple threads that share a connection.
7
+
8
+
1
9
  ## Changes between Bunny 1.5.0 and 1.6.0
2
10
 
3
11
  ### TLSv1 by Default
@@ -229,7 +229,8 @@ module Bunny
229
229
  # @api public
230
230
  def close
231
231
  @connection.close_channel(self)
232
- closed!
232
+ @status = :closed
233
+ @work_pool.shutdown
233
234
  maybe_kill_consumer_work_pool!
234
235
  end
235
236
 
@@ -494,6 +494,7 @@ module Bunny
494
494
  raise_if_continuation_resulted_in_a_connection_error!
495
495
 
496
496
  self.unregister_channel(ch)
497
+ self.release_channel_id(ch.id)
497
498
  @last_channel_close_ok
498
499
  end
499
500
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Bunny
4
4
  # @return [String] Version of the library
5
- VERSION = "1.6.0"
5
+ VERSION = "1.6.1"
6
6
  end
@@ -0,0 +1,64 @@
1
+ require "spec_helper"
2
+
3
+ describe "Rapidly opening and closing lots of channels" do
4
+ before :all do
5
+ @connection = Bunny.new(:automatic_recovery => false).tap do |c|
6
+ c.start
7
+ end
8
+ end
9
+
10
+ after :all do
11
+ @connection.close
12
+ end
13
+
14
+ 100.times do |i|
15
+ context "in a multi-threaded scenario A (take #{i})" do
16
+ let(:n) { 20 }
17
+
18
+ it "works correctly" do
19
+ ts = []
20
+
21
+ n.times do
22
+ t = Thread.new do
23
+ @connection.with_channel do |ch1|
24
+ q = ch1.queue("", :exclusive => true)
25
+ q.delete
26
+ ch1.close
27
+ end
28
+
29
+ ch2 = @connection.create_channel
30
+ ch2.close
31
+ end
32
+ t.abort_on_exception = true
33
+ ts << t
34
+ end
35
+
36
+ ts.each { |t| t.join }
37
+ end
38
+ end
39
+ end
40
+
41
+ 100.times do |i|
42
+ context "in a multi-threaded scenario B (take #{i})" do
43
+ let(:n) { 20 }
44
+
45
+ it "works correctly" do
46
+ ts = []
47
+
48
+ n.times do
49
+ t = Thread.new do
50
+ 3.times do
51
+ @connection.with_channel do |ch|
52
+ x = ch.topic('bunny.stress.topics.t2', :durable => false)
53
+ end
54
+ end
55
+ end
56
+ t.abort_on_exception = true
57
+ ts << t
58
+ end
59
+
60
+ ts.each { |t| t.join }
61
+ end
62
+ end
63
+ end
64
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Duncan
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-10-31 00:00:00.000000000 Z
15
+ date: 2014-11-06 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: amq-protocol
@@ -190,6 +190,7 @@ files:
190
190
  - spec/lower_level_api/integration/basic_cancel_spec.rb
191
191
  - spec/lower_level_api/integration/basic_consume_spec.rb
192
192
  - spec/spec_helper.rb
193
+ - spec/stress/channel_close_stress_spec.rb
193
194
  - spec/stress/channel_open_stress_spec.rb
194
195
  - spec/stress/channel_open_stress_with_single_threaded_connection_spec.rb
195
196
  - spec/stress/concurrent_consumers_stress_spec.rb
@@ -290,6 +291,7 @@ test_files:
290
291
  - spec/lower_level_api/integration/basic_cancel_spec.rb
291
292
  - spec/lower_level_api/integration/basic_consume_spec.rb
292
293
  - spec/spec_helper.rb
294
+ - spec/stress/channel_close_stress_spec.rb
293
295
  - spec/stress/channel_open_stress_spec.rb
294
296
  - spec/stress/channel_open_stress_with_single_threaded_connection_spec.rb
295
297
  - spec/stress/concurrent_consumers_stress_spec.rb