)]}'
{"oslo/db/api.py":[{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"7aaea53f41d56aebb8f0509231a16aa410e52688","unresolved":false,"context_lines":[{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def safe_for_db_retry(f):"},{"line_number":38,"context_line":"    \"\"\"Enable db-retry for decorated function, if config option enabled."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    If we enabled `use_db_reconnect` in config, wrap_db_retry will be"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_a0851e5a","line":37,"updated":"2014-07-28 13:21:31.000000000","message":"You can improve this decorator to reuse it for the both of cases. Add an extra wrapper with a retry case name argument.\n\n    def safe_for_db_retry(case_name):\n        def wrap(f):\n            setattr(f, case_name, True)\n            return f","commit_id":"09cd24a330ba439cff528706779bb4fa4a47360b"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"15669219be8ad38f4d1a63803e0c92937c7e5dad","unresolved":false,"context_lines":[{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def safe_for_db_retry(f):"},{"line_number":38,"context_line":"    \"\"\"Enable db-retry for decorated function, if config option enabled."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    If we enabled `use_db_reconnect` in config, wrap_db_retry will be"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_2da430a2","line":37,"in_reply_to":"baada198_a0851e5a","updated":"2014-08-07 11:50:35.000000000","message":"Thanks for the suggestion Ilya. This decorator is already used by various projects and the change you propose is not backward compatible. Do you feel strongly for it?","commit_id":"09cd24a330ba439cff528706779bb4fa4a47360b"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"7aaea53f41d56aebb8f0509231a16aa410e52688","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    decorator."},{"line_number":52,"context_line":"    \"\"\""},{"line_number":53,"context_line":"    f.__dict__[\u0027retry_on_deadlock\u0027] \u003d True"},{"line_number":54,"context_line":"    return f"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"class wrap_db_retry(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_752ca64a","line":54,"updated":"2014-07-28 13:21:31.000000000","message":"You can just do\n\n  f.retry_on_deadlock \u003d True\n\nIf you use different decorators for different cases (I don\u0027t like this way at all).","commit_id":"09cd24a330ba439cff528706779bb4fa4a47360b"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"15669219be8ad38f4d1a63803e0c92937c7e5dad","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    decorator."},{"line_number":52,"context_line":"    \"\"\""},{"line_number":53,"context_line":"    f.__dict__[\u0027retry_on_deadlock\u0027] \u003d True"},{"line_number":54,"context_line":"    return f"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"class wrap_db_retry(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_0dc04c2a","line":54,"in_reply_to":"baada198_752ca64a","updated":"2014-08-07 11:50:35.000000000","message":"I am doing the same as line 43","commit_id":"09cd24a330ba439cff528706779bb4fa4a47360b"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"7aaea53f41d56aebb8f0509231a16aa410e52688","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        # NOTE(vsergeyev): If `use_db_reconnect` option is set to True, retry"},{"line_number":168,"context_line":"        #                  DB API methods, decorated with @safe_for_db_retry"},{"line_number":169,"context_line":"        #                  on disconnect."},{"line_number":170,"context_line":"        if self.use_db_reconnect and hasattr(attr, \u0027enable_retry\u0027):"},{"line_number":171,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":172,"context_line":"                exception.DBConnectionError,"},{"line_number":173,"context_line":"                retry_interval\u003dself.retry_interval,"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_f55d1649","line":170,"updated":"2014-07-28 13:21:31.000000000","message":"Rename it with a more specific name, something like \u0027retry_on_interruption\u0027. This is required now, because we have several specific cases for retry.","commit_id":"09cd24a330ba439cff528706779bb4fa4a47360b"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"15669219be8ad38f4d1a63803e0c92937c7e5dad","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        # NOTE(vsergeyev): If `use_db_reconnect` option is set to True, retry"},{"line_number":168,"context_line":"        #                  DB API methods, decorated with @safe_for_db_retry"},{"line_number":169,"context_line":"        #                  on disconnect."},{"line_number":170,"context_line":"        if self.use_db_reconnect and hasattr(attr, \u0027enable_retry\u0027):"},{"line_number":171,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":172,"context_line":"                exception.DBConnectionError,"},{"line_number":173,"context_line":"                retry_interval\u003dself.retry_interval,"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_0d1cccc1","line":170,"in_reply_to":"baada198_f55d1649","updated":"2014-08-07 11:50:35.000000000","message":"Done","commit_id":"09cd24a330ba439cff528706779bb4fa4a47360b"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"7aaea53f41d56aebb8f0509231a16aa410e52688","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        #                  on disconnect."},{"line_number":170,"context_line":"        if self.use_db_reconnect and hasattr(attr, \u0027enable_retry\u0027):"},{"line_number":171,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":172,"context_line":"                exception.DBConnectionError,"},{"line_number":173,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":174,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":175,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_15728ae2","line":172,"updated":"2014-07-28 13:21:31.000000000","message":"Use a loop with a list of tuples, such as [(\u0027enable_retry\u0027, exception.DBConnectionError), (\u0027retry_on_deadlock\u0027, exception.DBDeadlock)]. This way is much more DRY.","commit_id":"09cd24a330ba439cff528706779bb4fa4a47360b"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"15669219be8ad38f4d1a63803e0c92937c7e5dad","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        #                  on disconnect."},{"line_number":170,"context_line":"        if self.use_db_reconnect and hasattr(attr, \u0027enable_retry\u0027):"},{"line_number":171,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":172,"context_line":"                exception.DBConnectionError,"},{"line_number":173,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":174,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":175,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_8d37fcfd","line":172,"in_reply_to":"baada198_15728ae2","updated":"2014-08-07 11:50:35.000000000","message":"Not sure what you are suggesting here. I\u0027d like not to use the same decorator for both case since this is not a backward compatible change.","commit_id":"09cd24a330ba439cff528706779bb4fa4a47360b"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"f2cc079014b313346594f232e05d73b9d10fd094","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        if hasattr(attr, \u0027retry_on_deadlock\u0027):"},{"line_number":179,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":180,"context_line":"                exception.DBDeadlock,"},{"line_number":181,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":182,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":183,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"},{"line_number":184,"context_line":"                max_retry_interval\u003dself.max_retry_interval)(attr)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_8e75e8cd","line":181,"updated":"2014-07-25 12:55:58.000000000","message":"I\u0027d like to ask for more opinions. Should the values for retry_interval, max_retries, inc_retry_interval, max_retry_interval be specified again for handling a DBDeadlock or it\u0027s ok to re-use those specified for a DB connection error?","commit_id":"09cd24a330ba439cff528706779bb4fa4a47360b"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"7aaea53f41d56aebb8f0509231a16aa410e52688","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        if hasattr(attr, \u0027retry_on_deadlock\u0027):"},{"line_number":179,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":180,"context_line":"                exception.DBDeadlock,"},{"line_number":181,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":182,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":183,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"},{"line_number":184,"context_line":"                max_retry_interval\u003dself.max_retry_interval)(attr)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_e040f607","line":181,"in_reply_to":"baada198_8e75e8cd","updated":"2014-07-28 13:21:31.000000000","message":"You can test it with real backends and draw your own conclusions.","commit_id":"09cd24a330ba439cff528706779bb4fa4a47360b"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"cc27b8fc53d3d70c7950585153bcd7b2b61d5ade","unresolved":false,"context_lines":[{"line_number":60,"context_line":"class wrap_db_retry(object):"},{"line_number":61,"context_line":"    \"\"\"Retry db.api methods, if db_error raised"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    Retry decorated db.api methods. This decorator catchs db_error and retries"},{"line_number":64,"context_line":"    function in a loop until it succeeds, or until maximum retries count"},{"line_number":65,"context_line":"    will be reached."},{"line_number":66,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_b3cf6127","line":63,"updated":"2014-08-11 09:02:13.000000000","message":"typo: catches","commit_id":"fa92befc09bca73b340871f1de4907aaca6684e7"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"cc27b8fc53d3d70c7950585153bcd7b2b61d5ade","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        if hasattr(attr, \u0027retry_on_deadlock\u0027):"},{"line_number":187,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":188,"context_line":"                exception.DBDeadlock,"},{"line_number":189,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":190,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":191,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"},{"line_number":192,"context_line":"                max_retry_interval\u003dself.max_retry_interval)(attr)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_769db7ba","line":189,"updated":"2014-08-11 09:02:13.000000000","message":"I\u0027m not sure the values we use for reconnect are suitable for deadlocks too. Besides, if an operator changes them in the config file, he will also implicitly change the values used for retrying of DB API methods on deadlocks.\n\nAFAIK, this is already implemented in Nova like this: https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L199-L214 . Maybe we should use that approach? I.e. don\u0027t increment the retry interval, don\u0027t expose the configuration to an operator, retry indefinitely while we receive a deadlock.","commit_id":"fa92befc09bca73b340871f1de4907aaca6684e7"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"203ce3ff422408253dd9c9cef5cc6dc984ca5f61","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        if hasattr(attr, \u0027retry_on_deadlock\u0027):"},{"line_number":187,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":188,"context_line":"                exception.DBDeadlock,"},{"line_number":189,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":190,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":191,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"},{"line_number":192,"context_line":"                max_retry_interval\u003dself.max_retry_interval)(attr)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_c485e653","line":189,"in_reply_to":"baada198_2c4e9290","updated":"2014-08-11 12:56:21.000000000","message":"There is a comment here on March 17 from Dan Smith:\nhttps://review.openstack.org/66188\n\nDan Smith wrote:\n\"\"”I don\u0027t think that we want to fail potentially way too early here and probably cover up the evidence of what is competing for the lock that is causing the condition.\n\nIf we really block forever, then seeing _what_ timed out and what is logging tons of \"db deadlock...\" messages would be very helpful in tracking down the issue. Further, our recently-merged guru meditation reports are far more useful if things are stuck in a position than if they give up quickly.\n\nAn infinite db deadlock would be a huge problem and I\u0027d rather address or examine it if/when it happens than just fail aggressively and unblock things.\"\"\"","commit_id":"fa92befc09bca73b340871f1de4907aaca6684e7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b724e38abbb635d3117f8e4b45ad5e3b6d6665f8","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        if hasattr(attr, \u0027retry_on_deadlock\u0027):"},{"line_number":187,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":188,"context_line":"                exception.DBDeadlock,"},{"line_number":189,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":190,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":191,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"},{"line_number":192,"context_line":"                max_retry_interval\u003dself.max_retry_interval)(attr)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_2c4e9290","line":189,"in_reply_to":"baada198_769db7ba","updated":"2014-08-11 10:03:32.000000000","message":"Thanks Roman!\nI am OK with not exposing the configuration to the operator. The only concern that I have is that retry indefinitely could lead to an infinite loop, there\u0027s already a bug filed for that in nova https://bugs.launchpad.net/nova/+bug/1268895 . I think we can hard code a max_retries value.\nI will wait a bit for another opinions and then I am gonna address the suggestion.","commit_id":"fa92befc09bca73b340871f1de4907aaca6684e7"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"3c2c7305cacd351e2bdaca489cf24af235118911","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    If we enabled `use_db_reconnect` in config, wrap_db_retry will be"},{"line_number":44,"context_line":"    applied to all db.api functions, marked with this decorator."},{"line_number":45,"context_line":"    \"\"\""},{"line_number":46,"context_line":"    f.__dict__[\u0027enable_retry_on_disconnect\u0027] \u003d True"},{"line_number":47,"context_line":"    return f"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_21e8147e","line":46,"updated":"2014-08-12 19:57:52.000000000","message":"I know this imitates how the code already was, but I\u0027m not sure what the purpose of `f.__dict__[\u0027arg\u0027] \u003d value` is, as opposed to `f.arg \u003d value`.   I\u0027d be in favor of removing the `__dict__` access unless someone knows what the rationale is for that.","commit_id":"5498993ecb72e547083221591f7c4ae41a4ff2a5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"aea3e60f649a515f9edebc3bb81c8c3484da0a78","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    If we enabled `use_db_reconnect` in config, wrap_db_retry will be"},{"line_number":44,"context_line":"    applied to all db.api functions, marked with this decorator."},{"line_number":45,"context_line":"    \"\"\""},{"line_number":46,"context_line":"    f.__dict__[\u0027enable_retry_on_disconnect\u0027] \u003d True"},{"line_number":47,"context_line":"    return f"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_e8789ff9","line":46,"in_reply_to":"baada198_21e8147e","updated":"2014-08-13 10:43:56.000000000","message":"Done","commit_id":"5498993ecb72e547083221591f7c4ae41a4ff2a5"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"3c2c7305cacd351e2bdaca489cf24af235118911","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    wrap_db_entry will be applied to all db.api functions marked with this"},{"line_number":54,"context_line":"    decorator."},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    f.__dict__[\u0027retry_on_deadlock\u0027] \u003d True"},{"line_number":57,"context_line":"    return f"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_a1fb4448","line":56,"updated":"2014-08-12 19:57:52.000000000","message":"consistent naming - \"enable_retry_on_deadlock\"","commit_id":"5498993ecb72e547083221591f7c4ae41a4ff2a5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"aea3e60f649a515f9edebc3bb81c8c3484da0a78","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    wrap_db_entry will be applied to all db.api functions marked with this"},{"line_number":54,"context_line":"    decorator."},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    f.__dict__[\u0027retry_on_deadlock\u0027] \u003d True"},{"line_number":57,"context_line":"    return f"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_5d4b0bb2","line":56,"in_reply_to":"baada198_a1fb4448","updated":"2014-08-13 10:43:56.000000000","message":"Done","commit_id":"5498993ecb72e547083221591f7c4ae41a4ff2a5"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"3c2c7305cacd351e2bdaca489cf24af235118911","unresolved":false,"context_lines":[{"line_number":70,"context_line":"                 inc_retry_interval\u003dNone, max_retry_interval\u003dNone):"},{"line_number":71,"context_line":"        super(wrap_db_retry, self).__init__()"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        self.db_error \u003d db_error"},{"line_number":74,"context_line":"        self.retry_interval \u003d retry_interval"},{"line_number":75,"context_line":"        self.max_retries \u003d max_retries"},{"line_number":76,"context_line":"        self.inc_retry_interval \u003d inc_retry_interval"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_61b04c8e","line":73,"updated":"2014-08-12 19:57:52.000000000","message":"why don\u0027t we do this:\n\n\tdb_error \u003d ()\n\tif retry_on_disconnect:\n\t   db_error +\u003d (DBConnectionError, )\n\tif retry_on_deadlock:\n\t   db_error+\u003d (DBDeadlock, )\n\nthen add retry_on_disconnect, retry_on_deadlock as kw flags (or similar) here, then we only need one decorator.","commit_id":"5498993ecb72e547083221591f7c4ae41a4ff2a5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"aea3e60f649a515f9edebc3bb81c8c3484da0a78","unresolved":false,"context_lines":[{"line_number":70,"context_line":"                 inc_retry_interval\u003dNone, max_retry_interval\u003dNone):"},{"line_number":71,"context_line":"        super(wrap_db_retry, self).__init__()"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        self.db_error \u003d db_error"},{"line_number":74,"context_line":"        self.retry_interval \u003d retry_interval"},{"line_number":75,"context_line":"        self.max_retries \u003d max_retries"},{"line_number":76,"context_line":"        self.inc_retry_interval \u003d inc_retry_interval"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_0e04fb12","line":73,"in_reply_to":"baada198_61b04c8e","updated":"2014-08-13 10:43:56.000000000","message":"Thanks, nice suggestion","commit_id":"5498993ecb72e547083221591f7c4ae41a4ff2a5"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"3c2c7305cacd351e2bdaca489cf24af235118911","unresolved":false,"context_lines":[{"line_number":91,"context_line":"                    if self.max_retries:"},{"line_number":92,"context_line":"                        if remaining \u003d\u003d 0:"},{"line_number":93,"context_line":"                            LOG.exception(_LE(\u0027DB exceeded retry limit.\u0027))"},{"line_number":94,"context_line":"                            raise exception.DBError(e)"},{"line_number":95,"context_line":"                        if remaining !\u003d -1:"},{"line_number":96,"context_line":"                            remaining -\u003d 1"},{"line_number":97,"context_line":"                    LOG.exception(_LE(\u0027DB error.\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_2c956b94","line":94,"updated":"2014-08-12 19:57:52.000000000","message":"i think we should raise \"e\" directly here.  Changing it into something more generic (but in the same hierarchy) seems wrong.","commit_id":"5498993ecb72e547083221591f7c4ae41a4ff2a5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"aea3e60f649a515f9edebc3bb81c8c3484da0a78","unresolved":false,"context_lines":[{"line_number":91,"context_line":"                    if self.max_retries:"},{"line_number":92,"context_line":"                        if remaining \u003d\u003d 0:"},{"line_number":93,"context_line":"                            LOG.exception(_LE(\u0027DB exceeded retry limit.\u0027))"},{"line_number":94,"context_line":"                            raise exception.DBError(e)"},{"line_number":95,"context_line":"                        if remaining !\u003d -1:"},{"line_number":96,"context_line":"                            remaining -\u003d 1"},{"line_number":97,"context_line":"                    LOG.exception(_LE(\u0027DB error.\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_c89bdb77","line":94,"in_reply_to":"baada198_2c956b94","updated":"2014-08-13 10:43:56.000000000","message":"That\u0027s what the code was doing before but I agree with you. Done!","commit_id":"5498993ecb72e547083221591f7c4ae41a4ff2a5"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"3c2c7305cacd351e2bdaca489cf24af235118911","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":186,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"},{"line_number":187,"context_line":"                max_retry_interval\u003dself.max_retry_interval)(attr)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        if hasattr(attr, \u0027retry_on_deadlock\u0027):"},{"line_number":190,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":191,"context_line":"                exception.DBDeadlock,"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_21449475","line":188,"updated":"2014-08-12 19:57:52.000000000","message":"then down here:\n\n    retry_on_disconnect \u003d self.use_db_reconnect and getattr(attr, \u0027enable_retry_on_disconnect\u0027, False)\n    retry_on_deadlock \u003d getattr(attr, \u0027enable_retry_on_deadlock\u0027, False)\n\n    if retry_on_disconnect or retry_on_deadlock:\n        attr \u003d wrap_db_retry(...., retry_on_disconnect\u003dretry_on_disconnect, retry_on_deadlock\u003dretry_on_deadlock)(attr)","commit_id":"5498993ecb72e547083221591f7c4ae41a4ff2a5"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"f4288245d7291faaaab55862ebba0ca25a5ff27f","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    :param f: database api method."},{"line_number":55,"context_line":"    :type f: function."},{"line_number":56,"context_line":"    \"\"\""},{"line_number":57,"context_line":"    f.__dict__[\u0027enable_retry\u0027] \u003d True"},{"line_number":58,"context_line":"    return f"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_f2f534ed","side":"PARENT","line":57,"updated":"2014-08-22 12:56:12.000000000","message":"__dict__ magic was used to be able to set attributes to the class methods. I think, that there is a sense to leave it here.\n\nSee an example:\n\n class A(object):\n     def hi(self):\n     print \"hi\"\n\n a \u003d A()\n a.hi()  # prints \"hi\"\n\n a.hi.enable_retry_on_disconnect \u003d True\n Traceback (most recent call last):\n   File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n AttributeError: \u0027instancemethod\u0027 object has no attribute \u0027enable_retry_on_disconnect\u0027","commit_id":"69f16bf8b1e9f7ccf5191b40008e81a793ee85f6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a6021634232a2dd89f5503d949b6218acd55b7df","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    :param f: database api method."},{"line_number":55,"context_line":"    :type f: function."},{"line_number":56,"context_line":"    \"\"\""},{"line_number":57,"context_line":"    f.__dict__[\u0027enable_retry\u0027] \u003d True"},{"line_number":58,"context_line":"    return f"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_ff2394a4","side":"PARENT","line":57,"in_reply_to":"1abeadc6_f2f534ed","updated":"2014-08-27 16:57:24.000000000","message":"Done","commit_id":"69f16bf8b1e9f7ccf5191b40008e81a793ee85f6"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"f4288245d7291faaaab55862ebba0ca25a5ff27f","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    Keyword arguments:"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    :param retry_interval: seconds between transaction retries"},{"line_number":73,"context_line":"    :type retry_interval: int"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    :param max_retries: max number of retries before an error is raised"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_525428c9","side":"PARENT","line":72,"updated":"2014-08-22 12:56:12.000000000","message":"why do you remove the arguments documentation?","commit_id":"69f16bf8b1e9f7ccf5191b40008e81a793ee85f6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a6021634232a2dd89f5503d949b6218acd55b7df","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    Keyword arguments:"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    :param retry_interval: seconds between transaction retries"},{"line_number":73,"context_line":"    :type retry_interval: int"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    :param max_retries: max number of retries before an error is raised"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_7fa86477","side":"PARENT","line":72,"in_reply_to":"1abeadc6_525428c9","updated":"2014-08-27 16:57:24.000000000","message":"Done","commit_id":"69f16bf8b1e9f7ccf5191b40008e81a793ee85f6"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"cbe39601095eab9a8b57bde7d93a5dc3fced64a6","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                 max_retry_interval, retry_on_disconnect, retry_on_deadlock):"},{"line_number":70,"context_line":"        super(wrap_db_retry, self).__init__()"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        self.db_error \u003d ()"},{"line_number":73,"context_line":"        if retry_on_disconnect:"},{"line_number":74,"context_line":"            self.db_error +\u003d (exception.DBConnectionError, )"},{"line_number":75,"context_line":"        if retry_on_deadlock:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_da3a6e97","line":72,"updated":"2014-08-27 14:15:03.000000000","message":"nit: If you plan to change this object, better use list and list.append.","commit_id":"b3b5a50c32af906a1bdeead57ad80d1cd3632196"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"86a03444cd2b772375ecb34aeab143e93527d930","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                 max_retry_interval, retry_on_disconnect, retry_on_deadlock):"},{"line_number":70,"context_line":"        super(wrap_db_retry, self).__init__()"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        self.db_error \u003d ()"},{"line_number":73,"context_line":"        if retry_on_disconnect:"},{"line_number":74,"context_line":"            self.db_error +\u003d (exception.DBConnectionError, )"},{"line_number":75,"context_line":"        if retry_on_deadlock:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_a30bcad4","line":72,"in_reply_to":"1abeadc6_638a9265","updated":"2014-08-27 17:01:38.000000000","message":"I agree.","commit_id":"b3b5a50c32af906a1bdeead57ad80d1cd3632196"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"63fc9a3a883dd51f676df5b862002d070d086f88","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                 max_retry_interval, retry_on_disconnect, retry_on_deadlock):"},{"line_number":70,"context_line":"        super(wrap_db_retry, self).__init__()"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        self.db_error \u003d ()"},{"line_number":73,"context_line":"        if retry_on_disconnect:"},{"line_number":74,"context_line":"            self.db_error +\u003d (exception.DBConnectionError, )"},{"line_number":75,"context_line":"        if retry_on_deadlock:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_638a9265","line":72,"in_reply_to":"1abeadc6_da3a6e97","updated":"2014-08-27 16:58:00.000000000","message":"I prefer the tuple, it\u0027s more common to say \"except (A, B)\" rather than \"except [A, B]\".","commit_id":"b3b5a50c32af906a1bdeead57ad80d1cd3632196"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"f4288245d7291faaaab55862ebba0ca25a5ff27f","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        if retry_on_disconnect or retry_on_deadlock:"},{"line_number":186,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":187,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":188,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":189,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"},{"line_number":190,"context_line":"                max_retry_interval\u003dself.max_retry_interval,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_f2b614f8","line":187,"updated":"2014-08-22 12:56:12.000000000","message":"suggestion: it\u0027s looks strange for me, that we use same config options for db-api retry and from deadlock retry. i think, we should, either specify this in config option description or use different config options.","commit_id":"b3b5a50c32af906a1bdeead57ad80d1cd3632196"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"f46f9b6c63efd598a3c35481225a9a1d1d21b219","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        if retry_on_disconnect or retry_on_deadlock:"},{"line_number":186,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":187,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":188,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":189,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"},{"line_number":190,"context_line":"                max_retry_interval\u003dself.max_retry_interval,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_c1f9874f","line":187,"in_reply_to":"1abeadc6_03c55e8d","updated":"2014-08-28 09:25:32.000000000","message":"Did you determine, where are the decorators used, except `wrap_db_retry`? I mean, are you sure that this change can cause incompatibility. Because if it doesn\u0027t, we should prefer better style.","commit_id":"b3b5a50c32af906a1bdeead57ad80d1cd3632196"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"86a03444cd2b772375ecb34aeab143e93527d930","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        if retry_on_disconnect or retry_on_deadlock:"},{"line_number":186,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":187,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":188,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":189,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"},{"line_number":190,"context_line":"                max_retry_interval\u003dself.max_retry_interval,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_e3b6a2f8","line":187,"in_reply_to":"1abeadc6_43bbd60e","updated":"2014-08-27 17:01:38.000000000","message":"Yes I think it\u0027s better to keep it for backward compatibility.","commit_id":"b3b5a50c32af906a1bdeead57ad80d1cd3632196"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a6021634232a2dd89f5503d949b6218acd55b7df","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        if retry_on_disconnect or retry_on_deadlock:"},{"line_number":186,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":187,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":188,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":189,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"},{"line_number":190,"context_line":"                max_retry_interval\u003dself.max_retry_interval,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_bf2e7cf8","line":187,"in_reply_to":"1abeadc6_5af3be9e","updated":"2014-08-27 16:57:24.000000000","message":"Not sure if this would make things more clear","commit_id":"b3b5a50c32af906a1bdeead57ad80d1cd3632196"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"63fc9a3a883dd51f676df5b862002d070d086f88","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        if retry_on_disconnect or retry_on_deadlock:"},{"line_number":186,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":187,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":188,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":189,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"},{"line_number":190,"context_line":"                max_retry_interval\u003dself.max_retry_interval,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_43bbd60e","line":187,"in_reply_to":"1abeadc6_5af3be9e","updated":"2014-08-27 16:58:00.000000000","message":"yeah, wrap_db_retry() can be used directly, we don\u0027t actually need safe_for_db_retry, retry_on_deadlock, except for perhaps backwards compatibility.","commit_id":"b3b5a50c32af906a1bdeead57ad80d1cd3632196"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"cbe39601095eab9a8b57bde7d93a5dc3fced64a6","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        if retry_on_disconnect or retry_on_deadlock:"},{"line_number":186,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":187,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":188,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":189,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"},{"line_number":190,"context_line":"                max_retry_interval\u003dself.max_retry_interval,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_5af3be9e","line":187,"in_reply_to":"1abeadc6_f2b614f8","updated":"2014-08-27 14:15:03.000000000","message":"Furthermore it seems to me like the single decorator, which can be used with different arguments. I think we should optimize this two decorators into the single decorator and name it such as `sefe_for_db_retry_on` and use it like:\n\n    @safe_for_db_retry_on(\u0027disconnect\u0027, \u0027deadlock\u0027)\n    def blah():\n        ...","commit_id":"b3b5a50c32af906a1bdeead57ad80d1cd3632196"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a6021634232a2dd89f5503d949b6218acd55b7df","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        if retry_on_disconnect or retry_on_deadlock:"},{"line_number":186,"context_line":"            attr \u003d wrap_db_retry("},{"line_number":187,"context_line":"                retry_interval\u003dself.retry_interval,"},{"line_number":188,"context_line":"                max_retries\u003dself.max_retries,"},{"line_number":189,"context_line":"                inc_retry_interval\u003dself.inc_retry_interval,"},{"line_number":190,"context_line":"                max_retry_interval\u003dself.max_retry_interval,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1abeadc6_03c55e8d","line":187,"in_reply_to":"1abeadc6_f2b614f8","updated":"2014-08-27 16:57:24.000000000","message":"I updated the config option description.","commit_id":"b3b5a50c32af906a1bdeead57ad80d1cd3632196"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"2aee012915677870aa405121d01b1ccbca46e4bc","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    Database connection retries will be enabled for the decorated api method."},{"line_number":45,"context_line":"    Database connection failure can have many causes, which can be temporary."},{"line_number":46,"context_line":"    In such cases retry may increase the likelihood of connection."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    Usage::"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        @safe_for_db_retry"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_a6dacf75","side":"PARENT","line":47,"updated":"2014-08-28 15:54:38.000000000","message":"nit: unrelated change","commit_id":"41dada16cd1c289a3b99a0ca44e316295dc298b1"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"c88c9542b652f188eba2795882c13e6b4c7957d3","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    Database connection retries will be enabled for the decorated api method."},{"line_number":45,"context_line":"    Database connection failure can have many causes, which can be temporary."},{"line_number":46,"context_line":"    In such cases retry may increase the likelihood of connection."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    Usage::"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        @safe_for_db_retry"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa98f980_b141a10d","side":"PARENT","line":47,"in_reply_to":"1abeadc6_a6dacf75","updated":"2014-09-01 09:44:11.000000000","message":"Done","commit_id":"41dada16cd1c289a3b99a0ca44e316295dc298b1"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"3b08cf8e9fc51afdb4f454a59d831ca242b50a10","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    :param f: database api method."},{"line_number":55,"context_line":"    :type f: function."},{"line_number":56,"context_line":"    \"\"\""},{"line_number":57,"context_line":"    f.__dict__[\u0027enable_retry_on_disconnect\u0027] \u003d True"},{"line_number":58,"context_line":"    return f"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_a16bab1c","line":57,"updated":"2014-08-28 09:25:51.000000000","message":"If you prefer to leave the decorators separated, you don\u0027t need to use `__dict__`. Patch set 6 was correct in this place.","commit_id":"1e52f543d9172652d725b6ea997d09cd3b997de3"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"c88c9542b652f188eba2795882c13e6b4c7957d3","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    :param f: database api method."},{"line_number":55,"context_line":"    :type f: function."},{"line_number":56,"context_line":"    \"\"\""},{"line_number":57,"context_line":"    f.__dict__[\u0027enable_retry_on_disconnect\u0027] \u003d True"},{"line_number":58,"context_line":"    return f"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_1a191088","line":57,"in_reply_to":"1abeadc6_a16bab1c","updated":"2014-09-01 09:44:11.000000000","message":"Please see Victor Sergeyev \u0027s comment on patch set 6","commit_id":"1e52f543d9172652d725b6ea997d09cd3b997de3"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"41a8f14aeb03ca6e3a3e5aa6778755b8748c1ccc","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    :param f: database api method."},{"line_number":56,"context_line":"    :type f: function."},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":"    f.__dict__[\u0027enable_retry_on_disconnect\u0027] \u003d True"},{"line_number":59,"context_line":"    return f"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baa201ad_e5126bb3","line":58,"updated":"2014-09-30 20:39:15.000000000","message":"I see that you reverted this, with a reference to \"see Viktors\u0027 note on patch set 6\", but I\u0027m not seeing any comment to this effect.  Can I get the rationale for why this can\u0027t simply be:\n\n    f.enable_retry_on_disconnect \u003d True","commit_id":"38109be01c8905b4737148c07433e44a84eb36c4"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"154c15194efd0ddf5b5f4cd572a7c9714e32921f","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    :param f: database api method."},{"line_number":56,"context_line":"    :type f: function."},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":"    f.__dict__[\u0027enable_retry_on_disconnect\u0027] \u003d True"},{"line_number":59,"context_line":"    return f"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_9a0e9b8a","line":58,"in_reply_to":"9aa7fdbe_f324a861","updated":"2014-10-28 17:40:41.000000000","message":"If this use of __dict__ is needed, we need an inline comment explaining it.","commit_id":"38109be01c8905b4737148c07433e44a84eb36c4"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"bb79f4837e8168f1388eceffefdfba2a9f67b1d5","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    :param f: database api method."},{"line_number":56,"context_line":"    :type f: function."},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":"    f.__dict__[\u0027enable_retry_on_disconnect\u0027] \u003d True"},{"line_number":59,"context_line":"    return f"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_f324a861","line":58,"in_reply_to":"baa201ad_ca77929e","updated":"2014-10-23 11:18:11.000000000","message":"Here I copy/paste the comment from Viktor:\n\n\u003d\u003d\u003d\u003d\n__dict__ magic was used to be able to set attributes to the class methods. I think, that there is a sense to leave it here.\n\nSee an example:\n\nclass A(object):\ndef hi(self):\nprint \"hi\"\n\na \u003d A()\na.hi() # prints \"hi\"\n\na.hi.enable_retry_on_disconnect \u003d True\nTraceback (most recent call last):\nFile \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nAttributeError: \u0027instancemethod\u0027 object has no attribute \u0027enable_retry_on_disconnect\u0027\n\u003d\u003d\u003d\n\nI\u0027d remove it...anyway I might ignore some use case that requires it.","commit_id":"38109be01c8905b4737148c07433e44a84eb36c4"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"0772e72ba3357f3fd5154c3576351d21adb37774","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    :param f: database api method."},{"line_number":56,"context_line":"    :type f: function."},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":"    f.__dict__[\u0027enable_retry_on_disconnect\u0027] \u003d True"},{"line_number":59,"context_line":"    return f"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baa201ad_ca77929e","line":58,"in_reply_to":"baa201ad_e5126bb3","updated":"2014-10-08 08:07:26.000000000","message":"Actually, yes. I have hesitated to say it after Roman\u0027s +2, but it is still question for me too.","commit_id":"38109be01c8905b4737148c07433e44a84eb36c4"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"62fb42cf84bb1623e7f3329bd736f39678039dd5","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        # NOTE(vsergeyev): If `use_db_reconnect` option is set to True, retry"},{"line_number":208,"context_line":"        #                  DB API methods, decorated with @safe_for_db_retry"},{"line_number":209,"context_line":"        #                  on disconnect."},{"line_number":210,"context_line":"        retry_on_disconnect \u003d self.use_db_reconnect and getattr("},{"line_number":211,"context_line":"            attr, \u0027enable_retry_on_disconnect\u0027, False)"},{"line_number":212,"context_line":"        retry_on_deadlock \u003d getattr(attr, \u0027enable_retry_on_deadlock\u0027, False)"},{"line_number":213,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baa201ad_38849bd3","line":210,"updated":"2014-09-30 19:43:20.000000000","message":"(nit) we can probably continue use hasattr(attr, \u0027enabled_retry_on_disconnect\u0027)","commit_id":"38109be01c8905b4737148c07433e44a84eb36c4"},{"author":{"_account_id":12363,"name":"Oleksii Chuprykov","email":"a.chuprikoff@gmail.com","username":"ochuprykov"},"change_message_id":"892cd16370899d086b02ad93c9c788ad1d06a758","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    :param f: database api method."},{"line_number":56,"context_line":"    :type f: function."},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":"    f.enable_retry_on_disconnect \u003d True"},{"line_number":59,"context_line":"    return f"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a890539_9e309757","line":58,"updated":"2014-12-03 15:47:32.000000000","message":"Both the ways f.attr and f.__dict__[\u0027attr\u0027] work for me. Why do you use the different ways to add attr to function in L58,68?","commit_id":"bc8a66515f1c0324d1795edeed1ca6c942c0d9e6"},{"author":{"_account_id":12363,"name":"Oleksii Chuprykov","email":"a.chuprikoff@gmail.com","username":"ochuprykov"},"change_message_id":"17c36f0b5d1e4bc184ef6b7adaa3286d237ca230","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    :param f: database api method."},{"line_number":56,"context_line":"    :type f: function."},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":"    f.enable_retry_on_disconnect \u003d True"},{"line_number":59,"context_line":"    return f"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a890539_78866c66","line":58,"in_reply_to":"5a890539_2274b3fc","updated":"2014-12-04 14:59:01.000000000","message":"Seems both the ways are correct(at least in the case of applying decorators)\nExample:\n\ndef decorator(f):\n\n    f.new_attr \u003d 42\n\n    return f\n\nclass A():\n\n    @decorator\n\n    def hi(self):\n\n        pass\n\na \u003d A()\n\n\na.hi.new_attr\n\n#prints 42","commit_id":"bc8a66515f1c0324d1795edeed1ca6c942c0d9e6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"00cec251a785d6bac61c2d231f67c5afaf51aa66","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    :param f: database api method."},{"line_number":56,"context_line":"    :type f: function."},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":"    f.enable_retry_on_disconnect \u003d True"},{"line_number":59,"context_line":"    return f"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_1d631bb2","line":58,"in_reply_to":"5a890539_78866c66","updated":"2014-12-10 15:35:12.000000000","message":"I have removed and re-added the dict a couple of times already. I will remove it from line 68, thanks for pointing that. After that I hope we all agree :)","commit_id":"bc8a66515f1c0324d1795edeed1ca6c942c0d9e6"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"ecda6ddb598bfe6fc4e1e08d0a18030106fd632f","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    :param f: database api method."},{"line_number":56,"context_line":"    :type f: function."},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":"    f.enable_retry_on_disconnect \u003d True"},{"line_number":59,"context_line":"    return f"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a890539_2274b3fc","line":58,"in_reply_to":"5a890539_9e309757","updated":"2014-12-04 14:27:34.000000000","message":"I believe it is mistake. It was already discussed:\n\n\u003e\u003e\u003e Victor Sergeyev\t\tAug 22 3:56 PM\n\n__dict__ magic was used to be able to set attributes to the class methods. I think, that there is a sense to leave it here.\nSee an example:\n    class A(object):\n        def hi(self):\n        print \"hi\"\n    a \u003d A()\n    a.hi()  # prints \"hi\"\n    a.hi.enable_retry_on_disconnect \u003d True\n\n    Traceback (most recent call last):\n      File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n    AttributeError: \u0027instancemethod\u0027 object has no attribute  enable_retry_on_disconnect\u0027\n\n\nSo really works only the approach in 68 line.\nBtw we need a comment with description of why do we use `__dict__` modification.","commit_id":"bc8a66515f1c0324d1795edeed1ca6c942c0d9e6"},{"author":{"_account_id":12363,"name":"Oleksii Chuprykov","email":"a.chuprikoff@gmail.com","username":"ochuprykov"},"change_message_id":"892cd16370899d086b02ad93c9c788ad1d06a758","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                        raise e"},{"line_number":122,"context_line":"                    if remaining !\u003d -1:"},{"line_number":123,"context_line":"                        remaining -\u003d 1"},{"line_number":124,"context_line":"                        LOG.exception(_LE(\u0027DB error.\u0027))"},{"line_number":125,"context_line":"                    # NOTE(vsergeyev): We are using patched time module, so"},{"line_number":126,"context_line":"                    #                  this effectively yields the execution"},{"line_number":127,"context_line":"                    #                  context to another green thread."}],"source_content_type":"text/x-python","patch_set":9,"id":"5a890539_495e7714","line":124,"updated":"2014-12-03 15:47:32.000000000","message":"Can we provide some more information on what kind of error we get there?","commit_id":"bc8a66515f1c0324d1795edeed1ca6c942c0d9e6"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"ecda6ddb598bfe6fc4e1e08d0a18030106fd632f","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                        raise e"},{"line_number":122,"context_line":"                    if remaining !\u003d -1:"},{"line_number":123,"context_line":"                        remaining -\u003d 1"},{"line_number":124,"context_line":"                        LOG.exception(_LE(\u0027DB error.\u0027))"},{"line_number":125,"context_line":"                    # NOTE(vsergeyev): We are using patched time module, so"},{"line_number":126,"context_line":"                    #                  this effectively yields the execution"},{"line_number":127,"context_line":"                    #                  context to another green thread."}],"source_content_type":"text/x-python","patch_set":9,"id":"5a890539_a29c230f","line":124,"in_reply_to":"5a890539_495e7714","updated":"2014-12-04 14:27:34.000000000","message":"It will be unrelated change. This line didn\u0027t changed in the patch.","commit_id":"bc8a66515f1c0324d1795edeed1ca6c942c0d9e6"},{"author":{"_account_id":12363,"name":"Oleksii Chuprykov","email":"a.chuprikoff@gmail.com","username":"ochuprykov"},"change_message_id":"17c36f0b5d1e4bc184ef6b7adaa3286d237ca230","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                        raise e"},{"line_number":122,"context_line":"                    if remaining !\u003d -1:"},{"line_number":123,"context_line":"                        remaining -\u003d 1"},{"line_number":124,"context_line":"                        LOG.exception(_LE(\u0027DB error.\u0027))"},{"line_number":125,"context_line":"                    # NOTE(vsergeyev): We are using patched time module, so"},{"line_number":126,"context_line":"                    #                  this effectively yields the execution"},{"line_number":127,"context_line":"                    #                  context to another green thread."}],"source_content_type":"text/x-python","patch_set":9,"id":"5a890539_d84be028","line":124,"in_reply_to":"5a890539_a29c230f","updated":"2014-12-04 14:59:01.000000000","message":"DB connection error became DB error. I think it will be helpful to distinguish DBConnectionError from DBDeadlockError.","commit_id":"bc8a66515f1c0324d1795edeed1ca6c942c0d9e6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"00cec251a785d6bac61c2d231f67c5afaf51aa66","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                        raise e"},{"line_number":122,"context_line":"                    if remaining !\u003d -1:"},{"line_number":123,"context_line":"                        remaining -\u003d 1"},{"line_number":124,"context_line":"                        LOG.exception(_LE(\u0027DB error.\u0027))"},{"line_number":125,"context_line":"                    # NOTE(vsergeyev): We are using patched time module, so"},{"line_number":126,"context_line":"                    #                  this effectively yields the execution"},{"line_number":127,"context_line":"                    #                  context to another green thread."}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_0eaaf9d3","line":124,"in_reply_to":"5a890539_d84be028","updated":"2014-12-10 15:35:12.000000000","message":"I wouldn\u0027t add more code here just to distinguish between exception types. The traceback is enough to detect the error type.","commit_id":"bc8a66515f1c0324d1795edeed1ca6c942c0d9e6"}],"oslo/db/options.py":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"2aee012915677870aa405121d01b1ccbca46e4bc","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                     \u0027on connection lost.\u0027),"},{"line_number":119,"context_line":"    cfg.IntOpt(\u0027db_retry_interval\u0027,"},{"line_number":120,"context_line":"               default\u003d1,"},{"line_number":121,"context_line":"               help\u003d\u0027Seconds between retries of a database operation.\u0027),"},{"line_number":122,"context_line":"    cfg.BoolOpt(\u0027db_inc_retry_interval\u0027,"},{"line_number":123,"context_line":"                default\u003dTrue,"},{"line_number":124,"context_line":"                help\u003d\u0027If True, increases the interval between retries \u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_06eaa30e","line":121,"updated":"2014-08-28 15:54:38.000000000","message":"nit: perhaps we should be more clear here and use word \u0027transaction\u0027 instead of \u0027operation\u0027","commit_id":"1e52f543d9172652d725b6ea997d09cd3b997de3"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"c88c9542b652f188eba2795882c13e6b4c7957d3","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                     \u0027on connection lost.\u0027),"},{"line_number":119,"context_line":"    cfg.IntOpt(\u0027db_retry_interval\u0027,"},{"line_number":120,"context_line":"               default\u003d1,"},{"line_number":121,"context_line":"               help\u003d\u0027Seconds between retries of a database operation.\u0027),"},{"line_number":122,"context_line":"    cfg.BoolOpt(\u0027db_inc_retry_interval\u0027,"},{"line_number":123,"context_line":"                default\u003dTrue,"},{"line_number":124,"context_line":"                help\u003d\u0027If True, increases the interval between retries \u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa98f980_b10fe1e0","line":121,"in_reply_to":"1abeadc6_06eaa30e","updated":"2014-09-01 09:44:11.000000000","message":"Done","commit_id":"1e52f543d9172652d725b6ea997d09cd3b997de3"}],"oslo_db/options.py":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"960362458801132eb31a5782be87058b34a0e71e","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                     \u0027on connection lost.\u0027),"},{"line_number":120,"context_line":"    cfg.IntOpt(\u0027db_retry_interval\u0027,"},{"line_number":121,"context_line":"               default\u003d1,"},{"line_number":122,"context_line":"               help\u003d\u0027Seconds between retries of a database transaction.\u0027),"},{"line_number":123,"context_line":"    cfg.BoolOpt(\u0027db_inc_retry_interval\u0027,"},{"line_number":124,"context_line":"                default\u003dTrue,"},{"line_number":125,"context_line":"                help\u003d\u0027If True, increases the interval between retries \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_69fa45be","line":122,"updated":"2015-01-07 18:48:10.000000000","message":"(nit) if another patch is needed maybe switch \u0027transaction\u0027 to \u0027operation\u0027 to be consistent","commit_id":"0594aafa2622557d7ab590d8bcddd4d80cab73f6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"f36d01a001dc5a2e772fa9d4443a35a15487c170","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                     \u0027on connection lost.\u0027),"},{"line_number":120,"context_line":"    cfg.IntOpt(\u0027db_retry_interval\u0027,"},{"line_number":121,"context_line":"               default\u003d1,"},{"line_number":122,"context_line":"               help\u003d\u0027Seconds between retries of a database transaction.\u0027),"},{"line_number":123,"context_line":"    cfg.BoolOpt(\u0027db_inc_retry_interval\u0027,"},{"line_number":124,"context_line":"                default\u003dTrue,"},{"line_number":125,"context_line":"                help\u003d\u0027If True, increases the interval between retries \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_ff0cc7ee","line":122,"in_reply_to":"3a961159_69fa45be","updated":"2015-01-12 10:50:02.000000000","message":"OK, thanks!","commit_id":"0594aafa2622557d7ab590d8bcddd4d80cab73f6"}],"tests/test_api.py":[{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"3c2c7305cacd351e2bdaca489cf24af235118911","unresolved":false,"context_lines":[{"line_number":249,"context_line":"            func \u003d self.dbapi.api_raise_deadlock_err_decorated"},{"line_number":250,"context_line":"            self.test_db_api.error_counter \u003d 1"},{"line_number":251,"context_line":"            self.assertTrue(func(), \u0027Single retry did not succeed.\u0027)"},{"line_number":252,"context_line":"        except Exception:"},{"line_number":253,"context_line":"            self.fail(\u0027Single retry raised an un-wrapped error.\u0027)"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        self.assertEqual("}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_cc16aff3","line":252,"updated":"2014-08-12 19:57:52.000000000","message":"where in the new code are we concerned about plain Exception being raised?   We should be dealing with all DBError classes as input in the first place so I\u0027m not sure we need a distinct failure condition for this?  (it would raise out anyway if something suddenly raised a non-DBError).","commit_id":"5498993ecb72e547083221591f7c4ae41a4ff2a5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"aea3e60f649a515f9edebc3bb81c8c3484da0a78","unresolved":false,"context_lines":[{"line_number":249,"context_line":"            func \u003d self.dbapi.api_raise_deadlock_err_decorated"},{"line_number":250,"context_line":"            self.test_db_api.error_counter \u003d 1"},{"line_number":251,"context_line":"            self.assertTrue(func(), \u0027Single retry did not succeed.\u0027)"},{"line_number":252,"context_line":"        except Exception:"},{"line_number":253,"context_line":"            self.fail(\u0027Single retry raised an un-wrapped error.\u0027)"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        self.assertEqual("}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_6e42d70e","line":252,"in_reply_to":"baada198_cc16aff3","updated":"2014-08-13 10:43:56.000000000","message":"Right. I adapted this code from the tests that were already present. I think this is mostly to show a more clear error message in the tests. I\u0027d leave it the way it is. Do you feel strongly about it?","commit_id":"5498993ecb72e547083221591f7c4ae41a4ff2a5"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"66f5d725c63214d5d4dc6d79bf8942164d2dfcfb","unresolved":false,"context_lines":[{"line_number":266,"context_line":"            func \u003d self.dbapi.api_raise_deadlock_err_decorated"},{"line_number":267,"context_line":"            self.test_db_api.error_counter \u003d 2"},{"line_number":268,"context_line":"            self.assertTrue(func(), \u0027Multiple retry did not succeed.\u0027)"},{"line_number":269,"context_line":"        except Exception:"},{"line_number":270,"context_line":"            self.fail(\u0027Multiple retry raised an un-wrapped error.\u0027)"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"        self.assertEqual("}],"source_content_type":"text/x-python","patch_set":5,"id":"9ab29df4_dd1f3bb6","line":269,"updated":"2014-08-13 19:38:17.000000000","message":"so just to reiterate my other comment, we aren\u0027t really expecting Exception here even if the new code doesn\u0027t do what it\u0027s supposed to, so I think it makes the test less clear and would cover up an actual failure in the decorator, such as an attribute error or other issue.","commit_id":"93e7cc5548f132ce43cf9e84313410ac0aa239d6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4ec6ee2cc97503dcc078fd793189eb61b48a7993","unresolved":false,"context_lines":[{"line_number":266,"context_line":"            func \u003d self.dbapi.api_raise_deadlock_err_decorated"},{"line_number":267,"context_line":"            self.test_db_api.error_counter \u003d 2"},{"line_number":268,"context_line":"            self.assertTrue(func(), \u0027Multiple retry did not succeed.\u0027)"},{"line_number":269,"context_line":"        except Exception:"},{"line_number":270,"context_line":"            self.fail(\u0027Multiple retry raised an un-wrapped error.\u0027)"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"        self.assertEqual("}],"source_content_type":"text/x-python","patch_set":5,"id":"7ac7a964_c4f3c371","line":269,"in_reply_to":"9ab29df4_dd1f3bb6","updated":"2014-08-14 16:32:13.000000000","message":"Thanks for the explanation I see your point now. Done! Thanks a lot for reviewing!","commit_id":"93e7cc5548f132ce43cf9e84313410ac0aa239d6"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"2aee012915677870aa405121d01b1ccbca46e4bc","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            self.error_counter -\u003d 1"},{"line_number":49,"context_line":"            orig \u003d sqla.exc.DBAPIError(False, False, False)"},{"line_number":50,"context_line":"            orig.args \u003d [2006, \u0027Test raise operational error\u0027]"},{"line_number":51,"context_line":"            exception_type \u003d type(exception_to_raise)"},{"line_number":52,"context_line":"            e \u003d exception_type(orig)"},{"line_number":53,"context_line":"            raise e"},{"line_number":54,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_930c3344","line":51,"updated":"2014-08-28 15:54:38.000000000","message":"nit: why not pass the exception class directly here?","commit_id":"1e52f543d9172652d725b6ea997d09cd3b997de3"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"c88c9542b652f188eba2795882c13e6b4c7957d3","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            self.error_counter -\u003d 1"},{"line_number":49,"context_line":"            orig \u003d sqla.exc.DBAPIError(False, False, False)"},{"line_number":50,"context_line":"            orig.args \u003d [2006, \u0027Test raise operational error\u0027]"},{"line_number":51,"context_line":"            exception_type \u003d type(exception_to_raise)"},{"line_number":52,"context_line":"            e \u003d exception_type(orig)"},{"line_number":53,"context_line":"            raise e"},{"line_number":54,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa98f980_511795ed","line":51,"in_reply_to":"1abeadc6_930c3344","updated":"2014-09-01 09:44:11.000000000","message":"Roman, what do you mean exactly?","commit_id":"1e52f543d9172652d725b6ea997d09cd3b997de3"},{"author":{"_account_id":12363,"name":"Oleksii Chuprykov","email":"a.chuprikoff@gmail.com","username":"ochuprykov"},"change_message_id":"eb3049c4d8d09f77ebb8e9c6c12c2eba5486fa95","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    @api.safe_for_db_retry"},{"line_number":76,"context_line":"    @api.retry_on_deadlock"},{"line_number":77,"context_line":"    def api_raise_deadlock_err_two_decorators(self, *args, **kwargs):"},{"line_number":78,"context_line":"        if self.error_counter \u003d\u003d 2:"},{"line_number":79,"context_line":"            self.error_counter -\u003d 1"},{"line_number":80,"context_line":"            orig \u003d sqla.exc.DBAPIError(False, False, False)"},{"line_number":81,"context_line":"            orig.args \u003d [2006, \u0027Test raise operational error\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"1abeadc6_c6a98b7d","line":78,"updated":"2014-08-28 16:01:37.000000000","message":"What if error_counter \u003e 2? I think it is not good to return True.","commit_id":"1e52f543d9172652d725b6ea997d09cd3b997de3"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"c88c9542b652f188eba2795882c13e6b4c7957d3","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    @api.safe_for_db_retry"},{"line_number":76,"context_line":"    @api.retry_on_deadlock"},{"line_number":77,"context_line":"    def api_raise_deadlock_err_two_decorators(self, *args, **kwargs):"},{"line_number":78,"context_line":"        if self.error_counter \u003d\u003d 2:"},{"line_number":79,"context_line":"            self.error_counter -\u003d 1"},{"line_number":80,"context_line":"            orig \u003d sqla.exc.DBAPIError(False, False, False)"},{"line_number":81,"context_line":"            orig.args \u003d [2006, \u0027Test raise operational error\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa98f980_d1e2a502","line":78,"in_reply_to":"1abeadc6_c6a98b7d","updated":"2014-09-01 09:44:11.000000000","message":"This method is used only in this test, I\u0027ll add a check anyway.","commit_id":"1e52f543d9172652d725b6ea997d09cd3b997de3"}]}
