)]}'
{"heat/engine/resource.py":[{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"4be33227a3dd6fab0322a7d90741c154af092672","unresolved":false,"context_lines":[{"line_number":801,"context_line":""},{"line_number":802,"context_line":"        def handle_failed_action():"},{"line_number":803,"context_line":"            failure_handler \u003d getattr("},{"line_number":804,"context_line":"                self, \u0027handle_failed_%s\u0027 % action.lower(), None)"},{"line_number":805,"context_line":"            if callable(failure_handler):"},{"line_number":806,"context_line":"                try:"},{"line_number":807,"context_line":"                    failure_handler()"}],"source_content_type":"text/x-python","patch_set":3,"id":"df3967d1_f52c7e48","line":804,"updated":"2017-07-31 19:33:03.000000000","message":"This shouldn\u0027t be needed. We already have a handle_\u003caction\u003e_cancel() method that handles this case. (It\u0027s called from action_handler_task()).","commit_id":"d3a36f833e703669e37adb939de0c763a72a67b7"},{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"4e4e65b7d123850ee8e6e0f1568133c3739c2284","unresolved":false,"context_lines":[{"line_number":801,"context_line":""},{"line_number":802,"context_line":"        def handle_failed_action():"},{"line_number":803,"context_line":"            failure_handler \u003d getattr("},{"line_number":804,"context_line":"                self, \u0027handle_failed_%s\u0027 % action.lower(), None)"},{"line_number":805,"context_line":"            if callable(failure_handler):"},{"line_number":806,"context_line":"                try:"},{"line_number":807,"context_line":"                    failure_handler()"}],"source_content_type":"text/x-python","patch_set":3,"id":"df3967d1_b3b16992","line":804,"in_reply_to":"df3967d1_138f152b","updated":"2017-08-01 01:30:26.000000000","message":"Hmmm.. OK. True for SoftwareDeployment. But I thought there can be cases with other resource plugins (may be custom ones), where this would not be the case. As this is expected to be generic, there can be some exceptions from check_\u003caction\u003e_complete which are not linked to the failure of the underlying resource.\n\nBut may be we don\u0027t care much about that scenario. Also I thought it would be better to do that action after marking the resource as failed in db rather than before it.","commit_id":"d3a36f833e703669e37adb939de0c763a72a67b7"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"98bfde52adfec29f8e4cff8cce1253585854a686","unresolved":false,"context_lines":[{"line_number":801,"context_line":""},{"line_number":802,"context_line":"        def handle_failed_action():"},{"line_number":803,"context_line":"            failure_handler \u003d getattr("},{"line_number":804,"context_line":"                self, \u0027handle_failed_%s\u0027 % action.lower(), None)"},{"line_number":805,"context_line":"            if callable(failure_handler):"},{"line_number":806,"context_line":"                try:"},{"line_number":807,"context_line":"                    failure_handler()"}],"source_content_type":"text/x-python","patch_set":3,"id":"df3967d1_138f152b","line":804,"in_reply_to":"df3967d1_581edaba","updated":"2017-08-01 01:05:38.000000000","message":"If it fails, it\u0027s because the underlying deployment has actually failed. We don\u0027t need to make a call back to the deployment to tell it it has failed in that case. It\u0027s only the case where we fail for some reason external to the deployment (timeout, thread kill, task cancel) that we have to handle, and that\u0027s the exact case that handle_\u003caction\u003e_cancel() is designed for.","commit_id":"d3a36f833e703669e37adb939de0c763a72a67b7"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"b7f10823b6eef422679c79c277baef7680d7c560","unresolved":false,"context_lines":[{"line_number":801,"context_line":""},{"line_number":802,"context_line":"        def handle_failed_action():"},{"line_number":803,"context_line":"            failure_handler \u003d getattr("},{"line_number":804,"context_line":"                self, \u0027handle_failed_%s\u0027 % action.lower(), None)"},{"line_number":805,"context_line":"            if callable(failure_handler):"},{"line_number":806,"context_line":"                try:"},{"line_number":807,"context_line":"                    failure_handler()"}],"source_content_type":"text/x-python","patch_set":3,"id":"df3967d1_cfdade15","line":804,"in_reply_to":"df3967d1_b3b16992","updated":"2017-08-01 20:53:39.000000000","message":"\u003e But I thought there can be cases with other resource plugins (may be custom ones), where this would not be the case.\n\nI can\u0027t think why, but in any case plugins are always free to catch exceptions within their own handle_*() methods if they want. There\u0027s no need for the engine to get involved - and in fact it\u0027s better if it doesn\u0027t because you lose information about what caused the failure.\n\n\u003e Also I thought it would be better to do that action after marking the resource as failed in db rather than before it.\n\nWe shouldn\u0027t ever mess with the physical resource after the Resource is unlocked in the database, otherwise race conditions will surely result.","commit_id":"d3a36f833e703669e37adb939de0c763a72a67b7"},{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"fd7dbaf9f652e977df2a82f67d2469723d52c6f2","unresolved":false,"context_lines":[{"line_number":801,"context_line":""},{"line_number":802,"context_line":"        def handle_failed_action():"},{"line_number":803,"context_line":"            failure_handler \u003d getattr("},{"line_number":804,"context_line":"                self, \u0027handle_failed_%s\u0027 % action.lower(), None)"},{"line_number":805,"context_line":"            if callable(failure_handler):"},{"line_number":806,"context_line":"                try:"},{"line_number":807,"context_line":"                    failure_handler()"}],"source_content_type":"text/x-python","patch_set":3,"id":"df3967d1_581edaba","line":804,"in_reply_to":"df3967d1_f52c7e48","updated":"2017-08-01 00:17:01.000000000","message":"I did think about using that. However, would not handle_\u003caction\u003e_cancel only handle cases where it\u0027s a BaseException (scheduler ones like Timeout) and not other exceptions (Exception) from check_\u003caction\u003e_complete?\n\nMay be we call handle_\u003caction\u003e_cancel in place instead?","commit_id":"d3a36f833e703669e37adb939de0c763a72a67b7"}],"heat/engine/resources/openstack/heat/software_deployment.py":[{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"4be33227a3dd6fab0322a7d90741c154af092672","unresolved":false,"context_lines":[{"line_number":526,"context_line":"                config_id\u003dNone, input_values\u003dNone, action\u003dNone,"},{"line_number":527,"context_line":"                updated_at\u003dNone)"},{"line_number":528,"context_line":""},{"line_number":529,"context_line":"    def handle_failed_create(self):"},{"line_number":530,"context_line":"        self._handle_failure()"},{"line_number":531,"context_line":""},{"line_number":532,"context_line":"    def handle_failed_update(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"df3967d1_f5e11e00","line":529,"updated":"2017-07-31 19:33:03.000000000","message":"handle_create_cancel()","commit_id":"d3a36f833e703669e37adb939de0c763a72a67b7"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"e1ebd53a5e9577434a783cf68399a25a6f4634fd","unresolved":false,"context_lines":[{"line_number":507,"context_line":"            self.context, self.resource_id, details,"},{"line_number":508,"context_line":"            timeutils.utcnow().isoformat())"},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"    def _handle_failure(self):"},{"line_number":511,"context_line":"        if self.resource_id is None:"},{"line_number":512,"context_line":"            return"},{"line_number":513,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"df3967d1_af71da0e","line":510,"updated":"2017-08-01 20:58:52.000000000","message":"_handle_cancel would make more sense.","commit_id":"1e4aea84ee3a2b1785b4d78a1c870908ae61f4a8"},{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"9f3acb14a4b899158796d64432c7f76ab899cc4d","unresolved":false,"context_lines":[{"line_number":507,"context_line":"            self.context, self.resource_id, details,"},{"line_number":508,"context_line":"            timeutils.utcnow().isoformat())"},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"    def _handle_failure(self):"},{"line_number":511,"context_line":"        if self.resource_id is None:"},{"line_number":512,"context_line":"            return"},{"line_number":513,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"df3967d1_6e31afec","line":510,"in_reply_to":"df3967d1_af71da0e","updated":"2017-08-02 01:16:49.000000000","message":"yep it would make more sense now.","commit_id":"1e4aea84ee3a2b1785b4d78a1c870908ae61f4a8"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"e1ebd53a5e9577434a783cf68399a25a6f4634fd","unresolved":false,"context_lines":[{"line_number":522,"context_line":"            self.rpc_client().update_software_deployment("},{"line_number":523,"context_line":"                self.context, self.resource_id,"},{"line_number":524,"context_line":"                output_values\u003dNone, status\u003dSoftwareDeployment.FAILED,"},{"line_number":525,"context_line":"                status_reason\u003d\u0027Updating deployment as failed\u0027,"},{"line_number":526,"context_line":"                config_id\u003dNone, input_values\u003dNone, action\u003dNone,"},{"line_number":527,"context_line":"                updated_at\u003dNone)"},{"line_number":528,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"df3967d1_af4afaa8","line":525,"range":{"start_line":525,"start_character":31,"end_line":525,"end_character":60},"updated":"2017-08-01 20:58:52.000000000","message":"\"Deployment cancelled.\"?\n\nAlso, we should probably internationalise this.","commit_id":"1e4aea84ee3a2b1785b4d78a1c870908ae61f4a8"},{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"9f3acb14a4b899158796d64432c7f76ab899cc4d","unresolved":false,"context_lines":[{"line_number":522,"context_line":"            self.rpc_client().update_software_deployment("},{"line_number":523,"context_line":"                self.context, self.resource_id,"},{"line_number":524,"context_line":"                output_values\u003dNone, status\u003dSoftwareDeployment.FAILED,"},{"line_number":525,"context_line":"                status_reason\u003d\u0027Updating deployment as failed\u0027,"},{"line_number":526,"context_line":"                config_id\u003dNone, input_values\u003dNone, action\u003dNone,"},{"line_number":527,"context_line":"                updated_at\u003dNone)"},{"line_number":528,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"df3967d1_cea3fb9d","line":525,"range":{"start_line":525,"start_character":31,"end_line":525,"end_character":60},"in_reply_to":"df3967d1_af4afaa8","updated":"2017-08-02 01:16:49.000000000","message":"OK, we don\u0027t internationalize status_reason in many places though.","commit_id":"1e4aea84ee3a2b1785b4d78a1c870908ae61f4a8"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"e1ebd53a5e9577434a783cf68399a25a6f4634fd","unresolved":false,"context_lines":[{"line_number":534,"context_line":""},{"line_number":535,"context_line":"    def handle_delete_cancel(self, cookie):"},{"line_number":536,"context_line":"        self._handle_failure()"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"    def get_attribute(self, key, *path):"},{"line_number":539,"context_line":"        \"\"\"Resource attributes map to deployment outputs values.\"\"\""},{"line_number":540,"context_line":"        sd \u003d self.rpc_client().show_software_deployment("}],"source_content_type":"text/x-python","patch_set":6,"id":"df3967d1_4fea6e75","line":537,"updated":"2017-08-01 20:58:52.000000000","message":"missing suspend/resume","commit_id":"1e4aea84ee3a2b1785b4d78a1c870908ae61f4a8"},{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"9f3acb14a4b899158796d64432c7f76ab899cc4d","unresolved":false,"context_lines":[{"line_number":534,"context_line":""},{"line_number":535,"context_line":"    def handle_delete_cancel(self, cookie):"},{"line_number":536,"context_line":"        self._handle_failure()"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"    def get_attribute(self, key, *path):"},{"line_number":539,"context_line":"        \"\"\"Resource attributes map to deployment outputs values.\"\"\""},{"line_number":540,"context_line":"        sd \u003d self.rpc_client().show_software_deployment("}],"source_content_type":"text/x-python","patch_set":6,"id":"df3967d1_8eadf389","line":537,"in_reply_to":"df3967d1_4fea6e75","updated":"2017-08-02 01:16:49.000000000","message":"Done","commit_id":"1e4aea84ee3a2b1785b4d78a1c870908ae61f4a8"}]}
