)]}'
{"neutron/db/api.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0f4fea149f224ac028b3d43321bc16e8f376bbcc","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def is_retriable(e):"},{"line_number":40,"context_line":"    if _is_nested_instance(e, (db_exc.DBDeadlock, exc.StaleDataError,"},{"line_number":41,"context_line":"                               db_exc.DBDuplicateEntry)):"},{"line_number":42,"context_line":"        return True"},{"line_number":43,"context_line":"    # looking savepoints mangled by deadlocks. see bug/1590298 for details."},{"line_number":44,"context_line":"    return _is_nested_instance(e, db_exc.DBError) and \u00271305\u0027 in str(e)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_3f785af2","line":41,"updated":"2016-06-22 13:17:16.000000000","message":"I can agree on DBDeadlock and StaleDataError, but DBDuplicate? I am not sure I see this a an exception that can be retried without looking into the context where it was raised. Granted these are supposed to be the exceptions that bubble up all the way to the API layer, but I am getting increasingly uncomfortable with how we\u0027re choosing to deal with these concerns. There\u0027s too much leaking through the layers and way too many \u0027gotchas\u0027.\n\nI would suggest to try and limit what is supposed to be retried automatically and this means that I don\u0027t personally agree with this change. PS1 looked better but I think that may lead to a sprinkling effect.\n\nOn another note, what if I am a user and I am updating the MAC of a port and accidentally end up conflicting? Wouldn\u0027t I retry for nothing?","commit_id":"1af862791ef83d2d67d71a4db6d37b919accb3d5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"82eeb0038532a6884fc8d2ffac039d154884e313","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def is_retriable(e):"},{"line_number":40,"context_line":"    if _is_nested_instance(e, (db_exc.DBDeadlock, exc.StaleDataError,"},{"line_number":41,"context_line":"                               db_exc.DBDuplicateEntry)):"},{"line_number":42,"context_line":"        return True"},{"line_number":43,"context_line":"    # looking savepoints mangled by deadlocks. see bug/1590298 for details."},{"line_number":44,"context_line":"    return _is_nested_instance(e, db_exc.DBError) and \u00271305\u0027 in str(e)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_3d08462d","line":41,"updated":"2016-06-22 23:07:58.000000000","message":"Yes, DBDuplicates that come up this far that are a result of a legitimate issue will just end up being a 500 with a Traceback in the logs. I would rather us expect that DBDuplicates are a result of a race that be retried. As Carl pointed out, legitimate bugs will still fail, but will just be retried 10 times first.","commit_id":"1af862791ef83d2d67d71a4db6d37b919accb3d5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"621f1d8ab4660eba85f3d2251e3406a44c35fba8","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def is_retriable(e):"},{"line_number":40,"context_line":"    if _is_nested_instance(e, (db_exc.DBDeadlock, exc.StaleDataError,"},{"line_number":41,"context_line":"                               db_exc.DBDuplicateEntry)):"},{"line_number":42,"context_line":"        return True"},{"line_number":43,"context_line":"    # looking savepoints mangled by deadlocks. see bug/1590298 for details."},{"line_number":44,"context_line":"    return _is_nested_instance(e, db_exc.DBError) and \u00271305\u0027 in str(e)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_a04a4dc3","line":41,"in_reply_to":"3aaa91ec_3d08462d","updated":"2016-06-22 23:37:27.000000000","message":"Ok, I guess I am having a hard time accepting the fact that the system is going to experience the bug 10 times before it fails. That bothers me because in a situation where there is a bug, it\u0027s already bad enough experiencing it once, let alone X times. Who knows what bad things are happening and multiplying the damage by a factor X worries me.\n\nHaving said, I am ok to lean back, but I would strongly advise to document these gotchas in the devref in the form of Effective Guide tip or more formal documentation of the utility functions of this module.\n\nAnyhoo, I hope this does not come back to haunt us.","commit_id":"1af862791ef83d2d67d71a4db6d37b919accb3d5"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"3da23b4b3ef9baebb5dcce61d225305e2669298f","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def is_retriable(e):"},{"line_number":40,"context_line":"    if _is_nested_instance(e, (db_exc.DBDeadlock, exc.StaleDataError,"},{"line_number":41,"context_line":"                               db_exc.DBDuplicateEntry)):"},{"line_number":42,"context_line":"        return True"},{"line_number":43,"context_line":"    # looking savepoints mangled by deadlocks. see bug/1590298 for details."},{"line_number":44,"context_line":"    return _is_nested_instance(e, db_exc.DBError) and \u00271305\u0027 in str(e)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_04838357","line":41,"in_reply_to":"3aaa91ec_3f785af2","updated":"2016-06-22 17:34:03.000000000","message":"@Armando, I\u0027m answering your last question first.  The answer is no.  If the user explicitly requests a specific mac address then a more appropriate user facing exception will be raised [1] that will not be retried.  This patch does not absolve us from our duty to recognize specific error conditions such as this and translate those in to proper user facing exceptions.\n\nAfter thinking about this approach, I agreed with Kevin that this would be okay because this exception results in a 500 to the end user.  We shouldn\u0027t be leaking these out to the API anyway.  If it occurs, and persists over 10 retries, then it will still end up resulting in a 500 error and should be reported as a bug.  However, for those cases where duplicates are raised because of a random collision that will go away with a retry, this catches them.\n\n [1] https://github.com/openstack/neutron/blob/4d3038d96e6d70751ea38cbb5a6fde6b7384c430/neutron/db/db_base_plugin_v2.py#L1150","commit_id":"1af862791ef83d2d67d71a4db6d37b919accb3d5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"82f83e8b57573a448c14042614a3d3ad5f065688","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def is_retriable(e):"},{"line_number":40,"context_line":"    if _is_nested_instance(e, (db_exc.DBDeadlock, exc.StaleDataError,"},{"line_number":41,"context_line":"                               db_exc.DBDuplicateEntry)):"},{"line_number":42,"context_line":"        return True"},{"line_number":43,"context_line":"    # looking savepoints mangled by deadlocks. see bug/1590298 for details."},{"line_number":44,"context_line":"    return _is_nested_instance(e, db_exc.DBError) and \u00271305\u0027 in str(e)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_e5443cb8","line":41,"in_reply_to":"3aaa91ec_8002b109","updated":"2016-06-23 15:13:57.000000000","message":"don\u0027t I always!","commit_id":"1af862791ef83d2d67d71a4db6d37b919accb3d5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"4bc4e9d53618baf78a5e4aa5a081d700e51f3383","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def is_retriable(e):"},{"line_number":40,"context_line":"    if _is_nested_instance(e, (db_exc.DBDeadlock, exc.StaleDataError,"},{"line_number":41,"context_line":"                               db_exc.DBDuplicateEntry)):"},{"line_number":42,"context_line":"        return True"},{"line_number":43,"context_line":"    # looking savepoints mangled by deadlocks. see bug/1590298 for details."},{"line_number":44,"context_line":"    return _is_nested_instance(e, db_exc.DBError) and \u00271305\u0027 in str(e)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_8002b109","line":41,"in_reply_to":"3aaa91ec_a04a4dc3","updated":"2016-06-22 23:45:55.000000000","message":"You can come after me if it does. :)","commit_id":"1af862791ef83d2d67d71a4db6d37b919accb3d5"}],"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ad6403a6581c7fc05330479663830372bed1b90d","unresolved":false,"context_lines":[{"line_number":1156,"context_line":"        return db_port"},{"line_number":1157,"context_line":""},{"line_number":1158,"context_line":"    def create_port(self, context, port):"},{"line_number":1159,"context_line":"        with db_api.exc_to_retry(db_exc.DBDuplicateEntry):"},{"line_number":1160,"context_line":"            db_port \u003d self.create_port_db(context, port)"},{"line_number":1161,"context_line":"        return self._make_port_dict(db_port, process_extensions\u003dFalse)"},{"line_number":1162,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3aaa91ec_d2e172d2","line":1159,"updated":"2016-06-21 23:52:57.000000000","message":"A note here that this is necessary for handling mac address duplicates might be nice.  Frankly, I was a little surprised that this exception wasn\u0027t caught by the retry decorator already.","commit_id":"a320ad4056a0ee97a3e779d17605e876fd0d8895"}]}
