Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Commit

Permalink
(#511) Reduce logging in network loops
Browse files Browse the repository at this point in the history
Upcoming NATS broker will be significantly faster and so add a lot more
strain on these 2 code paths

Removing the log lines let it work unbatched for smallisy payload on 50k
nodes but really there's only so far this will go and we're getting
there now
  • Loading branch information
ripienaar committed Jun 8, 2018
1 parent a8ba628 commit a420e5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/mcollective/connector/nats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ def receive
msg = nil

until msg
Log.debug("Waiting for a message from NATS")

received = connection.receive

Thread.pass

begin
msg = JSON.parse(received)
rescue
Expand Down
3 changes: 1 addition & 2 deletions lib/mcollective/util/natswrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ def subscribe(source_name, options={})
Log.debug("Subscribing to %s" % source_name)

unless @subscriptions.include?(source_name)
@subscriptions[source_name] = @client.subscribe(source_name, options) do |msg, _, sub|
Log.debug("Received a message on %s" % [sub])
@subscriptions[source_name] = @client.subscribe(source_name, options) do |msg, _, _|
@received_queue << msg
end
end
Expand Down

0 comments on commit a420e5f

Please sign in to comment.