)]}'
{"mistral/engine/task_handler.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"b458b63b8086febd01be368f95ce37f6f7d579e3","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    task_ex \u003d action_ex.task_execution"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    # Ignore if action already completed."},{"line_number":168,"context_line":"    if (states.is_completed(action_ex.state) and not"},{"line_number":169,"context_line":"            isinstance(action_ex, models.WorkflowExecution)):"},{"line_number":170,"context_line":"        return task_ex"},{"line_number":171,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_63ab52d7","side":"PARENT","line":168,"updated":"2015-09-03 07:10:16.000000000","message":"I don\u0027t understand this change, honestly. In the commit message you pointed that workflow state influences whether we accept task(action) result or not. But here don\u0027t check workflow state. Instead you check state of an action that\u0027s being completed by calling this method. Maybe your patch is correct, but please help me see the logic.\n\nThanks.","commit_id":"6f5e232354a1fe19d019abb584874b430db90d25"}],"mistral/tests/unit/engine/test_workflow_stop.py":[{"author":{"_account_id":15881,"name":"Limor Stotland","email":"limor.bortman@nokia.com","username":"LimorStotlamd"},"change_message_id":"ffd268715b2bc4e139b0061a354c0a27695b5087","unresolved":false,"context_lines":[{"line_number":32,"context_line":"          type: direct"},{"line_number":33,"context_line":"          tasks:"},{"line_number":34,"context_line":"            task1:"},{"line_number":35,"context_line":"              action: std.noop"},{"line_number":36,"context_line":"              on-complete:"},{"line_number":37,"context_line":"                - task2"},{"line_number":38,"context_line":"            task2:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_477b688c","line":35,"updated":"2015-08-31 06:38:47.000000000","message":"why did you change the action?","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"b458b63b8086febd01be368f95ce37f6f7d579e3","unresolved":false,"context_lines":[{"line_number":32,"context_line":"          type: direct"},{"line_number":33,"context_line":"          tasks:"},{"line_number":34,"context_line":"            task1:"},{"line_number":35,"context_line":"              action: std.noop"},{"line_number":36,"context_line":"              on-complete:"},{"line_number":37,"context_line":"                - task2"},{"line_number":38,"context_line":"            task2:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_a272c9e1","line":35,"in_reply_to":"da20952f_041d5365","updated":"2015-09-03 07:10:16.000000000","message":"Agree with Winson here. It doesn\u0027t matter.","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"afb7d53667ee043bc54b44782983504b9265d9d9","unresolved":false,"context_lines":[{"line_number":32,"context_line":"          type: direct"},{"line_number":33,"context_line":"          tasks:"},{"line_number":34,"context_line":"            task1:"},{"line_number":35,"context_line":"              action: std.noop"},{"line_number":36,"context_line":"              on-complete:"},{"line_number":37,"context_line":"                - task2"},{"line_number":38,"context_line":"            task2:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_041d5365","line":35,"in_reply_to":"da20952f_477b688c","updated":"2015-08-31 16:13:57.000000000","message":"It it bothers you I can change it. The purpose of the tests here are to see if we can stop workflow execution. It doesn\u0027t matter what type of actions we run. I used noop action below so I also changed this one to be consistent.","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"b458b63b8086febd01be368f95ce37f6f7d579e3","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.exec_id \u003d self.engine.start_workflow(\u0027wf\u0027, {}).id"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def test_stop_failed(self):"},{"line_number":50,"context_line":"        self.engine.stop_workflow(self.exec_id, states.SUCCESS, \"Force stop\")"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        self._await(lambda: self.is_execution_success(self.exec_id))"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_c32c9e4c","line":49,"updated":"2015-09-03 07:10:16.000000000","message":"I know it\u0027s not about this patch but why is this test called \"stop_failed\"? What fails here? My guess is that it\u0027s just obsolete.","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"b458b63b8086febd01be368f95ce37f6f7d579e3","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        )"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        wf_ex \u003d db_api.get_execution(self.exec_id)"},{"line_number":71,"context_line":"        self._await(lambda: self.is_task_success(wf_ex.task_executions[0].id))"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        # This is required to give the engine time to start task2."},{"line_number":74,"context_line":"        eventlet.sleep(1)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_8399c670","line":71,"updated":"2015-09-03 07:10:16.000000000","message":"I completely disagree with using wf_ex.task_executions[0] here.\n\n1. We don\u0027t know exactly if task2 has already started.\n\n2. The order f task executions is not guaranteed.","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"b458b63b8086febd01be368f95ce37f6f7d579e3","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        self._await(lambda: self.is_task_success(wf_ex.task_executions[0].id))"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        # This is required to give the engine time to start task2."},{"line_number":74,"context_line":"        eventlet.sleep(1)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        self.engine.stop_workflow(self.exec_id, states.ERROR, \"Failure\")"},{"line_number":77,"context_line":"        self._await(lambda: self.is_execution_error(self.exec_id))"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_c3dd7e15","line":74,"updated":"2015-09-03 07:10:16.000000000","message":"Instead of using sleep please use\n\nself._await(lambda: self.is_task_running(task1.id))","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"b458b63b8086febd01be368f95ce37f6f7d579e3","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        self.assertEqual(states.ERROR, wf_ex.state)"},{"line_number":81,"context_line":"        self.assertEqual(\"Failure\", wf_ex.state_info)"},{"line_number":82,"context_line":"        self.assertEqual(2, len(wf_ex.task_executions))"},{"line_number":83,"context_line":"        self.assertEqual(states.SUCCESS, wf_ex.task_executions[0].state)"},{"line_number":84,"context_line":"        self.assertEqual(states.RUNNING, wf_ex.task_executions[1].state)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        self.engine.on_action_complete("}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_231c7ac0","line":83,"updated":"2015-09-03 07:10:16.000000000","message":"Same here. Once in a while task execution order may differ.\n\nUse self._assert_single_item(task_execs, name\u003d\u0027task1\u0027) to reliably identify a task.","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"f4855fbf2d5b9ad6c918ee9b524d4c25933aafd7","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            wf_utils.Result(\"Completed\")"},{"line_number":89,"context_line":"        )"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        eventlet.sleep(1)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        wf_ex \u003d db_api.get_execution(self.exec_id)"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_5c181a1e","line":91,"updated":"2015-08-31 08:50:21.000000000","message":"Why can\u0027t we use\n\n  self._await(lambda: self.is_execution_error(wf_ex.id))\n\nhere instead of lines 91-94?","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"3cf9ae52dceb6562432858410026d11dc4631b09","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            wf_utils.Result(\"Completed\")"},{"line_number":89,"context_line":"        )"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        eventlet.sleep(1)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        wf_ex \u003d db_api.get_execution(self.exec_id)"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_2aacb98a","line":91,"in_reply_to":"da20952f_09580c55","updated":"2015-09-01 10:34:28.000000000","message":"If you are waiting fot task completeness, then this task is in RUNNING state. Hence the whole workflow should be in RUNNING state too.","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"50ada363fd8f0480e8db0921f003cadba6170f12","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            wf_utils.Result(\"Completed\")"},{"line_number":89,"context_line":"        )"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        eventlet.sleep(1)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        wf_ex \u003d db_api.get_execution(self.exec_id)"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_934de1c6","line":91,"in_reply_to":"da20952f_0d13f30e","updated":"2015-09-01 22:02:50.000000000","message":"Ok. I can use the is_task_success.  \n\nAlso, maybe the WF example in the test is not clear.  If I have the following where task2a errored but task2b is running, what\u0027s the expected state of the WF?\n\ntask1:\n  action: std.noop\n  on-success:\n    - task2a\n    - task2b\ntask2a:\n  action: std.fail\n  on-success:\n    - task3\ntask2b:\n  action: std.async_noop\n  on-success:\n    - task3\ntask3:\n  join: all\n  action: std.noop","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"91c0af9d3f03278699610437da51a30cd9676d04","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            wf_utils.Result(\"Completed\")"},{"line_number":89,"context_line":"        )"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        eventlet.sleep(1)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        wf_ex \u003d db_api.get_execution(self.exec_id)"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_ad5df016","line":91,"in_reply_to":"da20952f_1e25485b","updated":"2015-09-02 18:13:52.000000000","message":"Yes, right now if task2a fails and task2b hasn\u0027t finish yet, the WF is still in RUNNING state.  If a user manually update the WF execution state to ERROR which they can via PUT at the executions API, then basically, there\u0027s no way to complete task2b even if it completes successfully. The patch here is to address the part where the WF is marked as ERROR but there are still tasks in RUNNING state.  If those tasks finishes, they should be able to mark completion but the WF will stay in ERROR and won\u0027t proceed.","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"7c3d0155457a49cd947bfc203c252147c16e1be9","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            wf_utils.Result(\"Completed\")"},{"line_number":89,"context_line":"        )"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        eventlet.sleep(1)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        wf_ex \u003d db_api.get_execution(self.exec_id)"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_8ac0492c","line":91,"in_reply_to":"da20952f_2aacb98a","updated":"2015-09-01 18:56:58.000000000","message":"That\u0027s not the case. If I have multiple tasks running at the same time and one of the task fails, it\u0027ll lead to WF ERROR. Once the WF is in ERROR, any other tasks will be stuck in RUNNING even if they run to completion successfully.  Go try it on Mistral and you\u0027ll see what I mean.","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"afb7d53667ee043bc54b44782983504b9265d9d9","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            wf_utils.Result(\"Completed\")"},{"line_number":89,"context_line":"        )"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        eventlet.sleep(1)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        wf_ex \u003d db_api.get_execution(self.exec_id)"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_09580c55","line":91,"in_reply_to":"da20952f_5c181a1e","updated":"2015-08-31 16:13:57.000000000","message":"The WF execution is already in ERROR state.  I\u0027m waiting for the existing task execution to reach the completion state. Also, I\u0027m sleeping 1 sec to give a bit of time to make sure the WF execution is not executing task #3. There seems to be timing challenges running unit tests on various different test machines.","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"c32a52b7bc23194ae583238813ac7670c0da38de","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            wf_utils.Result(\"Completed\")"},{"line_number":89,"context_line":"        )"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        eventlet.sleep(1)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        wf_ex \u003d db_api.get_execution(self.exec_id)"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_8d5e2311","line":91,"in_reply_to":"da20952f_8ac0492c","updated":"2015-09-01 19:12:48.000000000","message":"That case you just described is a bug.\n\nSo, then we should be allowed also to run any task of the workflow if that task was success (imagine, we expect error state from that task but get success).","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"b20f06e49ebf879431f4ab141eb39c0ec5e55484","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            wf_utils.Result(\"Completed\")"},{"line_number":89,"context_line":"        )"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        eventlet.sleep(1)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        wf_ex \u003d db_api.get_execution(self.exec_id)"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_0d13f30e","line":91,"in_reply_to":"da20952f_8d5e2311","updated":"2015-09-01 19:14:49.000000000","message":"Ok, then use\n\n    self._await(lambda: self.is_task_success(task_ex))\n\ninstead of just sleep.","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"87564dd6394042b1efe3ca5b0bac5d6a1f5b63ee","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            wf_utils.Result(\"Completed\")"},{"line_number":89,"context_line":"        )"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        eventlet.sleep(1)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        wf_ex \u003d db_api.get_execution(self.exec_id)"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_1e25485b","line":91,"in_reply_to":"da20952f_934de1c6","updated":"2015-09-02 05:48:08.000000000","message":"For now it will hang in RUNNING state (join is not triggered) but I guess it should be in ERROR (task2a errored and it is enough to fail task3). Also we still need to wait for task2b completeness though.","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"b458b63b8086febd01be368f95ce37f6f7d579e3","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            wf_utils.Result(\"Completed\")"},{"line_number":89,"context_line":"        )"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        eventlet.sleep(1)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        wf_ex \u003d db_api.get_execution(self.exec_id)"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_e3ca021a","line":91,"in_reply_to":"da20952f_ad5df016","updated":"2015-09-03 07:10:16.000000000","message":"I don\u0027t actually understand why we should actually wait here at all. on_action_complete() method has a transaction that commits all changes of wf and tasks caused by this operation into DB. Upon its completion we can just check all states w/o waiting.","commit_id":"1db9c37c8ecb653779ad3339dcce96b338992d8b"}]}
