Please review pull request #658: Ticket/2.7.x/13640 daemon infinite loop opened by (pcarlisle)

Description:

The new event_loop code in daemon was adjusting the run time based on
next_agent_run even when not running an agent. This caused the interval to
always be 0 and peg CPU usage at 100%. We should only make this adjustment if
there is an agent running.

  • Opened: Wed Apr 11 21:34:28 UTC 2012
  • Based on: puppetlabs:2.7.x (868d648524c52905c9a32cecf20d02dd0620d018)
  • Requested merge: pcarlisle:ticket/2.7.x/13640-daemon-infinite-loop (93cad921f50759a190727057deffc956e8f87eeb)

Diff follows:

diff --git a/lib/puppet/daemon.rb b/lib/puppet/daemon.rb
index b97f2c3..403ee9b 100755
--- a/lib/puppet/daemon.rb
+++ b/lib/puppet/daemon.rb
@@ -184,7 +184,10 @@ def run_event_loop
       # someone only wants listen mode.
       next_event = now + 60 * 60
       next_event > next_reparse    and next_event = next_reparse
-      next_event > next_agent_run  and next_event = next_agent_run
+
+      if agent and next_event > next_agent_run
+        next_event = next_agent_run
+      end
 
       how_long = next_event - now
 

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to