)]}'
{"nova/network/neutronv2/api.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9064fcb8506fd37e0222ca06af690ce06609b737","unresolved":false,"context_lines":[{"line_number":407,"context_line":"                # the current instance.host."},{"line_number":408,"context_line":"                has_binding_ext \u003d self.supports_port_binding_extension(context)"},{"line_number":409,"context_line":"                if port_migrating and has_binding_ext:"},{"line_number":410,"context_line":"                    # Attempt to delete all port bindings on the host and raise"},{"line_number":411,"context_line":"                    # any errors at the end."},{"line_number":412,"context_line":"                    exc \u003d None"},{"line_number":413,"context_line":"                    for port in ports:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_21dec0da","line":410,"updated":"2018-07-19 16:02:25.000000000","message":"Hum, this will cause us to lose the original exception context(s). We get a log message for each exception instance in delete_port_binding, but if we ever care about the stack trace, we ought to LOG.exception at L419. And then at L422 we shouldn\u0027t just raise the *last* PortBindingDeletionFailed, cause that\u0027s kind of misleading. What I would suggest instead is to raise a customized PortBindingDeletionFailed (in case callers are expecting that particular exception class) but with a generalized message. So something like:\n\n num_failures \u003d 0\n for port in ports:\n     try:\n         delete_port_binding(...)\n     except exception.PortBindingDeletionFailed:\n         LOG.exception(...) # if we need the stack trace\n         num_failures +\u003d 1\n if num_failures:\n     raise exception.PortBindingDeletionFailed(\n         _(\"Failed to delete %(failures)d of %(total)d port bindings\"),\n         failures\u003dnum_failures, total\u003dlen(ports))","commit_id":"5ea5aa332e247592d5b21ebc34fa3f4284994dfc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"24e8a9948ad9c2eac975fddc1a4954579a3aac64","unresolved":false,"context_lines":[{"line_number":407,"context_line":"                # the current instance.host."},{"line_number":408,"context_line":"                has_binding_ext \u003d self.supports_port_binding_extension(context)"},{"line_number":409,"context_line":"                if port_migrating and has_binding_ext:"},{"line_number":410,"context_line":"                    # Attempt to delete all port bindings on the host and raise"},{"line_number":411,"context_line":"                    # any errors at the end."},{"line_number":412,"context_line":"                    exc \u003d None"},{"line_number":413,"context_line":"                    for port in ports:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_04968ea1","line":410,"in_reply_to":"5f7c97a3_09746703","updated":"2018-07-26 18:57:07.000000000","message":"Done","commit_id":"5ea5aa332e247592d5b21ebc34fa3f4284994dfc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9245aa08d08dee0b8625d87b36ebef7377322c3b","unresolved":false,"context_lines":[{"line_number":407,"context_line":"                # the current instance.host."},{"line_number":408,"context_line":"                has_binding_ext \u003d self.supports_port_binding_extension(context)"},{"line_number":409,"context_line":"                if port_migrating and has_binding_ext:"},{"line_number":410,"context_line":"                    # Attempt to delete all port bindings on the host and raise"},{"line_number":411,"context_line":"                    # any errors at the end."},{"line_number":412,"context_line":"                    exc \u003d None"},{"line_number":413,"context_line":"                    for port in ports:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_8f64ffe7","line":410,"in_reply_to":"5f7c97a3_21dec0da","updated":"2018-07-26 14:23:13.000000000","message":"Are those stack traces different in each exception? I think they all come from the same place so for me that is just redundant information. We raise the last one so we eventually get one stack in the logs.","commit_id":"5ea5aa332e247592d5b21ebc34fa3f4284994dfc"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7736856167e01c1e9600f2595a9ef55b752bfa2b","unresolved":false,"context_lines":[{"line_number":407,"context_line":"                # the current instance.host."},{"line_number":408,"context_line":"                has_binding_ext \u003d self.supports_port_binding_extension(context)"},{"line_number":409,"context_line":"                if port_migrating and has_binding_ext:"},{"line_number":410,"context_line":"                    # Attempt to delete all port bindings on the host and raise"},{"line_number":411,"context_line":"                    # any errors at the end."},{"line_number":412,"context_line":"                    exc \u003d None"},{"line_number":413,"context_line":"                    for port in ports:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_09746703","line":410,"in_reply_to":"5f7c97a3_2935a3a7","updated":"2018-07-26 18:32:35.000000000","message":"That last thing would be fine.","commit_id":"5ea5aa332e247592d5b21ebc34fa3f4284994dfc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"36873c67102bd8e87b4ba6b534d5c47428422c2d","unresolved":false,"context_lines":[{"line_number":407,"context_line":"                # the current instance.host."},{"line_number":408,"context_line":"                has_binding_ext \u003d self.supports_port_binding_extension(context)"},{"line_number":409,"context_line":"                if port_migrating and has_binding_ext:"},{"line_number":410,"context_line":"                    # Attempt to delete all port bindings on the host and raise"},{"line_number":411,"context_line":"                    # any errors at the end."},{"line_number":412,"context_line":"                    exc \u003d None"},{"line_number":413,"context_line":"                    for port in ports:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_2935a3a7","line":410,"in_reply_to":"5f7c97a3_8f22bf01","updated":"2018-07-26 18:21:52.000000000","message":"I don\u0027t think we need LOG.exception, and nothing currently handling PortBindingDeletionFailed is logging it as an exception to get the stacktrace.\n\nAlternatively, I could store off sys.exc_info() and reraise:\n\nhttps://pythonhosted.org/six/#six.reraise\n\nI\u0027m not entirely sure how kosher that is in python 3 where it expects things to be raised within an exception handler block, but I assume that\u0027s why six has a reraise function.\n\nOtherwise I\u0027m OK with just keeping track of the port bindings that failed to be deleted and write a generic exception raise for that as Eric suggested.","commit_id":"5ea5aa332e247592d5b21ebc34fa3f4284994dfc"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f102179116caadfa257b57161361685064324056","unresolved":false,"context_lines":[{"line_number":407,"context_line":"                # the current instance.host."},{"line_number":408,"context_line":"                has_binding_ext \u003d self.supports_port_binding_extension(context)"},{"line_number":409,"context_line":"                if port_migrating and has_binding_ext:"},{"line_number":410,"context_line":"                    # Attempt to delete all port bindings on the host and raise"},{"line_number":411,"context_line":"                    # any errors at the end."},{"line_number":412,"context_line":"                    exc \u003d None"},{"line_number":413,"context_line":"                    for port in ports:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_8f22bf01","line":410,"in_reply_to":"5f7c97a3_8f64ffe7","updated":"2018-07-26 14:36:29.000000000","message":"It\u0027s not a question of whether they\u0027re different for each exception; it\u0027s the fact that the `raise exc` on L422 will show the stack trace that got us to L422, not the stack trace that got us to L420. It may well be the case that each exception would be the same, but if it\u0027s the repetition that bugs you, we could put in a flag so we only log once. It\u0027s the loss of the original exception context that I\u0027m griping about.","commit_id":"5ea5aa332e247592d5b21ebc34fa3f4284994dfc"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"fc9e94d6aaf04a0e652f2a657ffd65489011fcf7","unresolved":false,"context_lines":[{"line_number":416,"context_line":"                        try:"},{"line_number":417,"context_line":"                            self.delete_port_binding("},{"line_number":418,"context_line":"                                context, port[\u0027id\u0027], host)"},{"line_number":419,"context_line":"                        except exception.PortBindingDeletionFailed:"},{"line_number":420,"context_line":"                            # delete_port_binding will log an error for each"},{"line_number":421,"context_line":"                            # failure but since we\u0027re iterating a list we want"},{"line_number":422,"context_line":"                            # to keep track of all failures to build a generic"},{"line_number":423,"context_line":"                            # exception to raise"},{"line_number":424,"context_line":"                            failed_port_ids.append(port[\u0027id\u0027])"},{"line_number":425,"context_line":"                    if failed_port_ids:"},{"line_number":426,"context_line":"                        msg \u003d (_(\"Failed to delete binding for port(s) \""},{"line_number":427,"context_line":"                                 \"%(port_ids)s and host %(host)s.\") %"},{"line_number":428,"context_line":"                               {\u0027port_ids\u0027: \u0027,\u0027.join(failed_port_ids),"},{"line_number":429,"context_line":"                                \u0027host\u0027: host})"},{"line_number":430,"context_line":"                        raise exception.PortBindingDeletionFailed(msg)"},{"line_number":431,"context_line":"            elif port_migrating:"},{"line_number":432,"context_line":"                # Setup the port profile"},{"line_number":433,"context_line":"                self._setup_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_5678a4c0","line":430,"range":{"start_line":419,"start_character":0,"end_line":430,"end_character":70},"updated":"2018-07-27 21:41:22.000000000","message":"Yup, nice.","commit_id":"f0b9d5204f3f3361341f4ee9270c7266447a07c6"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9064fcb8506fd37e0222ca06af690ce06609b737","unresolved":false,"context_lines":[{"line_number":7602,"context_line":"                      instance\u003dinstance)"},{"line_number":7603,"context_line":"            vif_plug_nw_info \u003d network_info"},{"line_number":7604,"context_line":"        # Retry operation is necessary because continuous live migration"},{"line_number":7605,"context_line":"        # requests to the same host causes concurrent requests to iptables,"},{"line_number":7606,"context_line":"        # then it complains."},{"line_number":7607,"context_line":"        max_retry \u003d CONF.live_migration_retry_count"},{"line_number":7608,"context_line":"        for cnt in range(max_retry):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_c1b4ac83","line":7605,"range":{"start_line":7605,"start_character":36,"end_line":7605,"end_character":42},"updated":"2018-07-19 16:02:25.000000000","message":"cause","commit_id":"5ea5aa332e247592d5b21ebc34fa3f4284994dfc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"36873c67102bd8e87b4ba6b534d5c47428422c2d","unresolved":false,"context_lines":[{"line_number":7602,"context_line":"                      instance\u003dinstance)"},{"line_number":7603,"context_line":"            vif_plug_nw_info \u003d network_info"},{"line_number":7604,"context_line":"        # Retry operation is necessary because continuous live migration"},{"line_number":7605,"context_line":"        # requests to the same host causes concurrent requests to iptables,"},{"line_number":7606,"context_line":"        # then it complains."},{"line_number":7607,"context_line":"        max_retry \u003d CONF.live_migration_retry_count"},{"line_number":7608,"context_line":"        for cnt in range(max_retry):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_e96d6bcb","line":7605,"range":{"start_line":7605,"start_character":36,"end_line":7605,"end_character":42},"in_reply_to":"5f7c97a3_c1b4ac83","updated":"2018-07-26 18:21:52.000000000","message":"Done","commit_id":"5ea5aa332e247592d5b21ebc34fa3f4284994dfc"}]}
