    # File lib/chef/resource.rb, line 598
        def run_action(action, notification_type=nil, notifying_resource=nil)
          # reset state in case of multiple actions on the same resource.
          @elapsed_time = 0
          start_time = Time.now
          events.resource_action_start(self, action, notification_type, notifying_resource)
          # Try to resolve lazy/forward references in notifications again to handle
          # the case where the resource was defined lazily (ie. in a ruby_block)
          resolve_notification_references
          validate_action(action)

          if Chef::Config[:verbose_logging] || Chef::Log.level == :debug
            # This can be noisy
            Chef::Log.info("Processing #{self} action #{action} (#{defined_at})")
          end

          # ensure that we don't leave @updated_by_last_action set to true
          # on accident
          updated_by_last_action(false)

          begin
            return if should_skip?(action)
            provider_for_action(action).run_action
          rescue Exception => e
            if ignore_failure
              Chef::Log.error("#{self} (#{defined_at}) had an error: #{e.message}; ignore_failure is set, continuing")
              events.resource_failed(self, action, e)
            elsif retries > 0
              events.resource_failed_retriable(self, action, retries, e)
              @retries -= 1
              Chef::Log.info("Retrying execution of #{self}, #{retries} attempt(s) left")
              sleep retry_delay
              retry
            else
              events.resource_failed(self, action, e)
              raise customize_exception(e)
            end
          ensure
            @elapsed_time = Time.now - start_time
            events.resource_completed(self)
          end
        end