)]}'
{"glance/registry/db/api.py":[{"author":{"_account_id":1955,"name":"Alan Pevec","email":"alan.pevec@redhat.com","username":"apevec"},"change_message_id":"0ca46ba73758e54b972184b0e9437674b91d65e6","unresolved":false,"context_lines":[{"line_number":137,"context_line":""},{"line_number":138,"context_line":"def is_db_connection_error(args):"},{"line_number":139,"context_line":"    \"\"\"Return True if error in connecting to db.\"\"\""},{"line_number":140,"context_line":"    conn_err_codes \u003d (\u00272002\u0027, \u00272006\u0027)"},{"line_number":141,"context_line":"    for err_code in conn_err_codes:"},{"line_number":142,"context_line":"        if args.find(err_code) !\u003d -1:"},{"line_number":143,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F7Pg%3D","line":140,"updated":"2012-03-22 16:14:02.000000000","message":"It\u0027s theoretical, since Openstack in general is tested only with mysql database, but for the future, how could  this work with other databases?\nAren\u0027t those error codes are mysql specific?\n\nWith the previous solution removed by this patch, you could have separate per database listeners.","commit_id":"3f462fbf9a2b9cfe6ac39d87fe5b327ba82e9dac"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"cbd32f254b499baa2987fc40624f47d7565373c3","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"def wrap_db_error(f):"},{"line_number":148,"context_line":"    \"\"\"Retry DB connection. Copied from nova and modified.\"\"\""},{"line_number":149,"context_line":"    def _wrap(*args, **kwargs):"},{"line_number":150,"context_line":"        try:"},{"line_number":151,"context_line":"            return f(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F8N8%3D","line":148,"updated":"2012-03-20 10:44:55.000000000","message":"Is it similar enough to the nova code to justify promotion to openstack-common?","commit_id":"3f462fbf9a2b9cfe6ac39d87fe5b327ba82e9dac"},{"author":{"_account_id":1633,"name":"unmesh-gurjar","email":"unmesh.gurjar@hp.com","username":"unmesh-gurjar"},"change_message_id":"c33fc7f57848c3721199597b48b79b10c2c15db9","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"def wrap_db_error(f):"},{"line_number":148,"context_line":"    \"\"\"Retry DB connection. Copied from nova and modified.\"\"\""},{"line_number":149,"context_line":"    def _wrap(*args, **kwargs):"},{"line_number":150,"context_line":"        try:"},{"line_number":151,"context_line":"            return f(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F7xc%3D","line":148,"in_reply_to":"AAAAE3%2F%2F8N8%3D","updated":"2012-03-21 10:19:00.000000000","message":"The difference with the Nova code is the addition handling of db connection error (by retries).\nI certainly feel this can be promoted to openstack-common.","commit_id":"3f462fbf9a2b9cfe6ac39d87fe5b327ba82e9dac"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"cbd32f254b499baa2987fc40624f47d7565373c3","unresolved":false,"context_lines":[{"line_number":166,"context_line":"                except OperationalError, e:"},{"line_number":167,"context_line":"                    if remaining_attempts \u003d\u003d 0 or \\"},{"line_number":168,"context_line":"                       not is_db_connection_error(e.args[0]):"},{"line_number":169,"context_line":"                        raise"},{"line_number":170,"context_line":"                except DBAPIError:"},{"line_number":171,"context_line":"                    raise"},{"line_number":172,"context_line":"        except DBAPIError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F8N4%3D","line":169,"updated":"2012-03-20 10:44:55.000000000","message":"Should the exception on the original failure be raised here? (having been previously saved)","commit_id":"3f462fbf9a2b9cfe6ac39d87fe5b327ba82e9dac"},{"author":{"_account_id":1633,"name":"unmesh-gurjar","email":"unmesh.gurjar@hp.com","username":"unmesh-gurjar"},"change_message_id":"c33fc7f57848c3721199597b48b79b10c2c15db9","unresolved":false,"context_lines":[{"line_number":166,"context_line":"                except OperationalError, e:"},{"line_number":167,"context_line":"                    if remaining_attempts \u003d\u003d 0 or \\"},{"line_number":168,"context_line":"                       not is_db_connection_error(e.args[0]):"},{"line_number":169,"context_line":"                        raise"},{"line_number":170,"context_line":"                except DBAPIError:"},{"line_number":171,"context_line":"                    raise"},{"line_number":172,"context_line":"        except DBAPIError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F7xY%3D","line":169,"in_reply_to":"AAAAE3%2F%2F8N4%3D","updated":"2012-03-21 10:19:00.000000000","message":"The control will reach the retry block only if the original exception (from the first try block) is a DB connection error. However, in the retry block, OperationalError could be raised due to different reasons like \u00271054 Unknown Column\u0027.\nTherefore raising the new exception from retry block.","commit_id":"3f462fbf9a2b9cfe6ac39d87fe5b327ba82e9dac"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"cbd32f254b499baa2987fc40624f47d7565373c3","unresolved":false,"context_lines":[{"line_number":170,"context_line":"                except DBAPIError:"},{"line_number":171,"context_line":"                    raise"},{"line_number":172,"context_line":"        except DBAPIError:"},{"line_number":173,"context_line":"            raise"},{"line_number":174,"context_line":"    _wrap.func_name \u003d f.func_name"},{"line_number":175,"context_line":"    return _wrap"},{"line_number":176,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F8OE%3D","line":173,"updated":"2012-03-20 10:44:55.000000000","message":"Are these explicit catch and re-raise clauses really necessary? i.e. would the default be equivalent?","commit_id":"3f462fbf9a2b9cfe6ac39d87fe5b327ba82e9dac"},{"author":{"_account_id":1633,"name":"unmesh-gurjar","email":"unmesh.gurjar@hp.com","username":"unmesh-gurjar"},"change_message_id":"c33fc7f57848c3721199597b48b79b10c2c15db9","unresolved":false,"context_lines":[{"line_number":170,"context_line":"                except DBAPIError:"},{"line_number":171,"context_line":"                    raise"},{"line_number":172,"context_line":"        except DBAPIError:"},{"line_number":173,"context_line":"            raise"},{"line_number":174,"context_line":"    _wrap.func_name \u003d f.func_name"},{"line_number":175,"context_line":"    return _wrap"},{"line_number":176,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAE3%2F%2F7xU%3D","line":173,"in_reply_to":"AAAAE3%2F%2F8OE%3D","updated":"2012-03-21 10:19:00.000000000","message":"The explicit try-catch and re-raise blocks can be done away with. The default will be equivalent, I will submit another patch for this.","commit_id":"3f462fbf9a2b9cfe6ac39d87fe5b327ba82e9dac"}]}
