[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

James Turnbull james at lovedthanlost.net
Fri Jan 23 14:21:52 UTC 2009


The following commit has been merged in the master branch:
commit 9ab3afb5423b406c661805946aac174f7f3e5674
Author: Luke Kanies <luke at madstop.com>
Date:   Fri Nov 28 11:23:17 2008 -0600

    Hopefully fixing #1703 - using a mutex around the sending of the tagmails
    
    It's not really possible to test that this fixes the problem, and
    I can't even reproduce it, but hopefully this will work.
    
    Signed-off-by: Luke Kanies <luke at madstop.com>

diff --git a/lib/puppet/reports/tagmail.rb b/lib/puppet/reports/tagmail.rb
index 102647c..fa4e536 100644
--- a/lib/puppet/reports/tagmail.rb
+++ b/lib/puppet/reports/tagmail.rb
@@ -151,12 +151,14 @@ Puppet::Reports.register_report(:tagmail) do
                     reports.each do |emails, messages|
                         Puppet.info "Sending report to %s" % emails.join(", ")
                         # We need to open a separate process for every set of email addresses
-                        IO.popen(Puppet[:sendmail] + " " + emails.join(" "), "w") do |p|
-                            p.puts "From: #{Puppet[:reportfrom]}"
-                            p.puts "Subject: Puppet Report for %s" % self.host
-                            p.puts "To: " + emails.join(", ")
-
-                            p.puts messages
+                        sync.synchronize do
+                            IO.popen(Puppet[:sendmail] + " " + emails.join(" "), "w") do |p|
+                                p.puts "From: #{Puppet[:reportfrom]}"
+                                p.puts "Subject: Puppet Report for %s" % self.host
+                                p.puts "To: " + emails.join(", ")
+
+                                p.puts messages
+                            end
                         end
                     end
                 rescue => detail
@@ -174,5 +176,11 @@ Puppet::Reports.register_report(:tagmail) do
         # Don't bother waiting for the pid to return.
         Process.detach(pid)
     end
+
+    def sync
+        unless defined?(@sync)
+            @sync = Sync.new
+        end
+    end
 end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list