When running mco rpc from at, scripts, jenkins etc STDIN would not be a tty but there would be no data on STDIN. In the past it would assume there was discovery data on STDIN in this scenario and fail. Now it checks if the data read is empty and does a normal discovery if it is
so this commit moves to using IO.any_instance which seems to keep all versions of Rspec happy
Added the "logfacility" configuration key. This allows users who are logging to syslog the ability to set the desired facility. Syslog defaults to LOG_USER aka user when no facility is specified. The value for "logfacility" is expected to be the shorthand common facility names such as local5, daemon, mail, etc. The "LOG_" prefix get's prepended automatically when the syslog handle get's initialized.
Clarify the use of utility classes with agents
…intrpc The display helper would split a string on new lines and then print each resulting line padded appropriately. In the case of an empty line splitting on new lines would return an empty array and so no output will be produced - not even a new line - thus resulting in a badly formatted table.
Ruby 1.9 removed the html template for rdoc instead using one called darkfish, the Rakefile specifically requests the use of the html template We didn't actually need to specify a specific template since rdoc does the right thing by default on ruby 1.8.6 and newer. So this commit removes the explicit template name relying on the defaults.
There are various failure states for a typical client and the unix convention is that failure should be indicated by non 0 exit code This commit introduce a halt() helper on the Applications class and changes all the built in application plugins to use this helper to standardize the exit codes as per the list: * Exit with 0 if nodes were discovered and all passed * Exit with 0 if no discovery were done and > 0 responses were received * Exit with 1 if no nodes were discovered * Exit with 2 if nodes were discovered but some RPC requests failed * Exit with 3 if no responses were received but discovery were done * Exit with 4 if no discovery were done and no responses were received
guaranteed order especially on older ruby. Sort the list while doing the test compare to avoid failures on 1.8.6
For debugging purposes we log the headers for subscriptions and publishing in the ActiveMQ connector unfortunately this was done using pretty_inspect, this changes it to plain inspect
Add reply_to handling to the message object, option parsing and rpc client. Messages with reply_to set will be treated like fire and forget ones since the clients will never get the results anyway
…ed to the user Change the behavior of the PluginManager to raise errors as well as log errors when a file fails to load. This behavior is optional so we're able to maintain old behavior in places where getting exceptions might be problematic. The Applications#run method now show a friendly error and backtrace which would hopefully help users get to the bottom of the problem
Small update to the sparklines logic. Add encoding hints to the top of the file needed for ruby 1.9 compat
Allow the ping graph to be enabled using the config file
Add a #limit_method= method to the RPC Client. Add tests for limit_target= and some small optimizations to how that method works
Add a --graph option that uses a small single line spark line to indicate response distribution The sparklines idea is initially from https://github.com/holman/spark but this implimentation is using a slightly different algo main: fix some whitespace issues
Add an ActiveMQ connector, tests and docs. This connector use the following queues and topics: - A topic per agent and collective - <collective>.<agent name>.agent - Replies goes into short lived queues - <collective>.replies.<unique string> - Each node subscribe to a queue with a JMS selector matching its identify - <collective>.nodes The model of replies require the use of gcInactiveDestinations in ActiveMQ to purge old unused short lived queues. The hope is that we will use actual temp queues in future but there's some issues configuring these reliably in ActiveMQ Each node subscribes to the nodes queue and use a JMS selector, this requires a queue specific connection for broker to broker comms that has conduitSubscriptions disabled.
Add native batching to RPC::Client instances by adding a special case runner that use the new direct addressing mode. Clients can activate this in 2 ways: client = rpcclient("rpcutil") client.batch_size = 10 client.batch_sleep_time = 1 client.ping An alternative approach would be: client = rpcclient("rpcutil") client.ping(:batch_size => 10, :batch_sleep_time => 1)
Move Array#in_groups_of monkey patch into main set of monkey patches that always gets applied. Avoid applying our monkey patches if ruby provides the functionality already - latest ruby has sortable symbols already. Add tests for our monkey patches
…ymore The client subscribes to topics for replies but never unsubscribes, further each client instance track what it is subscribed too. This caused a few problems: - badly written connectors could in some cases have multiple subscriptions causing multiple replies to be received - while the client is idle messages are still being pushed into its buffer which would result in a lot of messages being processed we really should not care for We now unsubscribe from topics when we're done with them avoiding most of these problems
Fix a failing test for ruby 1.9.2
Create a helper function on the MC::Security::Base that security plugins can use to decide if they should do all the hard work. The basic structure of a security plugins decode phase is: msg = deserialize(payload) decrypt or decode(msg) the 2nd step is generally the really expensive step where SSL or RSA comes into play, these plugins can now use the should_process_msg? helper to raise an appropriate exception if the message is not for us before doing the expensive work
The MC::Message object can now store an expected_msgid for messages of type :reply. This can later be read by security plugins as a hint but they should deal with the fact that it might be nil. The MC::Client sets this when appropriate
We used to do require for the spec_helper based on __FILE__ but this casues problems because ruby require will keep track of things it has required before based on the path passed to require. RSpec 2.7.0 has made calling its config blocks more than once a critical error so the combination of doing requires with different paths triggers this error. Switched to just using require 'spec_helper' instead
- Make the SSL test case less fragile by checking the exception type and not the text - Handle changes introduced in the SSL API in a way that should cover ruby 1.8.6 - 1.9.3 - Update vendored systemu to the latest to avoid RbConfig warnings printed to STDERR
…haracters To be certain we never attempt to read/write files we shouldn't for example in naive registration plugins the framework now ensures that callerids and identities can only be /\w\.\-/ There's a new method valid_callerid? on the security base class so if there's some weird and wonderful need a security plugin could override this check but generally the current setting should be left alone as is.
…call reset Improve test isolation by allowing mock STDERR and STDOUT in the client