)]}'
{"mistral/api/controllers/v2/action.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"911bf6b80e31fd9779fa887f32bbf7b09a5b1859","unresolved":false,"context_lines":[{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"@rest_utils.retry"},{"line_number":40,"context_line":"def _update_actions(definition, identifier, scope):"},{"line_number":41,"context_line":"    with db_api.transaction():"},{"line_number":42,"context_line":"        db_acts \u003d actions.update_actions("},{"line_number":43,"context_line":"            definition,"},{"line_number":44,"context_line":"            scope\u003dscope,"},{"line_number":45,"context_line":"            identifier\u003didentifier"},{"line_number":46,"context_line":"        )"},{"line_number":47,"context_line":"    return db_acts"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"@rest_utils.retry"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_dfd74dbf","line":47,"range":{"start_line":39,"start_character":0,"end_line":47,"end_character":18},"updated":"2018-01-12 08:23:59.000000000","message":"I\u0027d suggest that don\u0027t have separate methods in the API controller files and add retry decorator right to the methods of the corresponding services like \"actions.update_actions\". The only change I think we need to make is to either move transaction control to these methods or have an parameter that says if the transaction was already open by a caller so that we don\u0027t try to start a new one.\n\nWhat do you think?","commit_id":"e71fbb6765d498e8b48344228dcec085be9cccb6"},{"author":{"_account_id":21970,"name":"Andras Kovi","email":"akovi@nokia.com","username":"andras.kovi"},"change_message_id":"afbe0c43f80321445401e4cf87e61853fd295357","unresolved":false,"context_lines":[{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"@rest_utils.retry"},{"line_number":40,"context_line":"def _update_actions(definition, identifier, scope):"},{"line_number":41,"context_line":"    with db_api.transaction():"},{"line_number":42,"context_line":"        db_acts \u003d actions.update_actions("},{"line_number":43,"context_line":"            definition,"},{"line_number":44,"context_line":"            scope\u003dscope,"},{"line_number":45,"context_line":"            identifier\u003didentifier"},{"line_number":46,"context_line":"        )"},{"line_number":47,"context_line":"    return db_acts"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"@rest_utils.retry"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_a1cb3b51","line":47,"range":{"start_line":39,"start_character":0,"end_line":47,"end_character":18},"in_reply_to":"7f96bb07_dad99883","updated":"2018-01-12 13:30:34.000000000","message":"It depends on whether those service functions are called from other modules where the MistralError is not desired. I\u0027ll try to rearrange the code this way. It will surely simplify in many places.","commit_id":"e71fbb6765d498e8b48344228dcec085be9cccb6"},{"author":{"_account_id":21970,"name":"Andras Kovi","email":"akovi@nokia.com","username":"andras.kovi"},"change_message_id":"14879ffd0baa246cf7997448f8f309c075384f40","unresolved":false,"context_lines":[{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"@rest_utils.retry"},{"line_number":40,"context_line":"def _update_actions(definition, identifier, scope):"},{"line_number":41,"context_line":"    with db_api.transaction():"},{"line_number":42,"context_line":"        db_acts \u003d actions.update_actions("},{"line_number":43,"context_line":"            definition,"},{"line_number":44,"context_line":"            scope\u003dscope,"},{"line_number":45,"context_line":"            identifier\u003didentifier"},{"line_number":46,"context_line":"        )"},{"line_number":47,"context_line":"    return db_acts"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"@rest_utils.retry"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_ea85a5ae","line":47,"range":{"start_line":39,"start_character":0,"end_line":47,"end_character":18},"in_reply_to":"7f96bb07_dfd74dbf","updated":"2018-01-12 08:41:11.000000000","message":"Unfortunately, I don\u0027t think we can do this. The reason is that the transaction must be started in the retry loop. If it is started outside, then all retries will fail with the aborted transaction.","commit_id":"e71fbb6765d498e8b48344228dcec085be9cccb6"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0d9ecc127c0be4243287299fa6083457e82de7af","unresolved":false,"context_lines":[{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"@rest_utils.retry"},{"line_number":40,"context_line":"def _update_actions(definition, identifier, scope):"},{"line_number":41,"context_line":"    with db_api.transaction():"},{"line_number":42,"context_line":"        db_acts \u003d actions.update_actions("},{"line_number":43,"context_line":"            definition,"},{"line_number":44,"context_line":"            scope\u003dscope,"},{"line_number":45,"context_line":"            identifier\u003didentifier"},{"line_number":46,"context_line":"        )"},{"line_number":47,"context_line":"    return db_acts"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"@rest_utils.retry"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_dad99883","line":47,"range":{"start_line":39,"start_character":0,"end_line":47,"end_character":18},"in_reply_to":"7f96bb07_ea85a5ae","updated":"2018-01-12 10:09:09.000000000","message":"Yes. But then what if we always include transactions into those methods? Is it doable? Essentially, what I\u0027d like to see is 1) some similarity across controllers although I understand that we process different entity types differently 2) Keep controllers relatively thin. 3) Use less utility modules and places. If we already use \u0027services\u0027 I thought may be we need to put more things there, if needed.","commit_id":"e71fbb6765d498e8b48344228dcec085be9cccb6"}],"mistral/api/controllers/v2/task.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"01be6b9186595d899ac8578d8411e1fca6ea2f33","unresolved":false,"context_lines":[{"line_number":274,"context_line":""},{"line_number":275,"context_line":"                return env, reset, task_ex, task_spec, wf_ex"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        env, reset, task_ex, task_spec, wf_ex \u003d _read_task_params(id, task)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        wf_name \u003d task.workflow_name or None"},{"line_number":280,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"bf659307_6af420d0","line":277,"range":{"start_line":277,"start_character":8,"end_line":277,"end_character":45},"updated":"2018-03-27 08:52:44.000000000","message":":)","commit_id":"f0b51965664a51881c294e3455290ca9abd4054c"},{"author":{"_account_id":21970,"name":"Andras Kovi","email":"akovi@nokia.com","username":"andras.kovi"},"change_message_id":"36ee75cfcc5b9fb23b9647235e8525d9fa1d4744","unresolved":false,"context_lines":[{"line_number":274,"context_line":""},{"line_number":275,"context_line":"                return env, reset, task_ex, task_spec, wf_ex"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        env, reset, task_ex, task_spec, wf_ex \u003d _read_task_params(id, task)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        wf_name \u003d task.workflow_name or None"},{"line_number":280,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"bf659307_a05a5727","line":277,"range":{"start_line":277,"start_character":8,"end_line":277,"end_character":45},"in_reply_to":"bf659307_6af420d0","updated":"2018-03-27 09:33:46.000000000","message":"Oh, yeah. Refactoring tools help making wonders easy.","commit_id":"f0b51965664a51881c294e3455290ca9abd4054c"}],"mistral/utils/rest_utils.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"01be6b9186595d899ac8578d8411e1fca6ea2f33","unresolved":false,"context_lines":[{"line_number":263,"context_line":"    )"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"def rest_retry_on_db_error(func):"},{"line_number":267,"context_line":"    return db_utils.retry_on_db_error(func, create_db_retry_object())"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf659307_aab9d8e9","line":266,"range":{"start_line":266,"start_character":4,"end_line":266,"end_character":9},"updated":"2018-03-27 08:52:44.000000000","message":"Soft: Maybe \"rest_\" is redundant here because it\u0027s already in the REST related module.","commit_id":"f0b51965664a51881c294e3455290ca9abd4054c"},{"author":{"_account_id":21970,"name":"Andras Kovi","email":"akovi@nokia.com","username":"andras.kovi"},"change_message_id":"36ee75cfcc5b9fb23b9647235e8525d9fa1d4744","unresolved":false,"context_lines":[{"line_number":263,"context_line":"    )"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"def rest_retry_on_db_error(func):"},{"line_number":267,"context_line":"    return db_utils.retry_on_db_error(func, create_db_retry_object())"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf659307_20188773","line":266,"range":{"start_line":266,"start_character":4,"end_line":266,"end_character":9},"in_reply_to":"bf659307_aab9d8e9","updated":"2018-03-27 09:33:46.000000000","message":"retry_on_db_error already exists so I thought it would be better identified this way. We can rename it, I have no strong feelings.","commit_id":"f0b51965664a51881c294e3455290ca9abd4054c"}]}
