bunny 2.7.2 → 2.7.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
  SHA1:
3
- metadata.gz: f1dd2f949bcc12b76fad38159f60adfbf52eed85
4
- data.tar.gz: 280cc9632f061268091bf5e0b705f1264f3b3aa6
3
+ metadata.gz: 919483301947c21f40cb3c6bdedfcc8808e365ee
4
+ data.tar.gz: 2b6c80010c62acd49f88abb90aad2ccd5b5baf01
5
5
  SHA512:
6
- metadata.gz: 5b8e2f0e13ba6488e563ae1e8ba6566cf4c3d6ddfe22e095f3a2444240cfcf78f236cbf6a97cc71aba777e0ec8fcc14e6859fa5266dc012f063c4dbeb3bad3c0
7
- data.tar.gz: 99bd85512d22d4da1626e98346a61512b470d6c87fd735838960c951af99fef340cee57cc9b8b6f54905d93f64c94c8b1a180c87b6f69439f654348aaf57e751
6
+ metadata.gz: ecc98a8d2591d2093b186508324331337fdb20ac061774983613278174a2c694dbf74aa2788daa7bca5356407b8891494b42523dcb2288e185e4a4465cb83378
7
+ data.tar.gz: 40f9b12db88c3b533a207870c2dd72b3a06da36aa71cb92dc26ced282e08df06478f163ccc2e97a6e5322c8a75c19455d286eee3a9285d7f8e4dc53e654834f2
@@ -0,0 +1,18 @@
1
+ ## Does This Really Belong to GitHub issues?
2
+
3
+ If you find a bug you understand well, poor default, incorrect or unclear piece of documentation,
4
+ or missing feature, please [file an
5
+ issue](http://github.com/ruby-amqp/bunny/issues) on GitHub.
6
+
7
+ Please use [Bunny's mailing list](http://groups.google.com/group/ruby-amqp) for questions,
8
+ investigations, and discussions. GitHub issues should be used for specific, well understood, actionable
9
+ maintainers and contributors can work on.
10
+
11
+ When filing an issue, please specify
12
+
13
+ * Which Bunny and RabbitMQ versions are used
14
+ * Recent RabbitMQ log file contents
15
+ * Full exception stack traces
16
+ * Steps to reproduce or a failing test case
17
+
18
+ This would greatly help the maintainers help you.
@@ -1,4 +1,36 @@
1
- ## Changes between Bunny 2.7.1 and 2.7.2 (unreleased)
1
+ ## Changes between Bunny 2.7.3 and 2.7.4 (unreleased)
2
+
3
+ No changes yet.
4
+
5
+
6
+ ## Changes between Bunny 2.7.2 and 2.7.3 (Dec 19th, 2017)
7
+
8
+ ### JRuby 9K Compatibility
9
+
10
+ A JRuby 9K compatibility issue was corrected by Marian Posăceanu.
11
+ Note that JRuby users are recommended to use [March Hare](http://rubymarchhare.info/), a JRuby-oriented client, instead
12
+ of Bunny.
13
+
14
+ GitHub issue: [#529](https://github.com/ruby-amqp/bunny/pull/529)
15
+
16
+ ### Connection Exceptions are Logged as Warning with Automatic Recovery
17
+
18
+ When automatic recovery is enabled, connection errors are now logged as warnings
19
+ and not errors.
20
+
21
+ Contributed by Merten Falk.
22
+
23
+ GitHub issue: [#531](https://github.com/ruby-amqp/bunny/pull/531)
24
+
25
+
26
+ ## Changes between Bunny 2.7.1 and 2.7.2 (Nov 4th, 2017)
27
+
28
+ ### Heartbeat Value Supports `:server` and `"server"`
29
+
30
+ Heartbeat value of `:server` now can be specified as a string.
31
+
32
+ Contributed by Tyrone.
33
+
2
34
 
3
35
  ### Reading a Frame without Payload Could Result in a `Bunny::NoFinalOctetError`
4
36
 
data/README.md CHANGED
@@ -88,7 +88,7 @@ gem install bunny
88
88
  To use Bunny in a project managed with Bundler:
89
89
 
90
90
  ``` ruby
91
- gem "bunny", ">= 2.7.0"
91
+ gem "bunny", ">= 2.7.2"
92
92
  ```
93
93
 
94
94
 
@@ -154,8 +154,12 @@ Other documentation guides are available at [rubybunny.info](http://rubybunny.in
154
154
 
155
155
  ### Mailing List
156
156
 
157
- [Bunny has a mailing list](http://groups.google.com/group/ruby-amqp). We encourage you
158
- to also join the [RabbitMQ mailing list](https://groups.google.com/forum/#!forum/rabbitmq-users) mailing list. Feel free to ask any questions that you may have.
157
+ [Bunny has a mailing list](http://groups.google.com/group/ruby-amqp). Please use it for all questions,
158
+ investigations, and discussions. GitHub issues should be used for specific, well understood, actionable
159
+ maintainers and contributors can work on.
160
+
161
+ We encourage you to also join the [RabbitMQ mailing list](https://groups.google.com/forum/#!forum/rabbitmq-users)
162
+ mailing list. Feel free to ask any questions that you may have.
159
163
 
160
164
 
161
165
  ## Continuous Integration
@@ -172,13 +176,17 @@ More detailed announcements can be found in the [RabbitMQ Ruby clients blog](htt
172
176
 
173
177
  ### Reporting Issues
174
178
 
175
- If you find a bug, poor default, missing feature or find any part of
176
- the API inconvenient, please [file an
177
- issue](http://github.com/ruby-amqp/bunny/issues) on GitHub. When
178
- filing an issue, please specify which Bunny and RabbitMQ versions you
179
- are using, provide recent RabbitMQ log file contents if possible, and
180
- try to explain what behavior you expected and why. Bonus points for
181
- contributing failing test cases.
179
+ If you find a bug you understand well, poor default, incorrect or unclear piece of documentation,
180
+ or missing feature, please [file an
181
+ issue](http://github.com/ruby-amqp/bunny/issues) on GitHub.
182
+
183
+ Please use [Bunny's mailing list](http://groups.google.com/group/ruby-amqp) for questions,
184
+ investigations, and discussions. GitHub issues should be used for specific, well understood, actionable
185
+ maintainers and contributors can work on.
186
+
187
+ When filing an issue, please specify which Bunny and RabbitMQ versions you
188
+ are using, provide recent RabbitMQ log file contents, full exception stack traces,
189
+ and steps to reproduce (or failing test cases).
182
190
 
183
191
 
184
192
  ## Other Ruby RabbitMQ Clients
@@ -8,6 +8,20 @@ module Bunny
8
8
  module Socket
9
9
  include Bunny::Socket
10
10
 
11
+ def self.open(host, port, options = {})
12
+ socket = ::Socket.tcp(host, port, nil, nil,
13
+ connect_timeout: options[:connect_timeout])
14
+ if ::Socket.constants.include?('TCP_NODELAY') || ::Socket.constants.include?(:TCP_NODELAY)
15
+ socket.setsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, true)
16
+ end
17
+ socket.setsockopt(::Socket::SOL_SOCKET, ::Socket::SO_KEEPALIVE, true) if options.fetch(:keepalive, true)
18
+ socket.extend self
19
+ socket.options = { :host => host, :port => port }.merge(options)
20
+ socket
21
+ rescue Errno::ETIMEDOUT
22
+ raise ClientTimeout
23
+ end
24
+
11
25
  # Reads given number of bytes with an optional timeout
12
26
  #
13
27
  # @param [Integer] count How many bytes to read
@@ -16,17 +30,17 @@ module Bunny
16
30
  # @return [String] Data read from the socket
17
31
  # @api public
18
32
  def read_fully(count, timeout = nil)
19
- return nil if @__bunny_socket_eof_flag__
20
-
21
33
  value = ''
34
+
22
35
  begin
23
36
  loop do
24
- value << readpartial(count - value.bytesize)
37
+ value << read_nonblock(count - value.bytesize)
25
38
  break if value.bytesize >= count
26
39
  end
27
40
  rescue EOFError
28
- # @eof will break Rubinius' TCPSocket implementation. MK.
29
- @__bunny_socket_eof_flag__ = true
41
+ # JRuby specific fix via https://github.com/jruby/jruby/issues/1694#issuecomment-54873532
42
+ IO.select([self], nil, nil, timeout)
43
+ retry
30
44
  rescue *READ_RETRY_EXCEPTION_CLASSES
31
45
  if IO.select([self], nil, nil, timeout)
32
46
  retry
@@ -34,8 +48,10 @@ module Bunny
34
48
  raise Timeout::Error, "IO timeout when reading #{count} bytes"
35
49
  end
36
50
  end
51
+
37
52
  value
38
53
  end # read_fully
54
+
39
55
  end
40
56
  end
41
57
  end
@@ -36,11 +36,12 @@ module Bunny
36
36
  rescue AMQ::Protocol::EmptyResponseError, IOError, SystemCallError, Timeout::Error => e
37
37
  break if terminate? || @session.closing? || @session.closed?
38
38
 
39
- log_exception(e)
40
39
  @network_is_down = true
41
40
  if @session.automatically_recover?
41
+ log_exception(e, level: :warn)
42
42
  @session.handle_network_failure(e)
43
43
  else
44
+ log_exception(e)
44
45
  @session_thread.raise(Bunny::NetworkFailure.new("detected a network failure: #{e.message}", e))
45
46
  end
46
47
  rescue ShutdownSignal => _
@@ -122,12 +123,12 @@ module Bunny
122
123
 
123
124
  protected
124
125
 
125
- def log_exception(e)
126
+ def log_exception(e, level: :error)
126
127
  if !(io_error?(e) && (@session.closing? || @session.closed?))
127
- @logger.error "Exception in the reader loop: #{e.class.name}: #{e.message}"
128
- @logger.error "Backtrace: "
128
+ @logger.send level, "Exception in the reader loop: #{e.class.name}: #{e.message}"
129
+ @logger.send level, "Backtrace: "
129
130
  e.backtrace.each do |line|
130
- @logger.error "\t#{line}"
131
+ @logger.send level, "\t#{line}"
131
132
  end
132
133
  end
133
134
  end
@@ -191,7 +191,7 @@ module Bunny
191
191
 
192
192
  client_props = opts[:properties] || opts[:client_properties] || {}
193
193
  @client_properties = DEFAULT_CLIENT_PROPERTIES.merge(client_props)
194
- @mechanism = opts.fetch(:auth_mechanism, "PLAIN")
194
+ @mechanism = normalize_auth_mechanism(opts.fetch(:auth_mechanism, "PLAIN"))
195
195
  @credentials_encoder = credentials_encoder_for(@mechanism)
196
196
  @locale = @opts.fetch(:locale, DEFAULT_LOCALE)
197
197
 
@@ -1383,6 +1383,7 @@ module Bunny
1383
1383
  end
1384
1384
 
1385
1385
  def normalize_client_channel_max(n)
1386
+ return CHANNEL_MAX_LIMIT if n.nil?
1386
1387
  return CHANNEL_MAX_LIMIT if n > CHANNEL_MAX_LIMIT
1387
1388
 
1388
1389
  case n
@@ -1393,6 +1394,17 @@ module Bunny
1393
1394
  end
1394
1395
  end
1395
1396
 
1397
+ def normalize_auth_mechanism(value)
1398
+ case value
1399
+ when [] then
1400
+ "PLAIN"
1401
+ when nil then
1402
+ "PLAIN"
1403
+ else
1404
+ value
1405
+ end
1406
+ end
1407
+
1396
1408
  def ignoring_io_errors(&block)
1397
1409
  begin
1398
1410
  block.call
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Bunny
4
4
  # @return [String] Version of the library
5
- VERSION = "2.7.2"
5
+ VERSION = "2.7.3"
6
6
  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: 2.7.2
4
+ version: 2.7.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: 2017-11-03 00:00:00.000000000 Z
15
+ date: 2017-12-19 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: amq-protocol
@@ -37,6 +37,7 @@ extensions: []
37
37
  extra_rdoc_files:
38
38
  - README.md
39
39
  files:
40
+ - ".github/ISSUE_TEMPLATE.md"
40
41
  - ".gitignore"
41
42
  - ".rspec"
42
43
  - ".travis.yml"