)]}'
{"mistral/engine/workflow_handler.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"b8cdfa2e0512eafa2363575efbce0932a66e46c3","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        try:"},{"line_number":105,"context_line":"            check_and_fix_integrity(wf_ex)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"            num_incomplete_tasks \u003d wf.check_and_complete()"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"            if not states.is_completed(wf_ex.state):"},{"line_number":110,"context_line":"                delay \u003d ("},{"line_number":111,"context_line":"                    2 + int(num_incomplete_tasks * 0.1) if num_incomplete_tasks"},{"line_number":112,"context_line":"                    else 4"},{"line_number":113,"context_line":"                )"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"                _schedule_check_and_complete(wf_ex, delay)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        except exc.MistralException as e:"},{"line_number":118,"context_line":"            msg \u003d ("}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa0c359_bdb5ed33","line":115,"range":{"start_line":107,"start_character":12,"end_line":115,"end_character":58},"updated":"2018-02-26 10:50:04.000000000","message":"This is OK except it may not be clear why we do so if you just look at this code and don\u0027t know about any retrying decorator. Maybe I would just add a small comment here to make it clear. Something like \"we can\u0027t put rescheduling logic under \u0027finally\u0027 as it\u0027s usually done in most cases because if a DB error occurs then the DB transaction becomes invalid and can\u0027t be used. We put it here and let the retrying decorator take care of retrying the operation\". It\u0027s not too short but maybe you can come up with a shorter/better version.\n\nPlaces like this are always tricky to understand, I\u0027d leave a comment.","commit_id":"1ef7ab07d03b6aab209c14f9795947cff7fa208b"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"5e0b9c217ea26d6573431223bf9e88d49f051212","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":"            if not states.is_completed(wf_ex.state):"},{"line_number":110,"context_line":"                delay \u003d ("},{"line_number":111,"context_line":"                    2 + int(num_incomplete_tasks * 0.1) if num_incomplete_tasks"},{"line_number":112,"context_line":"                    else 4"},{"line_number":113,"context_line":"                )"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_235f310f","line":111,"range":{"start_line":111,"start_character":51,"end_line":111,"end_character":54},"updated":"2018-03-09 15:58:20.000000000","message":"previously it was 0.01. Probably if the number of incomplete task is big, the delay can be too long.","commit_id":"29338735386d310d3175d9b917f78b46d7d54b68"},{"author":{"_account_id":21970,"name":"Andras Kovi","email":"akovi@nokia.com","username":"andras.kovi"},"change_message_id":"655ae12d68f8ca26100ca300941a9e8dce94428d","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":"            if not states.is_completed(wf_ex.state):"},{"line_number":110,"context_line":"                delay \u003d ("},{"line_number":111,"context_line":"                    2 + int(num_incomplete_tasks * 0.1) if num_incomplete_tasks"},{"line_number":112,"context_line":"                    else 4"},{"line_number":113,"context_line":"                )"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_34468951","line":111,"range":{"start_line":111,"start_character":51,"end_line":111,"end_character":54},"in_reply_to":"df7087c5_19acde32","updated":"2018-03-09 18:10:18.000000000","message":"Unfortunately, the existence of this code is purely necessary because under some circumstances the \u0027house keeping\u0027 functions are not done correctly in the engine. That is, it may happen that all tasks of a WF are completed but the WF\u0027s state is not advanced. The original time was practically negligible even for high task numbers. This integrity checker is started for every  workflow execution. Now, imagine what happens if these are executed in parallel with zero delay in each iteration. Simple DoS attack from the inside. :)\nYes, raising this number can result in longer execution times but this is already a cure for a much bigger disease that some workflows may never finish. Let\u0027s hope we can get rid of it once.","commit_id":"29338735386d310d3175d9b917f78b46d7d54b68"},{"author":{"_account_id":21970,"name":"Andras Kovi","email":"akovi@nokia.com","username":"andras.kovi"},"change_message_id":"19c5bdab4a80005787baec7d98f2fd5a8b87b144","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":"            if not states.is_completed(wf_ex.state):"},{"line_number":110,"context_line":"                delay \u003d ("},{"line_number":111,"context_line":"                    2 + int(num_incomplete_tasks * 0.1) if num_incomplete_tasks"},{"line_number":112,"context_line":"                    else 4"},{"line_number":113,"context_line":"                )"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_fee0f0ce","line":111,"range":{"start_line":111,"start_character":51,"end_line":111,"end_character":54},"in_reply_to":"df7087c5_235f310f","updated":"2018-03-09 16:44:29.000000000","message":"Well, if the number of tasks is big, then those already provide quite a bit of load. We can max this number but even with 300 parallel tasks, the delay would be 32 seconds. What would be a sane max in your opinion? Shouldn\u0027t we simply use some constant delay? This method is actually a safety net to restore the integrity of the model so I would make sure it is safe rather than fast.","commit_id":"29338735386d310d3175d9b917f78b46d7d54b68"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"21a26d3994c6fbe33b5765a864bad7d6e70c5637","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":"            if not states.is_completed(wf_ex.state):"},{"line_number":110,"context_line":"                delay \u003d ("},{"line_number":111,"context_line":"                    2 + int(num_incomplete_tasks * 0.1) if num_incomplete_tasks"},{"line_number":112,"context_line":"                    else 4"},{"line_number":113,"context_line":"                )"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_19acde32","line":111,"range":{"start_line":111,"start_character":51,"end_line":111,"end_character":54},"in_reply_to":"df7087c5_fee0f0ce","updated":"2018-03-09 17:49:27.000000000","message":"No, probably 0.1 is okay. I\u0027m just curious why you increased the previous constant by 10 times. Because it affects the execution process - 5 seconds vs 32 seconds delay is quite noticeable, isn\u0027t it?","commit_id":"29338735386d310d3175d9b917f78b46d7d54b68"}]}
