cfn-hup triggers post.update events every time it's called

Bug #1133049 reported by Steve Baker
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
heat-cfntools
Triaged
Medium
Ethan Lynn

Bug Description

From https://review.openstack.org/#/c/21864/

> cfn-hup currently triggers the post.update events every time it's called -- even when the metadata didn't change.

Need to fix this so we only trigger updates when the metadata has changed

Changed in heat-cfntools:
importance: Undecided → High
assignee: Steve Baker (steve-stevebaker) → Steven Hardy (shardy)
Changed in heat-cfntools:
milestone: v1.2.1 → none
Changed in heat-cfntools:
milestone: none → v1.3.0
Changed in heat-cfntools:
milestone: v1.2.3 → none
Revision history for this message
Simon Pasquier (simon-pasquier) wrote :

As I understand, the issue appears when there is more than one resource monitored by cfn-hup hooks.
The cfn-hup workflow is something like this:
- process hook #1
 - retrieve metadata of resource #1
 - compare with /var/cache/heat-cfntools/last_metadata
 - run hook
 - store metadata of resource #1 in /var/cache/heat-cfntools/last_metadata
- process hook #2
 - retrieve metadata of resource #2
 - compare with /var/cache/heat-cfntools/last_metadata <<< different since it contains metadata of resource #1
 - run hook
 - store metadata of resource #2 in /var/cache/heat-cfntools/last_metadata

Revision history for this message
Simon Pasquier (simon-pasquier) wrote :

Additionally bug #1205375 describes another reason why cfn-hup would execute a hook at every run.

Changed in heat-cfntools:
milestone: none → v1.2.8
importance: High → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat-cfntools (master)

Fix proposed to branch: master
Review: https://review.openstack.org/96401

Changed in heat-cfntools:
assignee: Steven Hardy (shardy) → Ethan Lynn (xuanlangjian)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat-cfntools (master)

Reviewed: https://review.openstack.org/96401
Committed: https://git.openstack.org/cgit/openstack/heat-cfntools/commit/?id=5f7025558cf468792d1c18605667888a5d775b36
Submitter: Jenkins
Branch: master

commit 5f7025558cf468792d1c18605667888a5d775b36
Author: Ethan Lynn <email address hidden>
Date: Thu May 29 14:49:14 2014 +0800

    Add res_last_path to store last metadata of a resource

    Add res_last_path='/var/cache/heat-cfntools/last_metadata_<resource>'
    in Metadata.retrieve() function to store metadata of a resource.
    Remove md5 check between current metadata and last metadata, json.load()
    will organize json structure.

    Change-Id: Ie0c31a748f0add3fcab6a579431a28b60051f601
    Closes-Bug: #1205375
    Partial-Bug: #1133049

Changed in heat-cfntools:
milestone: v1.2.8 → v1.2.9
Changed in heat-cfntools:
milestone: v1.3.0 → none
status: In Progress → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.