Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 712560 Details for
Bug 908655
Backport of Puppet race condition bug for 2.6.17
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch #2 against fedora distgit
bz908655-pp7165.patch (text/plain), 10.04 KB, created by
Dominic Cleal
on 2013-03-19 10:50:25 UTC
(
hide
)
Description:
patch #2 against fedora distgit
Filename:
MIME Type:
Creator:
Dominic Cleal
Created:
2013-03-19 10:50:25 UTC
Size:
10.04 KB
patch
obsolete
>commit 201d8081810c4a2ee66c9ff452b46469096d18b4 >Author: Lukas Zapletal <lzap+git@redhat.com> >Date: Tue Mar 19 10:47:47 2013 +0000 > > puppet bug #7165 patch > >diff --git a/puppet-bug7165.patch b/puppet-bug7165.patch >new file mode 100644 >index 0000000..c92fee7 >--- /dev/null >+++ b/puppet-bug7165.patch >@@ -0,0 +1,218 @@ >+commit fe846f2c1d55c3ef243a8f0d61c67c8e29a2b442 >+Author: Dominic Cleal <dcleal@redhat.com> >+Date: Tue Mar 19 10:30:34 2013 +0000 >+ >+ (#7165) Invalidate refreshes after services are started >+ >+ Backport of 0dfc0b8e and 996380b8 from Puppet 3.2 to 2.6. >+ >+diff --git a/acceptance/tests/ticket_7165_no_refresh_after_starting_service.rb b/acceptance/tests/ticket_7165_no_refresh_after_starting_service.rb >+new file mode 100644 >+index 0000000..f17caad >+--- /dev/null >++++ b/acceptance/tests/ticket_7165_no_refresh_after_starting_service.rb >+@@ -0,0 +1,41 @@ >++test_name "Bug #7165: Don't refresh service immediately after starting it" >++ >++confine :except, :platform => 'windows' >++ >++agents.each do |host| >++ dir = host.tmpdir('7165-no-refresh') >++ >++manifest = %Q{ >++ file { "#{dir}/notify": >++ content => "foo", >++ notify => Service["service"], >++ } >++ >++ service { "service": >++ ensure => running, >++ hasstatus => true, >++ hasrestart => true, >++ status => "test -e #{dir}/service", >++ start => "touch #{dir}/service", >++ stop => "rm -f #{dir}/service", >++ restart => "touch #{dir}/service_restarted", >++ require => File["#{dir}/notify"], >++ provider => base, >++ } >++} >++ >++ apply_manifest_on(host, manifest) do >++ on(host, "test -e #{dir}/service") >++ # service should not restart, since it wasn't running to begin with >++ on(host, "test -e #{dir}/service_restarted", :acceptable_exit_codes => [1]) >++ end >++ >++ # will trigger a notify next time as the file changes >++ on(host, "echo bar > #{dir}/notify") >++ >++ apply_manifest_on(host, manifest) do >++ on(host, "test -e #{dir}/service") >++ # service should restart this time >++ on(host, "test -e #{dir}/service_restarted") >++ end >++end >+diff --git a/lib/puppet/parameter/value.rb b/lib/puppet/parameter/value.rb >+index d9bfbaf..64065cf 100644 >+--- a/lib/puppet/parameter/value.rb >++++ b/lib/puppet/parameter/value.rb >+@@ -3,7 +3,7 @@ require 'puppet/parameter/value_collection' >+ # An individual Value class. >+ class Puppet::Parameter::Value >+ attr_reader :name, :options, :event >+- attr_accessor :block, :call, :method, :required_features >++ attr_accessor :block, :call, :method, :required_features, :invalidate_refreshes >+ >+ # Add an alias for this value. >+ def alias(name) >+diff --git a/lib/puppet/property.rb b/lib/puppet/property.rb >+index 12f496a..aab892c 100644 >+--- a/lib/puppet/property.rb >++++ b/lib/puppet/property.rb >+@@ -132,7 +132,11 @@ class Puppet::Property < Puppet::Parameter >+ >+ # Return a modified form of the resource event. >+ def event >+- resource.event :name => event_name, :desired_value => should, :property => self, :source_description => path >++ attrs = { :name => event_name, :desired_value => should, :property => self, :source_description => path } >++ if should and value = self.class.value_collection.match?(should) >++ attrs[:invalidate_refreshes] = true if value.invalidate_refreshes >++ end >++ resource.event attrs >+ end >+ >+ attr_reader :shadow >+diff --git a/lib/puppet/transaction/event.rb b/lib/puppet/transaction/event.rb >+index cd695cf..500ddae 100644 >+--- a/lib/puppet/transaction/event.rb >++++ b/lib/puppet/transaction/event.rb >+@@ -7,7 +7,7 @@ class Puppet::Transaction::Event >+ include Puppet::Util::Tagging >+ include Puppet::Util::Logging >+ >+- ATTRIBUTES = [:name, :resource, :property, :previous_value, :desired_value, :historical_value, :status, :message, :file, :line, :source_description, :audited] >++ ATTRIBUTES = [:name, :resource, :property, :previous_value, :desired_value, :historical_value, :status, :message, :file, :line, :source_description, :audited, :invalidate_refreshes] >+ YAML_ATTRIBUTES = %w{@audited @property @previous_value @desired_value @historical_value @message @name @status @time} >+ attr_accessor *ATTRIBUTES >+ attr_writer :tags >+diff --git a/lib/puppet/transaction/event_manager.rb b/lib/puppet/transaction/event_manager.rb >+index 3ebb0a9..39403d1 100644 >+--- a/lib/puppet/transaction/event_manager.rb >++++ b/lib/puppet/transaction/event_manager.rb >+@@ -56,6 +56,13 @@ class Puppet::Transaction::EventManager >+ >+ queue_events_for_resource(resource, resource, :refresh, [event]) if resource.self_refresh? and ! resource.deleting? >+ end >++ >++ dequeue_events_for_resource(resource, :refresh) if events.detect { |e| e.invalidate_refreshes } >++ end >++ >++ def dequeue_events_for_resource(target, callback) >++ target.info "Unscheduling #{callback} on #{target}" >++ @event_queues[target][callback] = {} >+ end >+ >+ def queue_events_for_resource(source, target, callback, events) >+@@ -69,7 +76,7 @@ class Puppet::Transaction::EventManager >+ def queued_events(resource) >+ return unless callbacks = @event_queues[resource] >+ callbacks.each do |callback, events| >+- yield callback, events >++ yield callback, events unless events.empty? >+ end >+ end >+ >+diff --git a/lib/puppet/type/service.rb b/lib/puppet/type/service.rb >+index 3658e28..2d292b8 100644 >+--- a/lib/puppet/type/service.rb >++++ b/lib/puppet/type/service.rb >+@@ -62,7 +62,7 @@ module Puppet >+ provider.stop >+ end >+ >+- newvalue(:running, :event => :service_started) do >++ newvalue(:running, :event => :service_started, :invalidate_refreshes => true) do >+ provider.start >+ end >+ >+diff --git a/spec/unit/property_spec.rb b/spec/unit/property_spec.rb >+index 56e643b..3b9699a 100755 >+--- a/spec/unit/property_spec.rb >++++ b/spec/unit/property_spec.rb >+@@ -145,6 +145,17 @@ describe Puppet::Property do >+ @instance.stubs(:path).returns "/my/param" >+ @instance.event.source_description.should == "/my/param" >+ end >++ >++ it "should have the 'invalidate_refreshes' value set if set on a value" do >++ property.stubs(:event_name).returns :my_event >++ property.stubs(:should).returns "foo" >++ foo = mock() >++ foo.expects(:invalidate_refreshes).returns(true) >++ collection = mock() >++ collection.expects(:match?).with("foo").returns(foo) >++ property.class.stubs(:value_collection).returns(collection) >++ property.event.invalidate_refreshes.should be_true >++ end >+ end >+ >+ describe "when shadowing metaparameters" do >+diff --git a/spec/unit/transaction/event_manager_spec.rb b/spec/unit/transaction/event_manager_spec.rb >+index eeb3d33..eef6fc9 100755 >+--- a/spec/unit/transaction/event_manager_spec.rb >++++ b/spec/unit/transaction/event_manager_spec.rb >+@@ -101,6 +101,16 @@ describe Puppet::Transaction::EventManager do >+ >+ @manager.queue_events(@resource, [@event]) >+ end >++ >++ it "should dequeue events for the changed resource if an event with invalidate_refreshes is processed" do >++ @event2 = Puppet::Transaction::Event.new(:name => :foo, :resource => @resource, :invalidate_refreshes => true) >++ >++ @graph.stubs(:matching_edges).returns [] >++ >++ @manager.expects(:dequeue_events_for_resource).with(@resource, :refresh) >++ >++ @manager.queue_events(@resource, [@event, @event2]) >++ end >+ end >+ >+ describe "when queueing events for a resource" do >+@@ -257,4 +267,36 @@ describe Puppet::Transaction::EventManager do >+ end >+ end >+ end >++ >++ describe "when queueing then processing events for a given resource" do >++ before do >++ @transaction = Puppet::Transaction.new(Puppet::Resource::Catalog.new) >++ @manager = Puppet::Transaction::EventManager.new(@transaction) >++ >++ @graph = stub 'graph', :matching_edges => [], :resource => @resource >++ @graph.stubs(:matching_edges).returns [] >++ @manager.stubs(:relationship_graph).returns @graph >++ >++ @resource = Puppet::Type.type(:file).new :path => "/my/file" >++ @resource.expects(:self_refresh?).returns true >++ @resource.expects(:deleting?).returns false >++ @resource.expects(:info).with { |msg| msg.include?("Scheduling refresh") } >++ @event = Puppet::Transaction::Event.new(:name => :foo, :resource => @resource) >++ end >++ >++ describe "and the events were dequeued/invalidated" do >++ before do >++ @event2 = Puppet::Transaction::Event.new(:name => :foo, :resource => @resource, :invalidate_refreshes => true) >++ @resource.expects(:info).with { |msg| msg.include?("Unscheduling") } >++ end >++ >++ it "should not run an event or log" do >++ @resource.expects(:notice).with { |msg| msg.include?("Would have triggered 'refresh'") }.never >++ @resource.expects(:refresh).never >++ >++ @manager.queue_events(@resource, [@event, @event2]) >++ @manager.process_events(@resource) >++ end >++ end >++ end >+ end >diff --git a/puppet.spec b/puppet.spec >index f7eb4cc..2057635 100644 >--- a/puppet.spec >+++ b/puppet.spec >@@ -13,7 +13,7 @@ > > Name: puppet > Version: 2.6.18 >-Release: 1%{?dist} >+Release: 2%{?dist} > Summary: A network tool for managing many disparate systems > License: GPLv2 > URL: http://puppetlabs.com >@@ -26,6 +26,7 @@ Patch0: 0001-9167-Do-not-sent-tagmail-reports-if-no-changes.patch > # https://bugzilla.redhat.com/771097 > Patch1: puppet-2.6.13-augeas-0.10.patch > Patch2: 0001-Preserve-timestamps-when-installing-files.patch >+Patch3: puppet-bug7165.patch > > Group: System Environment/Base > >@@ -88,6 +89,7 @@ The server can also function as a certificate authority and file server. > %patch0 -p1 > %patch1 -p1 > %patch2 -p1 >+%patch3 -p1 > patch -s -p1 < conf/redhat/rundir-perms.patch > > # Fix some rpmlint complaints >@@ -290,6 +292,9 @@ fi > rm -rf %{buildroot} > > %changelog >+* Thu Mar 19 2013 Lukas Zapletal <lzap+rpm@redhat.com> - 2.6.18-2 >+- Applying Puppet patch for bug #7165 >+ > * Mon Mar 11 2013 Michael Stahnke <stahnma@puppetlabs.com> - 2.6.18-1 > - Fixes for CVE-2013-1640 CVE-2013-1652 CVE-2013-1653 CVE-2013-1654 > - and CVE-2013-1655 CVE-2013-2274 CVE-2013-2275
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 908655
:
694362
| 712560 |
733042