)]}'
{"heatclient/v1/shell.py":[{"author":{"_account_id":7582,"name":"Jan Provaznik","email":"jan.provaznik@gmail.com","username":"jprovazn"},"change_message_id":"572b7b88873c68329323f33f9e3f1fa3caebacb3","unresolved":false,"context_lines":[{"line_number":1018,"context_line":"        # On pre-update hooks it\u0027s harder, because we don\u0027t know the"},{"line_number":1019,"context_line":"        # preceding state, or that other non-dependent resources may"},{"line_number":1020,"context_line":"        # not emit events post-hook-event"},{"line_number":1021,"context_line":"        filters \u003d [\u0027resource_status\u003dCOMPLETE\u0027]"},{"line_number":1022,"context_line":"        event_args \u003d {\u0027filters\u0027: utils.format_parameters(filters),"},{"line_number":1023,"context_line":"                      \u0027sort_dir\u0027: \u0027asc\u0027}"},{"line_number":1024,"context_line":"        hook_event_reason \u003d \u0027UPDATE paused until Hook pre-update is cleared\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"dac4157f_28453c16","line":1021,"updated":"2015-04-22 12:37:04.000000000","message":"I wonder if a resource can be in FAILED state too: if a previous stack-update failed, and I run stack-update again?","commit_id":"f005162e15f97de69fe05d6f71156d766031c75d"},{"author":{"_account_id":7582,"name":"Jan Provaznik","email":"jan.provaznik@gmail.com","username":"jprovazn"},"change_message_id":"572b7b88873c68329323f33f9e3f1fa3caebacb3","unresolved":false,"context_lines":[{"line_number":1050,"context_line":"                    resource_event_map[(e.stack_name, e.resource_name)] \u003d [e]"},{"line_number":1051,"context_line":"            elif e.resource_status_reason \u003d\u003d hook_clear_event_reason:"},{"line_number":1052,"context_line":"                if resource_event_map.get(stack_resource):"},{"line_number":1053,"context_line":"                    resource_event_map[(e.stack_name, e.resource_name)].pop(0)"},{"line_number":1054,"context_line":"        hook_events \u003d list(itertools.chain.from_iterable(resource_event_map.values()))"},{"line_number":1055,"context_line":"    else:"},{"line_number":1056,"context_line":"        hook_events \u003d [e for e in events"}],"source_content_type":"text/x-python","patch_set":2,"id":"dac4157f_63e117d0","line":1053,"updated":"2015-04-22 12:37:04.000000000","message":"This relies on the fact that all previous hooks have also \"clean up\" event, this might not be true in some cases. On my stack this method returns 2 pre-update hooks on a resource (instead of only the last one), I think it\u0027s because in event-list I see an extra \"UPDATE paused until Hook pre-update is cleared\" not followed by \"Hook pre-update is cleared\" event - stack-update operation timed-out/failed and I re-ran the update probably.\n\nHow about keeping always only the last hook event?","commit_id":"f005162e15f97de69fe05d6f71156d766031c75d"},{"author":{"_account_id":4328,"name":"Steven Hardy","email":"steven.hardy@suse.com","username":"shardy"},"change_message_id":"42fda617a490b6703fb60f73fe71a42307174e30","unresolved":false,"context_lines":[{"line_number":1050,"context_line":"                    resource_event_map[(e.stack_name, e.resource_name)] \u003d [e]"},{"line_number":1051,"context_line":"            elif e.resource_status_reason \u003d\u003d hook_clear_event_reason:"},{"line_number":1052,"context_line":"                if resource_event_map.get(stack_resource):"},{"line_number":1053,"context_line":"                    resource_event_map[(e.stack_name, e.resource_name)].pop(0)"},{"line_number":1054,"context_line":"        hook_events \u003d list(itertools.chain.from_iterable(resource_event_map.values()))"},{"line_number":1055,"context_line":"    else:"},{"line_number":1056,"context_line":"        hook_events \u003d [e for e in events"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab921fb_54b068dd","line":1053,"in_reply_to":"bab921fb_8069218e","updated":"2015-04-23 10:52:25.000000000","message":"Thanks for the feedback! :)\n\nYeah, I noticed the same thing, I had a stack-update time out with a pending hook then this logic breaks on the subsequent update.  \n\nYou\u0027re right, we need to filter events so we only look at those since the stack updated_at time.  I\u0027m looking into the cleanest way to do that.","commit_id":"f005162e15f97de69fe05d6f71156d766031c75d"},{"author":{"_account_id":7582,"name":"Jan Provaznik","email":"jan.provaznik@gmail.com","username":"jprovazn"},"change_message_id":"d876a15b517844ec3b9fe701f5ebe3fa7fa687bd","unresolved":false,"context_lines":[{"line_number":1050,"context_line":"                    resource_event_map[(e.stack_name, e.resource_name)] \u003d [e]"},{"line_number":1051,"context_line":"            elif e.resource_status_reason \u003d\u003d hook_clear_event_reason:"},{"line_number":1052,"context_line":"                if resource_event_map.get(stack_resource):"},{"line_number":1053,"context_line":"                    resource_event_map[(e.stack_name, e.resource_name)].pop(0)"},{"line_number":1054,"context_line":"        hook_events \u003d list(itertools.chain.from_iterable(resource_event_map.values()))"},{"line_number":1055,"context_line":"    else:"},{"line_number":1056,"context_line":"        hook_events \u003d [e for e in events"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab921fb_8069218e","line":1053,"in_reply_to":"dac4157f_63e117d0","updated":"2015-04-23 09:37:46.000000000","message":"Actually I think that when doing stack update we should check only events newer than stack\u0027s updated_time, otherwise it\u0027s possible that the last hook event for a resource is from a previous stack update which failed.","commit_id":"f005162e15f97de69fe05d6f71156d766031c75d"},{"author":{"_account_id":7582,"name":"Jan Provaznik","email":"jan.provaznik@gmail.com","username":"jprovazn"},"change_message_id":"52d1d1c45b28ec88247e18b0ad5a4f79ba53c4c1","unresolved":false,"context_lines":[{"line_number":994,"context_line":"                          and e[1].stack_name \u003d\u003d stack_name][-1]"},{"line_number":995,"context_line":"    # We got a tuple with the index from the enumerate, which we can slice the events with"},{"line_number":996,"context_line":"    action_start_index \u003d action_start_event[0]"},{"line_number":997,"context_line":"    events \u003d events[action_start_index:]"},{"line_number":998,"context_line":""},{"line_number":999,"context_line":"    # Get hook events still pending by some list filtering/comparison"},{"line_number":1000,"context_line":"    # We build a map of lists, containing per-resource events,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3acd31a7_92ccd036","line":997,"updated":"2015-04-30 10:37:12.000000000","message":"Only a nit  - fetching events might be improved by passing marker set to time of the action_start_event, then we wouldn\u0027t have to transfer/process all events.  But it would mean fetching events in 2 phases - get stack events, then get the marker time from last start and then get nested events.\n\nBut this would mean more complex code and the benefit is not significant ATM (number of requests to heat would remain same anyway). This might become more important in future when having a big,long running stack (e.g. tripleo overcloud) with many events associated. So this comment is not a request for change, just throwing here an idea for some future enhancement.","commit_id":"52e8c3b3961dfc9289b98797cb9d580ffbb0cbce"},{"author":{"_account_id":4328,"name":"Steven Hardy","email":"steven.hardy@suse.com","username":"shardy"},"change_message_id":"90f9d3709915f2e6fcaee9ea6311de011a8bee58","unresolved":false,"context_lines":[{"line_number":994,"context_line":"                          and e[1].stack_name \u003d\u003d stack_name][-1]"},{"line_number":995,"context_line":"    # We got a tuple with the index from the enumerate, which we can slice the events with"},{"line_number":996,"context_line":"    action_start_index \u003d action_start_event[0]"},{"line_number":997,"context_line":"    events \u003d events[action_start_index:]"},{"line_number":998,"context_line":""},{"line_number":999,"context_line":"    # Get hook events still pending by some list filtering/comparison"},{"line_number":1000,"context_line":"    # We build a map of lists, containing per-resource events,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3acd31a7_adee5189","line":997,"in_reply_to":"3acd31a7_92ccd036","updated":"2015-04-30 11:05:42.000000000","message":"Yeah, right now the only marker the heat API supports is the event ID, so this won\u0027t work, but I\u0027ve been looking in to ways to improve event filtering capabilities via https://bugs.launchpad.net/heat/+bug/1444100\n\nIdeally, as you say, we\u0027d get the event_time of the transition to e.g UPDATE_IN_PROGRESS, then pass that as a filter/marker parameter to every event-list call, then later to one call which supports nested_depth at the API level.\n\nAll of that will have to happen later during Liberty now though.","commit_id":"52e8c3b3961dfc9289b98797cb9d580ffbb0cbce"},{"author":{"_account_id":7582,"name":"Jan Provaznik","email":"jan.provaznik@gmail.com","username":"jprovazn"},"change_message_id":"52d1d1c45b28ec88247e18b0ad5a4f79ba53c4c1","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"        stack_resource \u003d (e.stack_name, e.resource_name)"},{"line_number":1006,"context_line":"        if e.resource_status_reason \u003d\u003d hook_event_reason:"},{"line_number":1007,"context_line":"            if resource_event_map.get(stack_resource):"},{"line_number":1008,"context_line":"                resource_event_map[(e.stack_name, e.resource_name)].append(e)"},{"line_number":1009,"context_line":"            else:"},{"line_number":1010,"context_line":"                resource_event_map[(e.stack_name, e.resource_name)] \u003d [e]"},{"line_number":1011,"context_line":"        elif e.resource_status_reason \u003d\u003d hook_clear_event_reason:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3acd31a7_0d38a5d2","line":1008,"updated":"2015-04-30 10:37:12.000000000","message":"I don\u0027t see a benefit of using a list for stacking all \"hook\" events per resource, technically a resource can have hook on or off, so I wonder why to keep all started events instead of just the last one? In an expected behavior, there will be 0 or 1 event per resource anyway. If heat saves multiple start events for some reason (e.g. bug), then we wil lreturn 2 or more events for a single resource.","commit_id":"52e8c3b3961dfc9289b98797cb9d580ffbb0cbce"},{"author":{"_account_id":4328,"name":"Steven Hardy","email":"steven.hardy@suse.com","username":"shardy"},"change_message_id":"90f9d3709915f2e6fcaee9ea6311de011a8bee58","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"        stack_resource \u003d (e.stack_name, e.resource_name)"},{"line_number":1006,"context_line":"        if e.resource_status_reason \u003d\u003d hook_event_reason:"},{"line_number":1007,"context_line":"            if resource_event_map.get(stack_resource):"},{"line_number":1008,"context_line":"                resource_event_map[(e.stack_name, e.resource_name)].append(e)"},{"line_number":1009,"context_line":"            else:"},{"line_number":1010,"context_line":"                resource_event_map[(e.stack_name, e.resource_name)] \u003d [e]"},{"line_number":1011,"context_line":"        elif e.resource_status_reason \u003d\u003d hook_clear_event_reason:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3acd31a7_0dae652e","line":1008,"in_reply_to":"3acd31a7_0d38a5d2","updated":"2015-04-30 11:05:42.000000000","message":"That is true, thanks - this implementation was designed around the pre-marker logic, where we had to tally hook events and hook-clear events over multiple stack actions (and as you discovered, that didn\u0027t always work).\n\nI\u0027ll look into simplifying it, although it probably won\u0027t be much, just swap the append for an assignment.","commit_id":"52e8c3b3961dfc9289b98797cb9d580ffbb0cbce"}]}
