)]}'
{"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"b6d93c23c00e429dc4b3877239acb859f76d0832","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        raise db_exc.DBError(_(\"Deadlock occured on \u0027%(func_name)s\u0027. After \""},{"line_number":184,"context_line":"                               \"%(attempts)d attempts, not able to fix it.\") %"},{"line_number":185,"context_line":"                             {\u0027func_name\u0027: f.__name__, \u0027attempts\u0027: attempts})"},{"line_number":186,"context_line":"        functools.update_wrapper(wrapped, f)"},{"line_number":187,"context_line":"    return wrapped"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2Fc38%3D","line":186,"updated":"2014-02-13 04:51:17.000000000","message":"looks to me line 183 raise exception and it will not be possible to enter line 186\nshould it be move 4 indent forward?","commit_id":"3f203c0e061679c501f58222ac68b5e6e8eac75b"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"8809f402ecf22c1f2602d88580aa6f9326a2936f","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        raise db_exc.DBError(_(\"Deadlock occured on \u0027%(func_name)s\u0027. After \""},{"line_number":184,"context_line":"                               \"%(attempts)d attempts, not able to fix it.\") %"},{"line_number":185,"context_line":"                             {\u0027func_name\u0027: f.__name__, \u0027attempts\u0027: attempts})"},{"line_number":186,"context_line":"        functools.update_wrapper(wrapped, f)"},{"line_number":187,"context_line":"    return wrapped"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2B3xc%3D","line":186,"in_reply_to":"AAAAUX%2F%2Fc38%3D","updated":"2014-02-18 14:02:11.000000000","message":"right! I just saw your comment, please use -1 the next time :)","commit_id":"3f203c0e061679c501f58222ac68b5e6e8eac75b"},{"author":{"_account_id":9420,"name":"Matthew Gilliard","email":"matthew.gilliard@hp.com","username":"gilliard"},"change_message_id":"d9e5c6f355324c11194c794723f24f4db3e27702","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    if f is None:"},{"line_number":166,"context_line":"        return functools.partial(_retry_on_deadlock, max_tries\u003dmax_tries)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    @functools.wraps(f)"},{"line_number":169,"context_line":"    def wrapped(*args, **kwargs):"},{"line_number":170,"context_line":"        attempts \u003d 0"},{"line_number":171,"context_line":"        while attempts \u003c max_tries:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAU3%2F%2FfZ0%3D","line":168,"updated":"2014-02-26 10:21:34.000000000","message":"My understanding is that it is unnecessary to use @functools.wraps(f) and update_wrapper(f).  Can you confirm that Sahid?","commit_id":"1e43511dde8c8a2d4e37b87cc8f1fe70e7471b16"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"f8d9f7a1b4bf8809201d329ed1d2c6b73f330168","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    if f is None:"},{"line_number":166,"context_line":"        return functools.partial(_retry_on_deadlock, max_tries\u003dmax_tries)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    @functools.wraps(f)"},{"line_number":169,"context_line":"    def wrapped(*args, **kwargs):"},{"line_number":170,"context_line":"        attempts \u003d 0"},{"line_number":171,"context_line":"        while attempts \u003c max_tries:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAVn%2F%2F8P8%3D","line":168,"in_reply_to":"AAAAU3%2F%2FfZ0%3D","updated":"2014-03-03 09:31:39.000000000","message":"Yes you are completely right the @wraps and update_wrapper(wrapper, f)  do the same things. They update __name__, __doc__...","commit_id":"1e43511dde8c8a2d4e37b87cc8f1fe70e7471b16"},{"author":{"_account_id":6698,"name":"Robert Pothier","email":"robpothier35@gmail.com","username":"rpothier"},"change_message_id":"ecd3e7955dc913f6a64749b486bbb43321c8f94a","unresolved":false,"context_lines":[{"line_number":215,"context_line":"                # Retry!"},{"line_number":216,"context_line":"                time.sleep(0.5)"},{"line_number":217,"context_line":"                continue"},{"line_number":218,"context_line":"        raise db_exc.DBError(_(\"Deadlock occured on \u0027%(func_name)s\u0027. After \""},{"line_number":219,"context_line":"                               \"%(attempts)d attempts, not able to fix it.\") %"},{"line_number":220,"context_line":"                             {\u0027func_name\u0027: f.__name__, \u0027attempts\u0027: attempts})"},{"line_number":221,"context_line":"    return wrapped"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAWH%2F%2F1ww%3D","line":218,"updated":"2014-03-13 13:24:10.000000000","message":"I agree, the original exception would be better here","commit_id":"f7cae964f826ec7c88972b0421c0e4536b67ead0"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"d74c69963e2be2bdaa34db7c11f4dd9068c7c180","unresolved":false,"context_lines":[{"line_number":215,"context_line":"                # Retry!"},{"line_number":216,"context_line":"                time.sleep(0.5)"},{"line_number":217,"context_line":"                continue"},{"line_number":218,"context_line":"        raise db_exc.DBError(_(\"Deadlock occured on \u0027%(func_name)s\u0027. After \""},{"line_number":219,"context_line":"                               \"%(attempts)d attempts, not able to fix it.\") %"},{"line_number":220,"context_line":"                             {\u0027func_name\u0027: f.__name__, \u0027attempts\u0027: attempts})"},{"line_number":221,"context_line":"    return wrapped"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAWH%2F%2F%2FkE%3D","line":218,"updated":"2014-03-12 13:52:19.000000000","message":"If you just \u0027raise\u0027 here (bare word), it will re-raise the last exception without interfering with its stack trace. This is as opposed to:\n\nlast_ex \u003d None\n\ntry:\n  foo()\ncatch Exception as ex:\n  last_ex \u003d ex\n\nraise ex\n\nwhich will lose the stack trace. Weird, but true.\n\nI\u0027d be inclined to LOG the too many attempts message, then re-raise the original exception rather than a new one.","commit_id":"f7cae964f826ec7c88972b0421c0e4536b67ead0"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"9e5320945fe5d73dcd1ef83af859b7900ab625cf","unresolved":false,"context_lines":[{"line_number":215,"context_line":"                # Retry!"},{"line_number":216,"context_line":"                time.sleep(0.5)"},{"line_number":217,"context_line":"                continue"},{"line_number":218,"context_line":"        raise db_exc.DBError(_(\"Deadlock occured on \u0027%(func_name)s\u0027. After \""},{"line_number":219,"context_line":"                               \"%(attempts)d attempts, not able to fix it.\") %"},{"line_number":220,"context_line":"                             {\u0027func_name\u0027: f.__name__, \u0027attempts\u0027: attempts})"},{"line_number":221,"context_line":"    return wrapped"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAWH%2F%2FO0Y%3D","line":218,"in_reply_to":"AAAAWH%2F%2F1ww%3D","updated":"2014-03-19 08:50:54.000000000","message":"Sorry, I didn\u0027t saw your comments... I\u0027m waiting the return of Dan and so think about update the code. Thanks for your reviews.","commit_id":"f7cae964f826ec7c88972b0421c0e4536b67ead0"}],"nova/tests/db/test_db_api.py":[{"author":{"_account_id":9420,"name":"Matthew Gilliard","email":"matthew.gilliard@hp.com","username":"gilliard"},"change_message_id":"9c9be695bb8198f5d916bbe48073690f8b2e2184","unresolved":false,"context_lines":[{"line_number":7113,"context_line":"                          v2[\u0027compute_node_id\u0027],"},{"line_number":7114,"context_line":"                          v2[\u0027address\u0027])"},{"line_number":7115,"context_line":""},{"line_number":7116,"context_line":""},{"line_number":7117,"context_line":"class RetryOnDeadLockTestCase(test.TestCase):"},{"line_number":7118,"context_line":"    def test_without_deadlock(self):"},{"line_number":7119,"context_line":"        @sqlalchemy_api._retry_on_deadlock"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FYwM%3D","line":7116,"updated":"2014-01-14 10:45:52.000000000","message":"nit: Deadlock is a one word so ...DeadLock... is incorrectly camelcased.","commit_id":"a37a625470eeb3a369de24c50ff44cc8f324356e"},{"author":{"_account_id":9420,"name":"Matthew Gilliard","email":"matthew.gilliard@hp.com","username":"gilliard"},"change_message_id":"7926da0983d704fab9d700a850a6a35341b93ff0","unresolved":false,"context_lines":[{"line_number":7133,"context_line":"        self.assertTrue(call_api())"},{"line_number":7134,"context_line":""},{"line_number":7135,"context_line":"    def test_raise_deadlock_attempts_exceeded(self):"},{"line_number":7136,"context_line":"        self.attempts2 \u003d 5"},{"line_number":7137,"context_line":""},{"line_number":7138,"context_line":"        @sqlalchemy_api._retry_on_deadlock(max_tries\u003d3)"},{"line_number":7139,"context_line":"        def call_api(*args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FYys%3D","line":7136,"updated":"2014-01-14 10:36:55.000000000","message":"I\u0027d prefer a more meaningful name than \"attempts2\"","commit_id":"a37a625470eeb3a369de24c50ff44cc8f324356e"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"cf7c98208e05858d884ac421433f77d94e8242ce","unresolved":false,"context_lines":[{"line_number":7133,"context_line":"        self.assertTrue(call_api())"},{"line_number":7134,"context_line":""},{"line_number":7135,"context_line":"    def test_raise_deadlock_attempts_exceeded(self):"},{"line_number":7136,"context_line":"        self.attempts2 \u003d 5"},{"line_number":7137,"context_line":""},{"line_number":7138,"context_line":"        @sqlalchemy_api._retry_on_deadlock(max_tries\u003d3)"},{"line_number":7139,"context_line":"        def call_api(*args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FYwA%3D","line":7136,"in_reply_to":"AAAAUH%2F%2FYys%3D","updated":"2014-01-14 10:43:36.000000000","message":"Done","commit_id":"a37a625470eeb3a369de24c50ff44cc8f324356e"},{"author":{"_account_id":9420,"name":"Matthew Gilliard","email":"matthew.gilliard@hp.com","username":"gilliard"},"change_message_id":"7926da0983d704fab9d700a850a6a35341b93ff0","unresolved":false,"context_lines":[{"line_number":7141,"context_line":"                self.attempts2 \u003d self.attempts2 - 1"},{"line_number":7142,"context_line":"                raise db_exc.DBDeadlock(\"fake exception\")"},{"line_number":7143,"context_line":"            return True"},{"line_number":7144,"context_line":"        self.assertRaises(db_exc.DBError, call_api)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FYyo%3D","line":7144,"updated":"2014-01-14 10:36:55.000000000","message":"Can we assert here that self.attempts2 is now 2, i.e. that `max_tries\u003d3` was honoured?","commit_id":"a37a625470eeb3a369de24c50ff44cc8f324356e"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"cf7c98208e05858d884ac421433f77d94e8242ce","unresolved":false,"context_lines":[{"line_number":7141,"context_line":"                self.attempts2 \u003d self.attempts2 - 1"},{"line_number":7142,"context_line":"                raise db_exc.DBDeadlock(\"fake exception\")"},{"line_number":7143,"context_line":"            return True"},{"line_number":7144,"context_line":"        self.assertRaises(db_exc.DBError, call_api)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FYvw%3D","line":7144,"in_reply_to":"AAAAUH%2F%2FYyo%3D","updated":"2014-01-14 10:43:36.000000000","message":"Sure i will do that.","commit_id":"a37a625470eeb3a369de24c50ff44cc8f324356e"}]}
