Hello community, here is the log from the commit of package rubygem-bunny for openSUSE:Factory checked in at 2017-12-20 10:40:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-bunny (Old) and /work/SRC/openSUSE:Factory/.rubygem-bunny.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-bunny" Wed Dec 20 10:40:05 2017 rev:39 rq:558533 version:2.8.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-bunny/rubygem-bunny.changes 2017-11-18 00:21:17.211128977 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-bunny.new/rubygem-bunny.changes 2017-12-20 10:40:09.981676578 +0100 @@ -1,0 +2,12 @@ +Tue Dec 19 09:12:13 UTC 2017 - [email protected] + +- Update to version 2.8.0 + + * Bunny::Channel#close on a Closed Channel Now Raises a Sensible Exception + * JRuby 9K Compatibility + * Connection Exceptions are Logged as Warning with Automatic Recovery + * Server Heartbeat Value as a String + + Please refer to the upstream changelog for detailed information. + +------------------------------------------------------------------- Old: ---- bunny-2.7.2.gem New: ---- bunny-2.8.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-bunny.spec ++++++ --- /var/tmp/diff_new_pack.ELWpQ5/_old 2017-12-20 10:40:11.969532406 +0100 +++ /var/tmp/diff_new_pack.ELWpQ5/_new 2017-12-20 10:40:11.969532406 +0100 @@ -24,7 +24,7 @@ # Name: rubygem-bunny -Version: 2.7.2 +Version: 2.8.0 Release: 0 %define mod_name bunny %define mod_full_name %{mod_name}-%{version} ++++++ bunny-2.7.2.gem -> bunny-2.8.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.github/ISSUE_TEMPLATE.md new/.github/ISSUE_TEMPLATE.md --- old/.github/ISSUE_TEMPLATE.md 1970-01-01 01:00:00.000000000 +0100 +++ new/.github/ISSUE_TEMPLATE.md 2017-12-18 15:45:32.000000000 +0100 @@ -0,0 +1,18 @@ +## Does This Really Belong to GitHub issues? + +If you find a bug you understand well, poor default, incorrect or unclear piece of documentation, +or missing feature, please [file an +issue](http://github.com/ruby-amqp/bunny/issues) on GitHub. + +Please use [Bunny's mailing list](http://groups.google.com/group/ruby-amqp) for questions, +investigations, and discussions. GitHub issues should be used for specific, well understood, actionable +maintainers and contributors can work on. + +When filing an issue, please specify + + * Which Bunny and RabbitMQ versions are used + * Recent RabbitMQ log file contents + * Full exception stack traces + * Steps to reproduce or a failing test case + +This would greatly help the maintainers help you. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ChangeLog.md new/ChangeLog.md --- old/ChangeLog.md 2017-11-03 23:25:19.000000000 +0100 +++ new/ChangeLog.md 2017-12-18 15:45:32.000000000 +0100 @@ -1,13 +1,41 @@ -## Changes between Bunny 2.7.1 and 2.7.2 (unreleased) +## Changes between Bunny 2.7.0 and 2.8.0 (unreleased) -### Reading a Frame without Payload Could Result in a `Bunny::NoFinalOctetError` +This release has **minor breaking public API changes**. -Reading a frame without payload (e.g. a heartbeat frame) could result in a `Bunny::NoFinalOctetError` -with mostly idle connections. +### `Bunny::Channel#close` on a Closed Channel Now Raises a Sensible Exception -GitHub issue: [#521](https://github.com/ruby-amqp/bunny/issues/521). +`Bunny::Channel#close` on an already closed channel will now raise a sensible exception. +If the channel was closed due to a channel-level protocol exception, that exception will +be mentioned. -Contributed by GPif. +GitHub issue: [#528](https://github.com/ruby-amqp/bunny/issues/528), see [9df7cb](https://github.com/ruby-amqp/bunny/commit/9df7cb04d9ff12b1af62a11e239fd81e5472c872) for +details. + +### JRuby 9K Compatibility + +A JRuby 9K compatibility issue was corrected by Marian Posăceanu. +Note that JRuby users are recommended to use [March Hare](http://rubymarchhare.info/), a JRuby-oriented client, instead +of Bunny. + +GitHub issue: [bunny#529](https://github.com/ruby-amqp/bunny/pull/529) + +### Connection Exceptions are Logged as Warning with Automatic Recovery + +When automatic recovery is enabled, connection errors are now logged as warnings +and not errors. + +Contributed by Merten Falk. + +GitHub issue: [bunny#531](https://github.com/ruby-amqp/bunny/pull/531) + +### Server Heartbeat Value as a String + +It is now possible to specify a server-defined heartbeat value as a string (`"server"`), not just +a symbol. This makes it easier to load settings from YAML files. + +Contributed by Tyrone Wilson. + +GitHub issue: [bunny#524](https://github.com/ruby-amqp/bunny/pull/524) ## Changes between Bunny 2.7.0 and 2.7.1 (Sep 25th, 2017) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2017-11-03 23:25:19.000000000 +0100 +++ new/README.md 2017-12-18 15:45:32.000000000 +0100 @@ -88,7 +88,7 @@ To use Bunny in a project managed with Bundler: ``` ruby -gem "bunny", ">= 2.7.0" +gem "bunny", ">= 2.7.2" ``` @@ -154,8 +154,12 @@ ### Mailing List -[Bunny has a mailing list](http://groups.google.com/group/ruby-amqp). We encourage you -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. +[Bunny has a mailing list](http://groups.google.com/group/ruby-amqp). Please use it for all questions, +investigations, and discussions. GitHub issues should be used for specific, well understood, actionable +maintainers and contributors can work on. + +We encourage you 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. ## Continuous Integration @@ -172,13 +176,17 @@ ### Reporting Issues -If you find a bug, poor default, missing feature or find any part of -the API inconvenient, please [file an -issue](http://github.com/ruby-amqp/bunny/issues) on GitHub. When -filing an issue, please specify which Bunny and RabbitMQ versions you -are using, provide recent RabbitMQ log file contents if possible, and -try to explain what behavior you expected and why. Bonus points for -contributing failing test cases. +If you find a bug you understand well, poor default, incorrect or unclear piece of documentation, +or missing feature, please [file an +issue](http://github.com/ruby-amqp/bunny/issues) on GitHub. + +Please use [Bunny's mailing list](http://groups.google.com/group/ruby-amqp) for questions, +investigations, and discussions. GitHub issues should be used for specific, well understood, actionable +maintainers and contributors can work on. + +When filing an issue, please specify which Bunny and RabbitMQ versions you +are using, provide recent RabbitMQ log file contents, full exception stack traces, +and steps to reproduce (or failing test cases). ## Other Ruby RabbitMQ Clients Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/bunny/channel.rb new/lib/bunny/channel.rb --- old/lib/bunny/channel.rb 2017-11-03 23:25:19.000000000 +0100 +++ new/lib/bunny/channel.rb 2017-12-18 15:45:32.000000000 +0100 @@ -233,6 +233,9 @@ # {Bunny::Queue}, {Bunny::Exchange} and {Bunny::Consumer} instances. # @api public def close + # see bunny#528 + raise_if_no_longer_open! + @connection.close_channel(self) @status = :closed @work_pool.shutdown @@ -1940,7 +1943,13 @@ # @private def raise_if_no_longer_open! - raise ChannelAlreadyClosed.new("cannot use a channel that was already closed! Channel id: #{@id}", self) if closed? + if closed? + if @last_channel_error + raise ChannelAlreadyClosed.new("cannot use a closed channel! Channel id: #{@id}, closed due to a server-reported channel error: #{@last_channel_error.message}", self) + else + raise ChannelAlreadyClosed.new("cannot use a closed channel! Channel id: #{@id}", self) + end + end end # @private diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/bunny/jruby/socket.rb new/lib/bunny/jruby/socket.rb --- old/lib/bunny/jruby/socket.rb 2017-11-03 23:25:19.000000000 +0100 +++ new/lib/bunny/jruby/socket.rb 2017-12-18 15:45:32.000000000 +0100 @@ -8,6 +8,20 @@ module Socket include Bunny::Socket + def self.open(host, port, options = {}) + socket = ::Socket.tcp(host, port, nil, nil, + connect_timeout: options[:connect_timeout]) + if ::Socket.constants.include?('TCP_NODELAY') || ::Socket.constants.include?(:TCP_NODELAY) + socket.setsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, true) + end + socket.setsockopt(::Socket::SOL_SOCKET, ::Socket::SO_KEEPALIVE, true) if options.fetch(:keepalive, true) + socket.extend self + socket.options = { :host => host, :port => port }.merge(options) + socket + rescue Errno::ETIMEDOUT + raise ClientTimeout + end + # Reads given number of bytes with an optional timeout # # @param [Integer] count How many bytes to read @@ -16,17 +30,17 @@ # @return [String] Data read from the socket # @api public def read_fully(count, timeout = nil) - return nil if @__bunny_socket_eof_flag__ - value = '' + begin loop do - value << readpartial(count - value.bytesize) + value << read_nonblock(count - value.bytesize) break if value.bytesize >= count end rescue EOFError - # @eof will break Rubinius' TCPSocket implementation. MK. - @__bunny_socket_eof_flag__ = true + # JRuby specific fix via https://github.com/jruby/jruby/issues/1694#issuecomment-54873532 + IO.select([self], nil, nil, timeout) + retry rescue *READ_RETRY_EXCEPTION_CLASSES if IO.select([self], nil, nil, timeout) retry @@ -34,8 +48,10 @@ raise Timeout::Error, "IO timeout when reading #{count} bytes" end end + value end # read_fully + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/bunny/queue.rb new/lib/bunny/queue.rb --- old/lib/bunny/queue.rb 2017-11-03 23:25:19.000000000 +0100 +++ new/lib/bunny/queue.rb 2017-12-18 15:45:32.000000000 +0100 @@ -158,7 +158,9 @@ # @option opts [Boolean] :ack (false) [DEPRECATED] Use :manual_ack instead # @option opts [Boolean] :manual_ack (false) Will this consumer use manual acknowledgements? # @option opts [Boolean] :exclusive (false) Should this consumer be exclusive for this queue? - # @option opts [Boolean] :block (false) Should the call block calling thread? + # @option opts [Boolean] :block (false) Should the call block the calling thread? This option can be useful for keeping the main thread of + # a script alive. It is incompatible with automatic connection recovery + # and is not generally recommended. # @option opts [#call] :on_cancellation Block to execute when this consumer is cancelled remotely (e.g. via the RabbitMQ Management plugin) # @option opts [String] :consumer_tag Unique consumer identifier. It is usually recommended to let Bunny generate it for you. # @option opts [Hash] :arguments ({}) Additional (optional) arguments, typically used by RabbitMQ extensions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/bunny/reader_loop.rb new/lib/bunny/reader_loop.rb --- old/lib/bunny/reader_loop.rb 2017-11-03 23:25:19.000000000 +0100 +++ new/lib/bunny/reader_loop.rb 2017-12-18 15:45:32.000000000 +0100 @@ -36,11 +36,12 @@ rescue AMQ::Protocol::EmptyResponseError, IOError, SystemCallError, Timeout::Error => e break if terminate? || @session.closing? || @session.closed? - log_exception(e) @network_is_down = true if @session.automatically_recover? + log_exception(e, level: :warn) @session.handle_network_failure(e) else + log_exception(e) @session_thread.raise(Bunny::NetworkFailure.new("detected a network failure: #{e.message}", e)) end rescue ShutdownSignal => _ @@ -122,12 +123,12 @@ protected - def log_exception(e) + def log_exception(e, level: :error) if !(io_error?(e) && (@session.closing? || @session.closed?)) - @logger.error "Exception in the reader loop: #{e.class.name}: #{e.message}" - @logger.error "Backtrace: " + @logger.send level, "Exception in the reader loop: #{e.class.name}: #{e.message}" + @logger.send level, "Backtrace: " e.backtrace.each do |line| - @logger.error "\t#{line}" + @logger.send level, "\t#{line}" end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/bunny/session.rb new/lib/bunny/session.rb --- old/lib/bunny/session.rb 2017-11-03 23:25:19.000000000 +0100 +++ new/lib/bunny/session.rb 2017-12-18 15:45:32.000000000 +0100 @@ -191,7 +191,7 @@ client_props = opts[:properties] || opts[:client_properties] || {} @client_properties = DEFAULT_CLIENT_PROPERTIES.merge(client_props) - @mechanism = opts.fetch(:auth_mechanism, "PLAIN") + @mechanism = normalize_auth_mechanism(opts.fetch(:auth_mechanism, "PLAIN")) @credentials_encoder = credentials_encoder_for(@mechanism) @locale = @opts.fetch(:locale, DEFAULT_LOCALE) @@ -1383,6 +1383,7 @@ end def normalize_client_channel_max(n) + return CHANNEL_MAX_LIMIT if n.nil? return CHANNEL_MAX_LIMIT if n > CHANNEL_MAX_LIMIT case n @@ -1393,6 +1394,17 @@ end end + def normalize_auth_mechanism(value) + case value + when [] then + "PLAIN" + when nil then + "PLAIN" + else + value + end + end + def ignoring_io_errors(&block) begin block.call diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/bunny/version.rb new/lib/bunny/version.rb --- old/lib/bunny/version.rb 2017-11-03 23:25:19.000000000 +0100 +++ new/lib/bunny/version.rb 2017-12-18 15:45:32.000000000 +0100 @@ -2,5 +2,5 @@ module Bunny # @return [String] Version of the library - VERSION = "2.7.2" + VERSION = "2.8.0" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2017-11-03 23:25:19.000000000 +0100 +++ new/metadata 2017-12-18 15:45:32.000000000 +0100 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: bunny version: !ruby/object:Gem::Version - version: 2.7.2 + version: 2.8.0 platform: ruby authors: - Chris Duncan @@ -12,7 +12,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2017-11-03 00:00:00.000000000 Z +date: 2017-12-18 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: amq-protocol @@ -37,6 +37,7 @@ extra_rdoc_files: - README.md files: +- ".github/ISSUE_TEMPLATE.md" - ".gitignore" - ".rspec" - ".travis.yml" @@ -231,7 +232,7 @@ version: '0' requirements: [] rubyforge_project: -rubygems_version: 2.6.13 +rubygems_version: 2.6.11 signing_key: specification_version: 4 summary: Popular easy to use Ruby client for RabbitMQ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/higher_level_api/integration/channel_close_spec.rb new/spec/higher_level_api/integration/channel_close_spec.rb --- old/spec/higher_level_api/integration/channel_close_spec.rb 2017-11-03 23:25:19.000000000 +0100 +++ new/spec/higher_level_api/integration/channel_close_spec.rb 2017-12-18 15:45:32.000000000 +0100 @@ -1,6 +1,6 @@ require "spec_helper" -describe Bunny::Channel, "when closed" do +describe Bunny::Channel do let(:connection) do c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed") c.start @@ -11,15 +11,52 @@ connection.close end - it "releases the id" do - ch = connection.create_channel - n = ch.number - - expect(ch).to be_open - ch.close - expect(ch).to be_closed + context "when closed" do + it "releases the id" do + ch = connection.create_channel + n = ch.number - # a new channel with the same id can be created - connection.create_channel(n) + expect(ch).to be_open + ch.close + expect(ch).to be_closed + + # a new channel with the same id can be created + connection.create_channel(n) + end + end + + context "when double closed" do + # bunny#528 + it "raises a meaningful exception" do + ch = connection.create_channel + + expect(ch).to be_open + ch.close + expect(ch).to be_closed + + expect { ch.close }.to raise_error(Bunny::ChannelAlreadyClosed) + end + end + + context "when double closed after a channel-level protocol exception" do + # bunny#528 + it "raises a meaningful exception" do + ch = connection.create_channel + + s = "bunny-temp-q-#{rand}" + + expect(ch).to be_open + ch.queue_declare(s, durable: false, exclusive: true) + + expect do + ch.queue_declare(s, durable: true, exclusive: false) + end.to raise_error(Bunny::PreconditionFailed) + + # channel.close is sent and handled concurrently with the test + sleep 1 + expect(ch).to be_closed + + expect { ch.close }.to raise_error(Bunny::ChannelAlreadyClosed) + end end end
