-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warnings #563
Comments
LOTS of pull requests that address the warnings are welcome. |
Some warnings ended up being legit mistakes. Others don't make much sense to me. Instance variables that are initialised in |
It's mostly cosmetics but nice to address. References #563
I was just about to submit a PR (still writing detailed commit message) about these! :) |
consumer_work_pool.rb * During initialize, work pool is not running; set @running to false. cruby/ssl_socket.rb, jruby/ssl_socket.rb * Add initialize method to init @__bunny_socket_eof_flag__ to false while still passing args, if any, to superclass reader_loop.rb * Initialize flags used in the loop to sensible values given that: Not stopping or stopped (since we havent started), and don't know if network is down, yet. session.rb * Move initialization of variables referenced by to_s before the call to init_default_logger, which calls to_s. * Initialize @transport, @heartbeat_sender, and @last_connection_error before they are referenced. * Removed code referencing @socket_configurator. The commit that added it: aa2642c The commit that removed setting it: 7a1b557 The library doesn't sets it anywhere via instance_variable_set but users might've set it this way instead of using configure_socket.. transport.rb * Initialize @socket before it is referenced. fixes ruby-amqp#563
This was addressed to the extent we easily can do it thanks to #564. There are still some socket extension warnings that would require subclassing |
The Bunny library emits LOTS of warnings.
Most warnings are from uninitialized variables.
Below is an annotated version of the ""Hello World" example" from http://rubybunny.info/articles/getting_started.html.
More uninitialized variable warnings are emitted while performing other operations that are not included in the example.
hello-rabbit.rb
Running the script with warnings (
ruby -w hello-rabbit.rb
) yields:Workaround would be to squelch warnings on a case by case basis such as wrapping all Bunny operations like so:
However, this method cannot squelch the uninitialized variable warnings emitted while idling (which I think is from the heartbeat code).
Furthermore, this hides all warnings, legitimate or subjectively otherwise.
Bunny version: 2.11
RabbitMQ version: 3.7.5
Steps to reproduce: run
ruby -w hello-rabbit.rb
The text was updated successfully, but these errors were encountered: