)]}'
{"mistral/db/v2/sqlalchemy/api.py":[{"author":{"_account_id":9029,"name":"Moshe Elisha","email":"moshe.elisha@nokia.com","username":"MosheElisha"},"change_message_id":"7f5654fa4f57c66488b24cbe5c087b41bedb1c1c","unresolved":false,"context_lines":[{"line_number":796,"context_line":"    return task_ex"},{"line_number":797,"context_line":""},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"def update_task_where(values, **kwargs):"},{"line_number":800,"context_line":"    query \u003d _secure_query(models.TaskExecution).filter_by(**kwargs)"},{"line_number":801,"context_line":""},{"line_number":802,"context_line":"    res \u003d query.update(values, synchronize_session\u003d\u0027fetch\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_b3b8ce76","line":799,"updated":"2015-12-01 17:57:57.000000000","message":"I think that this method does not do exactly what you wanted.\nWith this approach there will be a SELECT followed by an UPDATE.\nIf two processes enter here at the exact same time - both will do SELECT and get a row and than both will do UPDATE.\n\nIn order to really ensure that only one connection is updating the task state - executing UPDATE ... WHERE ... you need to use \"update_on_match\" (see update_cron_trigger or update_delayed_call as an example).","commit_id":"863ba65f88531c8f1c0622df12a8eb6d38aacdc2"},{"author":{"_account_id":9029,"name":"Moshe Elisha","email":"moshe.elisha@nokia.com","username":"MosheElisha"},"change_message_id":"8551645235e41bd8fa5908670115082b28b50cf3","unresolved":false,"context_lines":[{"line_number":804,"context_line":"            models.TaskExecution).update_on_match(specimen\u003dspecimen,"},{"line_number":805,"context_line":"                                                  surrogate_key\u003d\u0027id\u0027,"},{"line_number":806,"context_line":"                                                  values\u003dvalues)"},{"line_number":807,"context_line":"        return True"},{"line_number":808,"context_line":""},{"line_number":809,"context_line":"    except oslo_sqlalchemy.update_match.NoRowsMatched as e:"},{"line_number":810,"context_line":"        LOG.debug("}],"source_content_type":"text/x-python","patch_set":3,"id":"9a8ffd7b_e13cf6e2","line":807,"updated":"2015-12-02 20:11:07.000000000","message":"Any special reason why not to return 1 instead of True?\nWe strive that all DB API layer will have consistent behavior - for example, all \"update_on_match\" operations will return the number of updated rows.","commit_id":"19db9efaa1ba15be8e26613b49af1f39bae0516d"}],"mistral/engine/default_engine.py":[{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"bfdfe37d621c6f629c62f0e9efefbc1df5ada62e","unresolved":false,"context_lines":[{"line_number":242,"context_line":""},{"line_number":243,"context_line":"                # If workflow is on pause or completed then there\u0027s no"},{"line_number":244,"context_line":"                # need to continue workflow."},{"line_number":245,"context_line":"                if not result and states.is_paused_or_completed(wf_ex.state):"},{"line_number":246,"context_line":"                    return action_ex.get_clone()"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"            if result:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_630973dd","line":245,"updated":"2015-11-30 21:03:09.000000000","message":"Please clarify why we are checking if there is result here and in the DB transactions below.","commit_id":"863ba65f88531c8f1c0622df12a8eb6d38aacdc2"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"1a419d4f4e8fe34cdb5ec66ddf4afbe31965bf0a","unresolved":false,"context_lines":[{"line_number":242,"context_line":""},{"line_number":243,"context_line":"                # If workflow is on pause or completed then there\u0027s no"},{"line_number":244,"context_line":"                # need to continue workflow."},{"line_number":245,"context_line":"                if not result and states.is_paused_or_completed(wf_ex.state):"},{"line_number":246,"context_line":"                    return action_ex.get_clone()"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"            if result:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_dbe7bbaa","line":245,"in_reply_to":"9a8ffd7b_630973dd","updated":"2015-12-01 14:04:49.000000000","message":"Here we are checking if result is None. If so, it means action was already completed. In such case, if workflow is completed, there is nothing else to process, so we call return.\n\nIn the next line, we check if result is not None, because only if state of action has just changed it make sense to check if whole task has ended","commit_id":"863ba65f88531c8f1c0622df12a8eb6d38aacdc2"}],"mistral/engine/task_handler.py":[{"author":{"_account_id":9029,"name":"Moshe Elisha","email":"moshe.elisha@nokia.com","username":"MosheElisha"},"change_message_id":"c36f23173dc639f5a28a64b66e3f059ec1e839b6","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        task_state_info \u003d result.error"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    if not task_spec.get_with_items():"},{"line_number":198,"context_line":"        _complete_task(task_ex, task_spec, task_state, task_state_info)"},{"line_number":199,"context_line":"    else:"},{"line_number":200,"context_line":"        with_items.increase_capacity(task_ex)"},{"line_number":201,"context_line":"        res \u003d _complete_task("}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_29e60145","line":198,"updated":"2015-11-30 14:30:54.000000000","message":"I think you are missing \"res \u003d \" here...","commit_id":"19ace7ebe988ec113a5d050f336334f5e8ce2704"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"bfdfe37d621c6f629c62f0e9efefbc1df5ada62e","unresolved":false,"context_lines":[{"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, None"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    result \u003d action_handler.transform_result(result, task_ex)"},{"line_number":173,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_c024d5c7","line":170,"updated":"2015-11-30 21:03:09.000000000","message":"How come return None for result here? Is this task result or action execution result?","commit_id":"863ba65f88531c8f1c0622df12a8eb6d38aacdc2"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"1a419d4f4e8fe34cdb5ec66ddf4afbe31965bf0a","unresolved":false,"context_lines":[{"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, None"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    result \u003d action_handler.transform_result(result, task_ex)"},{"line_number":173,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_5bc8ab74","line":170,"in_reply_to":"9a8ffd7b_c024d5c7","updated":"2015-12-01 14:04:49.000000000","message":"This is action execution result. Since task_ex is not used, I will delete it and only return result in next patch. In this case, result wouldn\u0027t be returned, because action is already completed.","commit_id":"863ba65f88531c8f1c0622df12a8eb6d38aacdc2"},{"author":{"_account_id":9029,"name":"Moshe Elisha","email":"moshe.elisha@nokia.com","username":"MosheElisha"},"change_message_id":"7f5654fa4f57c66488b24cbe5c087b41bedb1c1c","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        res \u003d _complete_task(task_ex, task_spec, task_state, task_state_info)"},{"line_number":199,"context_line":"    else:"},{"line_number":200,"context_line":"        with_items.increase_capacity(task_ex)"},{"line_number":201,"context_line":"        res \u003d _complete_task("},{"line_number":202,"context_line":"            task_ex,"},{"line_number":203,"context_line":"            task_spec,"},{"line_number":204,"context_line":"            with_items.get_final_state(task_ex),"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_93fd8a70","line":201,"updated":"2015-12-01 17:57:57.000000000","message":"You have removed \"if with_items.is_completed(task_ex):\" - this causes a bug that the task will go to SUCCESS before all with-items action executions are completed and the workflow execution will stay in RUNNING","commit_id":"863ba65f88531c8f1c0622df12a8eb6d38aacdc2"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"bfdfe37d621c6f629c62f0e9efefbc1df5ada62e","unresolved":false,"context_lines":[{"line_number":526,"context_line":"    # TODO(rakhmerov): How do we log task result?"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    if state !\u003d states.ERROR:"},{"line_number":529,"context_line":"        res \u003d db_api.update_task_where({\"state\": state},"},{"line_number":530,"context_line":"                                       state\u003dstates.RUNNING,"},{"line_number":531,"context_line":"                                       id\u003dtask_ex.id)"},{"line_number":532,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_e30fa32c","line":529,"updated":"2015-11-30 21:03:09.000000000","message":"Don\u0027t we want state_info to be updated together with state? What if the state doesn\u0027t match in the filter and the state is not updated?  The state_info updated below will not be in sync with the actual state.","commit_id":"863ba65f88531c8f1c0622df12a8eb6d38aacdc2"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"1a419d4f4e8fe34cdb5ec66ddf4afbe31965bf0a","unresolved":false,"context_lines":[{"line_number":526,"context_line":"    # TODO(rakhmerov): How do we log task result?"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    if state !\u003d states.ERROR:"},{"line_number":529,"context_line":"        res \u003d db_api.update_task_where({\"state\": state},"},{"line_number":530,"context_line":"                                       state\u003dstates.RUNNING,"},{"line_number":531,"context_line":"                                       id\u003dtask_ex.id)"},{"line_number":532,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a8ffd7b_1bb6a3dc","line":529,"in_reply_to":"9a8ffd7b_e30fa32c","updated":"2015-12-01 14:04:49.000000000","message":"You are right. I\u0027ll fix it in next patch","commit_id":"863ba65f88531c8f1c0622df12a8eb6d38aacdc2"},{"author":{"_account_id":9029,"name":"Moshe Elisha","email":"moshe.elisha@nokia.com","username":"MosheElisha"},"change_message_id":"7d73e79062f004d94fb49dc45a48bf7b810300b6","unresolved":false,"context_lines":[{"line_number":548,"context_line":"        )"},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"        if state_info:"},{"line_number":551,"context_line":"            task_ex.state_info \u003d state_info"},{"line_number":552,"context_line":"    return res"},{"line_number":553,"context_line":""},{"line_number":554,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a8ffd7b_7bbe54af","line":551,"updated":"2015-12-03 09:48:32.000000000","message":"Please add a new line before return","commit_id":"19db9efaa1ba15be8e26613b49af1f39bae0516d"}]}
