)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"7f9afe36d0f7ac5e58de58dc1cd0482868c12f15","unresolved":false,"context_lines":[{"line_number":17,"context_line":"just add a wrapper around it for some logging and add"},{"line_number":18,"context_line":"a bit of error handling incase somebody sets retries to 0"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Co-Authored-By: Josh Harlow \u003charlowja@yahoo-inc.com\u003e"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: I629373d3c75be591ccde5608c8c85f2debd47447"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"1a930d6b_3d7992c8","line":20,"updated":"2015-01-24 02:26:16.000000000","message":"Ha, thx, u are the true author though :-P\n\nI just play along as one, haha.","commit_id":"8d18bb592ad006053252de1b25cdae763b69a53a"}],"cinder/utils.py":[{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"39437f858a35620404f765ed4f20fbd35c9508ac","unresolved":false,"context_lines":[{"line_number":769,"context_line":"        return False"},{"line_number":770,"context_line":""},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"class RetryDecorator(object):"},{"line_number":773,"context_line":"    \"\"\"Retry decorator reruns a method \u0027retries\u0027 times if an exception occurs."},{"line_number":774,"context_line":""},{"line_number":775,"context_line":"    Decorator for retrying a method if exceptionToCheck exception occurs"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a930d6b_de551fc7","line":772,"updated":"2015-01-22 18:49:56.000000000","message":"John,maybe, renaming it to Retry will be more readably in usage, but it\u0027s up to you","commit_id":"bc31d16afbf145267d84c7fc4adf15c62b8f36e2"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"7e1d307cab55c703dd8288e08f3050df1bd30f59","unresolved":false,"context_lines":[{"line_number":802,"context_line":"                    return original_func(*args, **kwargs)"},{"line_number":803,"context_line":"                except self.exc:"},{"line_number":804,"context_line":"                    LOG.debug(\"Exception encountered during retry \""},{"line_number":805,"context_line":"                              \"attempt %s, calling again in %s seconds\","},{"line_number":806,"context_line":"                              (attempt, sleep_interval))"},{"line_number":807,"context_line":"                    time.sleep(sleep_interval)"},{"line_number":808,"context_line":"                    num_of_iter -\u003d 1"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a930d6b_db4e11c1","line":805,"updated":"2015-01-22 18:42:34.000000000","message":"Would prefer this ending with \u0027.\u0027.","commit_id":"bc31d16afbf145267d84c7fc4adf15c62b8f36e2"},{"author":{"_account_id":7219,"name":"git-harry","email":"git-harry@live.co.uk","username":"git-harry"},"change_message_id":"080d9d49f8c75982413b99218c4b55bbfd2be8ae","unresolved":false,"context_lines":[{"line_number":776,"context_line":"    If method raises exception, retries \u0027retries\u0027 times with increasing"},{"line_number":777,"context_line":"    back off period between calls with \u0027interval\u0027 multiplier"},{"line_number":778,"context_line":""},{"line_number":779,"context_line":"    :param exceptionToCheck: the exception to check"},{"line_number":780,"context_line":"    :param interval: initial delay between retries in seconds"},{"line_number":781,"context_line":"    :param retries: number of times to try before giving up"},{"line_number":782,"context_line":"    :parm backoff_rate: multiplier for interval"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a930d6b_ca771901","line":779,"updated":"2015-01-22 21:21:37.000000000","message":"The use of camel case for this variable seems slightly out of place to me.\n\nI think exceptionToCheck would also work if it was a tuple of exceptions, maybe it would be useful to mention it explicitly.","commit_id":"6170649ec889ef4a833998ba8882fb9d4f59a1ff"},{"author":{"_account_id":7219,"name":"git-harry","email":"git-harry@live.co.uk","username":"git-harry"},"change_message_id":"080d9d49f8c75982413b99218c4b55bbfd2be8ae","unresolved":false,"context_lines":[{"line_number":797,"context_line":"            sleep_interval \u003d self.interval"},{"line_number":798,"context_line":"            num_of_iter \u003d self.retries"},{"line_number":799,"context_line":"            while num_of_iter \u003e 0:"},{"line_number":800,"context_line":"                attempt \u003d self.retries - num_of_iter"},{"line_number":801,"context_line":"                try:"},{"line_number":802,"context_line":"                    return original_func(*args, **kwargs)"},{"line_number":803,"context_line":"                except self.exc:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a930d6b_6a48e587","line":800,"updated":"2015-01-22 21:21:37.000000000","message":"The first attempt will be attempt 0 - was that intentional?\n\nLooking at the debug message, you term it a \u0027retry attempt\u0027, so in that context I guess it is.","commit_id":"6170649ec889ef4a833998ba8882fb9d4f59a1ff"},{"author":{"_account_id":7219,"name":"git-harry","email":"git-harry@live.co.uk","username":"git-harry"},"change_message_id":"080d9d49f8c75982413b99218c4b55bbfd2be8ae","unresolved":false,"context_lines":[{"line_number":802,"context_line":"                    return original_func(*args, **kwargs)"},{"line_number":803,"context_line":"                except self.exc:"},{"line_number":804,"context_line":"                    LOG.debug(\"Exception encountered during retry \""},{"line_number":805,"context_line":"                              \"attempt %s, calling again in %s seconds.\","},{"line_number":806,"context_line":"                              (attempt, sleep_interval))"},{"line_number":807,"context_line":"                    time.sleep(sleep_interval)"},{"line_number":808,"context_line":"                    num_of_iter -\u003d 1"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a930d6b_8a02713c","line":805,"updated":"2015-01-22 21:21:37.000000000","message":"I wonder if there would be any value it logging the message from the caught exception - so there isn\u0027t a requirement to look in the code to see what\u0027s causing the retry.","commit_id":"6170649ec889ef4a833998ba8882fb9d4f59a1ff"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"670f49d5921c0a311fdf4be7485128eeef40525e","unresolved":false,"context_lines":[{"line_number":793,"context_line":"        self.backoff_rate \u003d backoff_rate"},{"line_number":794,"context_line":""},{"line_number":795,"context_line":"    def __call__(self, original_func):"},{"line_number":796,"context_line":"        def decorated(*args, **kwargs):"},{"line_number":797,"context_line":"            sleep_interval \u003d self.interval"},{"line_number":798,"context_line":"            num_of_iter \u003d self.retries"},{"line_number":799,"context_line":"            while num_of_iter \u003e 0:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a930d6b_524e7b97","line":796,"updated":"2015-01-22 23:48:53.000000000","message":"Pretty sure this loses all metadata information about the decorated  function when done like this.\n\nDid u mean to add a functools.wraps or six.wraps so that the metadata gets associated correctly?","commit_id":"ba7e982e25d74771350b323af36e436d656ba0b3"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"b26c6008b14f855c85287dd43a19fcab31cf8dd3","unresolved":false,"context_lines":[{"line_number":801,"context_line":"                try:"},{"line_number":802,"context_line":"                    return original_func(*args, **kwargs)"},{"line_number":803,"context_line":"                except self.exc:"},{"line_number":804,"context_line":"                    LOG.debug(\"Exception encountered during retry \""},{"line_number":805,"context_line":"                              \"attempt %s, calling again in %s seconds.\","},{"line_number":806,"context_line":"                              (attempt, sleep_interval))"},{"line_number":807,"context_line":"                    time.sleep(sleep_interval)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a930d6b_ea276bb4","line":804,"updated":"2015-01-23 03:25:15.000000000","message":"I would prefer to improve a bit log message. Because this one won\u0027t help us in debugging case. \n\nIt will looks like: \n\n  \"Exception encountered during retry attempt X, calling against in 3  seconds\"\n\n\nMaybe we should put full name of method at least here?","commit_id":"ba7e982e25d74771350b323af36e436d656ba0b3"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2d942f3a47b1bf69edd2cb894e744397f593eee7","unresolved":false,"context_lines":[{"line_number":771,"context_line":"        return False"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":""},{"line_number":774,"context_line":"def RetryDecorator(exceptions, interval\u003d1, retries\u003d3, backoff_rate\u003d2):"},{"line_number":775,"context_line":""},{"line_number":776,"context_line":"    def _retry_on_exception(e):"},{"line_number":777,"context_line":"        if isinstance(e, exceptions):"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a930d6b_e4978038","line":774,"updated":"2015-01-23 20:25:21.000000000","message":"Hmmm, not sure about this name style :-/\n\nhttp://legacy.python.org/dev/peps/pep-0008/#function-names","commit_id":"dc76245a66dfbe359914850da9b2722ef4794bda"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"e5ed517f8813ea2716970cf41d886258dcf8965f","unresolved":false,"context_lines":[{"line_number":786,"context_line":""},{"line_number":787,"context_line":"    def _print_stop(previous_attempt_number, delay_since_first_attempt_ms):"},{"line_number":788,"context_line":"        delay_since_first_attempt \u003d delay_since_first_attempt_ms / 1000.0"},{"line_number":789,"context_line":"        print(\"Failed attempt %s\" % previous_attempt_number)"},{"line_number":790,"context_line":"        print(\"Have been at this for %s seconds\" % delay_since_first_attempt)"},{"line_number":791,"context_line":"        if previous_attempt_number \u003d\u003d retries:"},{"line_number":792,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a930d6b_a11aca7a","line":789,"updated":"2015-01-23 20:10:37.000000000","message":"Did u want to use prints or logs?","commit_id":"dc76245a66dfbe359914850da9b2722ef4794bda"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"e5ed517f8813ea2716970cf41d886258dcf8965f","unresolved":false,"context_lines":[{"line_number":797,"context_line":"    # Retries of 0 makes no sense, but if they"},{"line_number":798,"context_line":"    # try it, bad things happen"},{"line_number":799,"context_line":"    if retries \u003c 1:"},{"line_number":800,"context_line":"        retries \u003d 1"},{"line_number":801,"context_line":"    def _decorator(f):"},{"line_number":802,"context_line":"        r \u003d retrying.Retrying(retry_on_exception\u003d_retry_on_exception,"},{"line_number":803,"context_line":"                              wait_func\u003d_backoff_sleep,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a930d6b_61046218","line":800,"updated":"2015-01-23 20:10:37.000000000","message":"Should this blowup with value error instead?","commit_id":"dc76245a66dfbe359914850da9b2722ef4794bda"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"e5ed517f8813ea2716970cf41d886258dcf8965f","unresolved":false,"context_lines":[{"line_number":799,"context_line":"    if retries \u003c 1:"},{"line_number":800,"context_line":"        retries \u003d 1"},{"line_number":801,"context_line":"    def _decorator(f):"},{"line_number":802,"context_line":"        r \u003d retrying.Retrying(retry_on_exception\u003d_retry_on_exception,"},{"line_number":803,"context_line":"                              wait_func\u003d_backoff_sleep,"},{"line_number":804,"context_line":"                              stop_func\u003d_print_stop)"},{"line_number":805,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"1a930d6b_812a2e8e","line":802,"updated":"2015-01-23 20:10:37.000000000","message":"So I think this needs to be moved into \u0027_wrapper\u0027 to avoid issues with multiple callers calling into this function at the same time; that was my mistake in the paste and should be corrected before used.\n\nSince this \u0027r\u0027 is captured outside of the \u0027_wrapper\u0027 that means its shared by all callers of the decorated function, which seems undesirable (especially if the function is recursively used or shared by threads).","commit_id":"dc76245a66dfbe359914850da9b2722ef4794bda"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"b34524219e4053962756f1aebb96bbc6f4c92699","unresolved":false,"context_lines":[{"line_number":786,"context_line":""},{"line_number":787,"context_line":"    def _print_stop(previous_attempt_number, delay_since_first_attempt_ms):"},{"line_number":788,"context_line":"        delay_since_first_attempt \u003d delay_since_first_attempt_ms / 1000.0"},{"line_number":789,"context_line":"        LOG.debug(\"Failed attempt %s\" % previous_attempt_number)"},{"line_number":790,"context_line":"        LOG.debug(\"Have been at this for %s seconds\" % delay_since_first_attempt)"},{"line_number":791,"context_line":"        if previous_attempt_number \u003d\u003d retries:"},{"line_number":792,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a930d6b_155bd42e","line":789,"updated":"2015-01-23 22:01:03.000000000","message":"U just interpolated before the debug is called. Which means the cost of that interpolation will occur even if DEBUG is not enabled. Is that wanted?\n\nTypically this should be of the format:\n\n  LOG.debug(\"Failed attempt %s\", previous_attempt_number)\n\nThis avoids interpolation if the DEBUG level is not enabled in the first place.","commit_id":"1e99263ae20c0f240b2525149d15e56693402006"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"74fa5db04e2cc24df9508ef5123336653a306465","unresolved":false,"context_lines":[{"line_number":772,"context_line":"def retry(exceptions, interval\u003d1, retries\u003d3, backoff_rate\u003d2):"},{"line_number":773,"context_line":""},{"line_number":774,"context_line":"    def _retry_on_exception(e):"},{"line_number":775,"context_line":"        if isinstance(e, exceptions):"},{"line_number":776,"context_line":"            return True"},{"line_number":777,"context_line":"        return False"},{"line_number":778,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_30561407","line":775,"updated":"2015-01-24 16:41:07.000000000","message":"return isinstance(e, exceptions)","commit_id":"8d18bb592ad006053252de1b25cdae763b69a53a"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"d87480f766f33ae4254457e98c0e616fc05014be","unresolved":false,"context_lines":[{"line_number":772,"context_line":"def retry(exceptions, interval\u003d1, retries\u003d3, backoff_rate\u003d2):"},{"line_number":773,"context_line":""},{"line_number":774,"context_line":"    def _retry_on_exception(e):"},{"line_number":775,"context_line":"        if isinstance(e, exceptions):"},{"line_number":776,"context_line":"            return True"},{"line_number":777,"context_line":"        return False"},{"line_number":778,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_3043746d","line":775,"in_reply_to":"1a930d6b_30561407","updated":"2015-01-24 19:25:27.000000000","message":"Done","commit_id":"8d18bb592ad006053252de1b25cdae763b69a53a"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"74fa5db04e2cc24df9508ef5123336653a306465","unresolved":false,"context_lines":[{"line_number":776,"context_line":"            return True"},{"line_number":777,"context_line":"        return False"},{"line_number":778,"context_line":""},{"line_number":779,"context_line":"    def _backoff_sleep(previous_attempt_number, delay_since_first_attempt_ms):"},{"line_number":780,"context_line":"        exp \u003d backoff_rate ** previous_attempt_number"},{"line_number":781,"context_line":"        wait_for \u003d max(0, interval * exp)"},{"line_number":782,"context_line":"        LOG.debug(\"Sleeping for %s seconds\", wait_for)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_5072c0ad","line":779,"updated":"2015-01-24 16:41:07.000000000","message":"Retrying() actually has a large number of backoff pattern available, I wonder if you didn\u0027t miss the one you wanted and if you really need to implement your own.\n\nJust saying though.","commit_id":"8d18bb592ad006053252de1b25cdae763b69a53a"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"bca03c4560984f6dcb80b1f763cbef7280ef2759","unresolved":false,"context_lines":[{"line_number":776,"context_line":"            return True"},{"line_number":777,"context_line":"        return False"},{"line_number":778,"context_line":""},{"line_number":779,"context_line":"    def _backoff_sleep(previous_attempt_number, delay_since_first_attempt_ms):"},{"line_number":780,"context_line":"        exp \u003d backoff_rate ** previous_attempt_number"},{"line_number":781,"context_line":"        wait_for \u003d max(0, interval * exp)"},{"line_number":782,"context_line":"        LOG.debug(\"Sleeping for %s seconds\", wait_for)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_90e6e813","line":779,"in_reply_to":"1a930d6b_5072c0ad","updated":"2015-01-24 17:38:17.000000000","message":"So this one is my fault; so I\u0027ll explain. I did look at the retrying one[1], but wanted something that could tell me how long the next sleep would be and it doesn\u0027t appear the retrying code has a callback that will let me know this information (for logging purposes); that one is also missing a backoff exponent that is not 2 (it always uses 2) so that\u0027s another drawback... something to fix upstream I think... I\u0027ll see if I can remember to submit a PR for those...\n\n[1] https://github.com/rholder/retrying/blob/master/retrying.py#L171","commit_id":"8d18bb592ad006053252de1b25cdae763b69a53a"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"74fa5db04e2cc24df9508ef5123336653a306465","unresolved":false,"context_lines":[{"line_number":787,"context_line":"        LOG.debug(\"Failed attempt %s\", previous_attempt_number)"},{"line_number":788,"context_line":"        LOG.debug(\"Have been at this for %s seconds\","},{"line_number":789,"context_line":"                  delay_since_first_attempt)"},{"line_number":790,"context_line":"        if previous_attempt_number \u003d\u003d retries:"},{"line_number":791,"context_line":"            return True"},{"line_number":792,"context_line":"        return False"},{"line_number":793,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_d05dd016","line":790,"updated":"2015-01-24 16:41:07.000000000","message":"return attempt_number \u003d\u003d retries","commit_id":"8d18bb592ad006053252de1b25cdae763b69a53a"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"d87480f766f33ae4254457e98c0e616fc05014be","unresolved":false,"context_lines":[{"line_number":787,"context_line":"        LOG.debug(\"Failed attempt %s\", previous_attempt_number)"},{"line_number":788,"context_line":"        LOG.debug(\"Have been at this for %s seconds\","},{"line_number":789,"context_line":"                  delay_since_first_attempt)"},{"line_number":790,"context_line":"        if previous_attempt_number \u003d\u003d retries:"},{"line_number":791,"context_line":"            return True"},{"line_number":792,"context_line":"        return False"},{"line_number":793,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_50480087","line":790,"in_reply_to":"1a930d6b_d05dd016","updated":"2015-01-24 19:25:27.000000000","message":"Done","commit_id":"8d18bb592ad006053252de1b25cdae763b69a53a"}]}
