bunny 1.6.2 → 1.6.3

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: 09f980320596ae3eead897e92cb66d74c632a257
4
- data.tar.gz: 6b3b92232fdced1f96c90d452136b3f46e1f6a42
3
+ metadata.gz: 14d586f46e53649e9c27b63b5607675dc839cc9e
4
+ data.tar.gz: fa41d53c74c60948e416ba3587e9b79e1facf2ba
5
5
  SHA512:
6
- metadata.gz: 45314827e8cb6c002b78699925f78c07e68222ad3c7d7ff3bec9ccad9160285fd9a0bbbbac820acf8b54f11ce52671578b1c8f554db27233341784c65f399100
7
- data.tar.gz: 303c9cee35b6ca65a1e15ce15cbaded1b82564b9749dba146da44f02f1bed7e7bc0564754ac6e00d619e7c06307d45d85a9908ccefce34d23272a1ab3aed99bb
6
+ metadata.gz: fa29c50cc14e1876594b664574a3948a4fec74643add577116a950f64da2ec079d4ca84347b59b16844f4f4a966b8b2ba9eb78d84b952977391ce6cefa0132f9
7
+ data.tar.gz: 9b7d163bd2ec192bb92c4e1e0700ecc0d72a14c57f0a05e4e425066f3132871dba0ebe8c746f50ff058f412888e673dd4bd0efd5e88ba86d02fe2da80db82e15
data/ChangeLog.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## Changes between Bunny 1.6.2 and 1.6.3
2
+
3
+ ### Socket Read Timeout No Longer Set to 0 With Disabled Heartbeats
4
+
5
+ GH issue: [#267](https://github.com/ruby-amqp/bunny/pull/267).
6
+
7
+
1
8
  ## Changes between Bunny 1.6.1 and 1.6.2
2
9
 
3
10
  ### JRuby Writes Fixes
data/lib/bunny/session.rb CHANGED
@@ -999,7 +999,13 @@ module Bunny
999
999
 
1000
1000
  # We set the read_write_timeout to twice the heartbeat value
1001
1001
  # This allows us to miss a single heartbeat before we time out the socket.
1002
- @transport.read_timeout = @heartbeat * 2
1002
+ @transport.read_timeout = if heartbeat_disabled?(@client_heartbeat)
1003
+ Transport::DEFAULT_READ_TIMEOUT
1004
+ else
1005
+ # pad to account for edge cases. MK.
1006
+ @heartbeat * 2.2
1007
+ end
1008
+
1003
1009
 
1004
1010
  # if there are existing channels we've just recovered from
1005
1011
  # a network failure and need to fix the allocated set. See issue 205. MK.
data/lib/bunny/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Bunny
4
4
  # @return [String] Version of the library
5
- VERSION = "1.6.2"
5
+ VERSION = "1.6.3"
6
6
  end
@@ -1,16 +1,34 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "Client-defined heartbeat interval" do
4
- let(:connection) do
5
- c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed", :heartbeat_interval => 4)
6
- c.start
7
- c
4
+ context "with value > 0" do
5
+ let(:connection) do
6
+ c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed", :heartbeat_interval => 4)
7
+ c.start
8
+ c
9
+ end
10
+
11
+ it "can be enabled explicitly" do
12
+ sleep 5.0
13
+
14
+ connection.close
15
+ end
8
16
  end
9
17
 
10
- it "can be enabled explicitly" do
11
- sleep 5.0
18
+ # issue 267
19
+ context "with value = 0" do
20
+ let(:connection) do
21
+ c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed",
22
+ :heartbeat_interval => 0, :automatically_recover => false)
23
+ c.start
24
+ c
25
+ end
12
26
 
13
- connection.close
27
+ it "disables heartbeats" do
28
+ sleep 1.0
29
+
30
+ connection.close
31
+ end
14
32
  end
15
33
  end
16
34
 
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.2
4
+ version: 1.6.3
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-11-07 00:00:00.000000000 Z
15
+ date: 2014-11-09 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: amq-protocol