Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

MCollective::Connector::*#disconnect should substitute nil to @connection. #56

wants to merge 1 commit into


None yet
2 participants

tarhashi commented Nov 2, 2012

I'm sorry for my broken english.

I fixed MCollective::Connector::*#disconnect.

When I called client.disconnect and I try to get a new client,it happens an error.

For example:

#!/usr/bin/env ruby

require 'mcollective'

include MCollective::RPC

mc = rpcclient("rpcutil")

printrpc mc.inventory



mc = rpcclient("rpcutil")
printrpc mc.inventory
#/usr/lib/ruby/vendor_ruby/stomp/connection.rb:284:in `subscribe': no current connection exists (Stomp::Error::NoCurrentConnection)

I'm now creating a MCollective HTTP frontend.
I want to disconnect from the queue server on every request,
but if client.disconnect was called on the end of first request,
@connection without connecting is reused on the next request.


ripienaar commented Nov 2, 2012

Generally in the middleware world its considered best to just keep the connection open and not connect many times, does not apply to all cases but certainly it's overall easier on the infrastructure to keep it open for a long time.

Your change is good, just wanted to comment on that aspect of it.

In order to take this change I will need a ticket opened at http://projects.puppetlabs.com/projects/mcollective/issues and you will need to sign the contributors agreement which you can find at the top of the ticket system once logged in



tarhashi commented Nov 2, 2012

I joined the issue tracking system and signed the contributors agreement.


At first, I thought the client didn't need explicit disconnecting.
But after ActiveMQ server was restarted, it occured a long waiting time every request.
So I tried to disconnect explicitly for the present.


@ripienaar ripienaar closed this Nov 12, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment