)]}'
{"nova/compute/api.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3c0f0333a5ab7dce694d7f2882b56c5b40a5400d","unresolved":false,"context_lines":[{"line_number":3884,"context_line":""},{"line_number":3885,"context_line":"        filters \u003d {\u0027instance_uuid\u0027: instance.uuid,"},{"line_number":3886,"context_line":"                   \u0027migration_type\u0027: \u0027evacuation\u0027}"},{"line_number":3887,"context_line":"        migrations \u003d objects.MIgrationsList.get_by_filters(context, filters)"},{"line_number":3888,"context_line":"        if migrations:"},{"line_number":3889,"context_line":"            return migrations[0].dest_compute"},{"line_number":3890,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_61d1a0fb","line":3887,"updated":"2016-10-04 19:58:35.000000000","message":"We should be able to tell if the instance is in migrating state by looking at instance.migration_context, right? And probably get the source/dest hosts out of that as well without having to do this extra (large) query?","commit_id":"0bc5c66c78b85200ce43f27459d529f2148bfed9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"688ee353302ed0af9e5961f1442ef2af5263e62f","unresolved":false,"context_lines":[{"line_number":3875,"context_line":"                context, instances_by_host[host], events_by_host[host])"},{"line_number":3876,"context_line":""},{"line_number":3877,"context_line":"    def _get_destination_host(self, context, instance):"},{"line_number":3878,"context_line":"        if instance.obj_attr_is_set(\u0027migration_context\u0027):"},{"line_number":3879,"context_line":"            migration_id \u003d instance.migration_context.migration_id"},{"line_number":3880,"context_line":"            migration \u003d objects.Migration.get_by_id(context, migration_id)"},{"line_number":3881,"context_line":"            if migration.migration_type \u003d\u003d \u0027evacuation\u0027:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a95cdbc_817831c6","line":3878,"updated":"2016-10-05 21:14:02.000000000","message":"Looks to me like this will never be set by default when we query for an instance. You would want it to lazy-load in this case, but the best thing would be to make sure we query it in the api before we call this so we\u0027re doing it in one database operation.\n\nHave you tested this? Because this should never be set, I\u0027m not sure how this is ever working :)","commit_id":"1c97c7dd96baa4a0d7dec5a9b1c799f94984b458"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"688ee353302ed0af9e5961f1442ef2af5263e62f","unresolved":false,"context_lines":[{"line_number":3878,"context_line":"        if instance.obj_attr_is_set(\u0027migration_context\u0027):"},{"line_number":3879,"context_line":"            migration_id \u003d instance.migration_context.migration_id"},{"line_number":3880,"context_line":"            migration \u003d objects.Migration.get_by_id(context, migration_id)"},{"line_number":3881,"context_line":"            if migration.migration_type \u003d\u003d \u0027evacuation\u0027:"},{"line_number":3882,"context_line":"                dest_compute \u003d migration.dest_compute"},{"line_number":3883,"context_line":"                LOG.debug(\u0027Instance %(instance)s is migrating, \u0027"},{"line_number":3884,"context_line":"                          \u0027using destination compute %(host)s \u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a95cdbc_a5fff8ff","line":3881,"updated":"2016-10-05 21:14:02.000000000","message":"So there was code at some point to do this for live migration as well. I thought that merged, but I don\u0027t see it where I was expecting it to be. I\u0027m kinda thinking that we should just always blast to both hosts for any kind of migration to avoid this being a problem elsewhere. What do you think?","commit_id":"1c97c7dd96baa4a0d7dec5a9b1c799f94984b458"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"688ee353302ed0af9e5961f1442ef2af5263e62f","unresolved":false,"context_lines":[{"line_number":3886,"context_line":"                                                    \u0027host\u0027: dest_compute})"},{"line_number":3887,"context_line":"                return dest_compute"},{"line_number":3888,"context_line":"        else:"},{"line_number":3889,"context_line":"            LOG.debug(\u0027Instance %(instance)s is NOT migrating, \u0027"},{"line_number":3890,"context_line":"                      \u0027using its compute %(host)s \u0027"},{"line_number":3891,"context_line":"                      \u0027for external events.\u0027 % {\u0027instance\u0027: instance.uuid,"},{"line_number":3892,"context_line":"                                                \u0027host\u0027: instance.host})"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a95cdbc_651ed064","line":3889,"updated":"2016-10-05 21:14:02.000000000","message":"This is probably too verbose even for debug. Almost all of the time we\u0027re hitting this case. We already log for each instance in the REST API code, and I just added host to that recently.","commit_id":"1c97c7dd96baa4a0d7dec5a9b1c799f94984b458"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3aff7bf1164fe7900bf47b9a23c519e86e0beb2d","unresolved":false,"context_lines":[{"line_number":3875,"context_line":"                context, instances_by_host[host], events_by_host[host])"},{"line_number":3876,"context_line":""},{"line_number":3877,"context_line":"    def _get_destination_host(self, context, instance):"},{"line_number":3878,"context_line":"        if instance.obj_attr_is_set(\u0027migration_context\u0027):"},{"line_number":3879,"context_line":"            migration_id \u003d instance.migration_context.migration_id"},{"line_number":3880,"context_line":"            migration \u003d objects.Migration.get_by_id(context, migration_id)"},{"line_number":3881,"context_line":"            if migration.migration_type \u003d\u003d \u0027evacuation\u0027:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_eecabda0","line":3878,"updated":"2016-10-05 23:20:16.000000000","message":"I think you should not do this because:\n\n 1. If it\u0027s not loaded for some reason, we better lazy-load it.\n    We can look for tell-tale logs that this is happening and figure\n    out why.\n 2. If it\u0027s not loaded, this will silently not include the extra host *and*\n    will profess falsely in the logs that the instance is not in\n    a migration.\n 3. If it\u0027s properly loaded and the instance is not in a migration, this \n    property _will_ be set and it will be None, which will cause you to\n    crash on the next line.\n\nYou should check for None-ness here.","commit_id":"6e46a571f4407eabb9674e4d40fb2f64b879c729"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"089ee6f1b5064818a91e2b3b44e48d85e33d53d2","unresolved":false,"context_lines":[{"line_number":3859,"context_line":"        events_by_host \u003d collections.defaultdict(list)"},{"line_number":3860,"context_line":"        hosts_by_instance \u003d collections.defaultdict(list)"},{"line_number":3861,"context_line":"        for instance in instances:"},{"line_number":3862,"context_line":"            host \u003d self._get_destination_host(context, instance)"},{"line_number":3863,"context_line":"            instances_by_host[host].append(instance)"},{"line_number":3864,"context_line":"            hosts_by_instance[instance.uuid].append(host)"},{"line_number":3865,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_ab731e7f","line":3862,"updated":"2016-10-06 17:04:25.000000000","message":"Hmm, this is just adding one host per instance. My point earlier was that we should just send the event to both hosts involved in any migration. Thus, this should return a list, IMHO.","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"bbf2e5ff1d2aa7ac0e853395f5166010117dfb9e","unresolved":false,"context_lines":[{"line_number":3859,"context_line":"        events_by_host \u003d collections.defaultdict(list)"},{"line_number":3860,"context_line":"        hosts_by_instance \u003d collections.defaultdict(list)"},{"line_number":3861,"context_line":"        for instance in instances:"},{"line_number":3862,"context_line":"            host \u003d self._get_destination_host(context, instance)"},{"line_number":3863,"context_line":"            instances_by_host[host].append(instance)"},{"line_number":3864,"context_line":"            hosts_by_instance[instance.uuid].append(host)"},{"line_number":3865,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_5c833e04","line":3862,"in_reply_to":"1a95cdbc_ab731e7f","updated":"2016-10-08 15:40:03.000000000","message":"At first I was wondering \"If it\u0027s a live migration, is there a chance that the source host will think the instance is still on it and attempt to do something?\" But then I remembered sending the event to the source host is *existing* behaviour, so yeah, you\u0027re right. We should send all events to both source and dest if migrating.","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"089ee6f1b5064818a91e2b3b44e48d85e33d53d2","unresolved":false,"context_lines":[{"line_number":3861,"context_line":"        for instance in instances:"},{"line_number":3862,"context_line":"            host \u003d self._get_destination_host(context, instance)"},{"line_number":3863,"context_line":"            instances_by_host[host].append(instance)"},{"line_number":3864,"context_line":"            hosts_by_instance[instance.uuid].append(host)"},{"line_number":3865,"context_line":""},{"line_number":3866,"context_line":"        for event in events:"},{"line_number":3867,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_8b13c20c","line":3864,"updated":"2016-10-06 17:04:25.000000000","message":"This seems to assume that there will be multiple, but you\u0027re only adding the one host (either instance.host, or the destination) here.","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"bbf2e5ff1d2aa7ac0e853395f5166010117dfb9e","unresolved":false,"context_lines":[{"line_number":3861,"context_line":"        for instance in instances:"},{"line_number":3862,"context_line":"            host \u003d self._get_destination_host(context, instance)"},{"line_number":3863,"context_line":"            instances_by_host[host].append(instance)"},{"line_number":3864,"context_line":"            hosts_by_instance[instance.uuid].append(host)"},{"line_number":3865,"context_line":""},{"line_number":3866,"context_line":"        for event in events:"},{"line_number":3867,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_3d18e774","line":3864,"in_reply_to":"1a95cdbc_8b13c20c","updated":"2016-10-08 15:40:03.000000000","message":"Done","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"089ee6f1b5064818a91e2b3b44e48d85e33d53d2","unresolved":false,"context_lines":[{"line_number":3865,"context_line":""},{"line_number":3866,"context_line":"        for event in events:"},{"line_number":3867,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"},{"line_number":3868,"context_line":"                events_by_host[host].append(event)"},{"line_number":3869,"context_line":""},{"line_number":3870,"context_line":"        for host in instances_by_host:"},{"line_number":3871,"context_line":"            # TODO(salv-orlando): Handle exceptions raised by the rpc api layer"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_2b2d4e46","line":3868,"updated":"2016-10-06 17:04:25.000000000","message":"Also appears to imply multiple hosts, even though there will only ever be one.","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"bbf2e5ff1d2aa7ac0e853395f5166010117dfb9e","unresolved":false,"context_lines":[{"line_number":3865,"context_line":""},{"line_number":3866,"context_line":"        for event in events:"},{"line_number":3867,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"},{"line_number":3868,"context_line":"                events_by_host[host].append(event)"},{"line_number":3869,"context_line":""},{"line_number":3870,"context_line":"        for host in instances_by_host:"},{"line_number":3871,"context_line":"            # TODO(salv-orlando): Handle exceptions raised by the rpc api layer"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_1d1deb65","line":3868,"in_reply_to":"1a95cdbc_2b2d4e46","updated":"2016-10-08 15:40:03.000000000","message":"Done","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"089ee6f1b5064818a91e2b3b44e48d85e33d53d2","unresolved":false,"context_lines":[{"line_number":3878,"context_line":"        if not hasattr(instance, \u0027migration_context\u0027):"},{"line_number":3879,"context_line":"            # If migration_context is not loaded at this point for some reason,"},{"line_number":3880,"context_line":"            # lazy-load it"},{"line_number":3881,"context_line":"            instance.obj_load_attr(\u0027migration_context\u0027)"},{"line_number":3882,"context_line":""},{"line_number":3883,"context_line":"        if instance.migration_context is not None:"},{"line_number":3884,"context_line":"            migration_id \u003d instance.migration_context.migration_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_481c6077","line":3881,"updated":"2016-10-06 17:04:25.000000000","message":"You don\u0027t need this. Just using it will load it for you if it\u0027s not loaded. And, it will log that it had to load it.","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"bbf2e5ff1d2aa7ac0e853395f5166010117dfb9e","unresolved":false,"context_lines":[{"line_number":3878,"context_line":"        if not hasattr(instance, \u0027migration_context\u0027):"},{"line_number":3879,"context_line":"            # If migration_context is not loaded at this point for some reason,"},{"line_number":3880,"context_line":"            # lazy-load it"},{"line_number":3881,"context_line":"            instance.obj_load_attr(\u0027migration_context\u0027)"},{"line_number":3882,"context_line":""},{"line_number":3883,"context_line":"        if instance.migration_context is not None:"},{"line_number":3884,"context_line":"            migration_id \u003d instance.migration_context.migration_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_777ff0df","line":3881,"in_reply_to":"1a95cdbc_481c6077","updated":"2016-10-08 15:40:03.000000000","message":"Done","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"089ee6f1b5064818a91e2b3b44e48d85e33d53d2","unresolved":false,"context_lines":[{"line_number":3883,"context_line":"        if instance.migration_context is not None:"},{"line_number":3884,"context_line":"            migration_id \u003d instance.migration_context.migration_id"},{"line_number":3885,"context_line":"            migration \u003d objects.Migration.get_by_id(context, migration_id)"},{"line_number":3886,"context_line":"            if migration.migration_type \u003d\u003d \u0027evacuation\u0027:"},{"line_number":3887,"context_line":"                dest_compute \u003d migration.dest_compute"},{"line_number":3888,"context_line":"                LOG.debug(\u0027Instance %(instance)s is evacuating, \u0027"},{"line_number":3889,"context_line":"                          \u0027using destination compute %(host)s \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_cb36aae6","line":3886,"updated":"2016-10-06 17:04:25.000000000","message":"Again, I think we should just do this for all migration types.","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"bbf2e5ff1d2aa7ac0e853395f5166010117dfb9e","unresolved":false,"context_lines":[{"line_number":3883,"context_line":"        if instance.migration_context is not None:"},{"line_number":3884,"context_line":"            migration_id \u003d instance.migration_context.migration_id"},{"line_number":3885,"context_line":"            migration \u003d objects.Migration.get_by_id(context, migration_id)"},{"line_number":3886,"context_line":"            if migration.migration_type \u003d\u003d \u0027evacuation\u0027:"},{"line_number":3887,"context_line":"                dest_compute \u003d migration.dest_compute"},{"line_number":3888,"context_line":"                LOG.debug(\u0027Instance %(instance)s is evacuating, \u0027"},{"line_number":3889,"context_line":"                          \u0027using destination compute %(host)s \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_5d293389","line":3886,"in_reply_to":"1a95cdbc_cb36aae6","updated":"2016-10-08 15:40:03.000000000","message":"Done","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"089ee6f1b5064818a91e2b3b44e48d85e33d53d2","unresolved":false,"context_lines":[{"line_number":3885,"context_line":"            migration \u003d objects.Migration.get_by_id(context, migration_id)"},{"line_number":3886,"context_line":"            if migration.migration_type \u003d\u003d \u0027evacuation\u0027:"},{"line_number":3887,"context_line":"                dest_compute \u003d migration.dest_compute"},{"line_number":3888,"context_line":"                LOG.debug(\u0027Instance %(instance)s is evacuating, \u0027"},{"line_number":3889,"context_line":"                          \u0027using destination compute %(host)s \u0027"},{"line_number":3890,"context_line":"                          \u0027for external events.\u0027 % {\u0027instance\u0027: instance.uuid,"},{"line_number":3891,"context_line":"                                                    \u0027host\u0027: dest_compute})"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_6b583633","line":3888,"range":{"start_line":3888,"start_character":52,"end_line":3888,"end_character":62},"updated":"2016-10-06 17:04:25.000000000","message":"s/evacuating/migrating/","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"bbf2e5ff1d2aa7ac0e853395f5166010117dfb9e","unresolved":false,"context_lines":[{"line_number":3885,"context_line":"            migration \u003d objects.Migration.get_by_id(context, migration_id)"},{"line_number":3886,"context_line":"            if migration.migration_type \u003d\u003d \u0027evacuation\u0027:"},{"line_number":3887,"context_line":"                dest_compute \u003d migration.dest_compute"},{"line_number":3888,"context_line":"                LOG.debug(\u0027Instance %(instance)s is evacuating, \u0027"},{"line_number":3889,"context_line":"                          \u0027using destination compute %(host)s \u0027"},{"line_number":3890,"context_line":"                          \u0027for external events.\u0027 % {\u0027instance\u0027: instance.uuid,"},{"line_number":3891,"context_line":"                                                    \u0027host\u0027: dest_compute})"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_7d2c2f99","line":3888,"range":{"start_line":3888,"start_character":52,"end_line":3888,"end_character":62},"in_reply_to":"1a95cdbc_6b583633","updated":"2016-10-08 15:40:03.000000000","message":"Done","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"089ee6f1b5064818a91e2b3b44e48d85e33d53d2","unresolved":false,"context_lines":[{"line_number":3891,"context_line":"                                                    \u0027host\u0027: dest_compute})"},{"line_number":3892,"context_line":"                return dest_compute"},{"line_number":3893,"context_line":"        else:"},{"line_number":3894,"context_line":"            LOG.debug(\u0027Instance %(instance)s is NOT evacuating, \u0027"},{"line_number":3895,"context_line":"                      \u0027using its compute %(host)s \u0027"},{"line_number":3896,"context_line":"                      \u0027for external events.\u0027 % {\u0027instance\u0027: instance.uuid,"},{"line_number":3897,"context_line":"                                                \u0027host\u0027: instance.host})"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_4b2a9a7f","line":3894,"updated":"2016-10-06 17:04:25.000000000","message":"Again, I think this is too verbose. Most instances are not evacuating (or migrating) all the time.","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"bbf2e5ff1d2aa7ac0e853395f5166010117dfb9e","unresolved":false,"context_lines":[{"line_number":3891,"context_line":"                                                    \u0027host\u0027: dest_compute})"},{"line_number":3892,"context_line":"                return dest_compute"},{"line_number":3893,"context_line":"        else:"},{"line_number":3894,"context_line":"            LOG.debug(\u0027Instance %(instance)s is NOT evacuating, \u0027"},{"line_number":3895,"context_line":"                      \u0027using its compute %(host)s \u0027"},{"line_number":3896,"context_line":"                      \u0027for external events.\u0027 % {\u0027instance\u0027: instance.uuid,"},{"line_number":3897,"context_line":"                                                \u0027host\u0027: instance.host})"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a95cdbc_9d1f3b5a","line":3894,"in_reply_to":"1a95cdbc_4b2a9a7f","updated":"2016-10-08 15:40:03.000000000","message":"Done","commit_id":"bbc4c83bd12f03c7a9cfbeddc82063a963be7111"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"94ccd89f6ac1b7122fb32b49b93d0d56601e8904","unresolved":false,"context_lines":[{"line_number":3886,"context_line":"        # according to host"},{"line_number":3887,"context_line":"        instances_by_host \u003d collections.defaultdict(list)"},{"line_number":3888,"context_line":"        events_by_host \u003d collections.defaultdict(list)"},{"line_number":3889,"context_line":"        hosts_by_instance \u003d collections.defaultdict(list)"},{"line_number":3890,"context_line":"        for instance in instances:"},{"line_number":3891,"context_line":"            instances_by_host[instance.host].append(instance)"},{"line_number":3892,"context_line":"            hosts_by_instance[instance.uuid].append(instance.host)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a95cdbc_df7b52f3","line":3889,"range":{"start_line":3889,"start_character":52,"end_line":3889,"end_character":56},"updated":"2016-10-10 14:50:03.000000000","message":"Was just thinking about this.. shouldn\u0027t we make this a set? I think you\u0027ll end up with multiple duplicate hosts here which might make us send the same event twice because of the code on L3904.. or something.","commit_id":"5c36ba702c3a448fe600b5a22ab77feab3defb72"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"04b4fd09634bc2f6d8be02e0ca8b028267adc9e7","unresolved":false,"context_lines":[{"line_number":3886,"context_line":"        # according to host"},{"line_number":3887,"context_line":"        instances_by_host \u003d collections.defaultdict(list)"},{"line_number":3888,"context_line":"        events_by_host \u003d collections.defaultdict(list)"},{"line_number":3889,"context_line":"        hosts_by_instance \u003d collections.defaultdict(list)"},{"line_number":3890,"context_line":"        for instance in instances:"},{"line_number":3891,"context_line":"            instances_by_host[instance.host].append(instance)"},{"line_number":3892,"context_line":"            hosts_by_instance[instance.uuid].append(instance.host)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa6399be_5af2d59b","line":3889,"range":{"start_line":3889,"start_character":52,"end_line":3889,"end_character":56},"in_reply_to":"1a95cdbc_df7b52f3","updated":"2016-10-10 19:16:25.000000000","message":"Done","commit_id":"5c36ba702c3a448fe600b5a22ab77feab3defb72"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"94ccd89f6ac1b7122fb32b49b93d0d56601e8904","unresolved":false,"context_lines":[{"line_number":3897,"context_line":"                          \u0027%(host)s \u0027 % {\u0027instance\u0027: instance.uuid,"},{"line_number":3898,"context_line":"                                         \u0027host\u0027: dest_compute})"},{"line_number":3899,"context_line":"                instances_by_host[dest_compute].append(instance)"},{"line_number":3900,"context_line":"                hosts_by_instance[instance.uuid].append(dest_compute)"},{"line_number":3901,"context_line":""},{"line_number":3902,"context_line":"        for event in events:"},{"line_number":3903,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a95cdbc_bff6865a","line":3900,"updated":"2016-10-10 14:50:03.000000000","message":"So this block might be improperly named, and also might be buggy. You\u0027re going with \"dest_compute\" because of the evacuation bug you have in your head, but it isn\u0027t always going to be the destination compute that we might be missing, especially with post-copy live migration and any other random changes we might make in the future.\n\nSo, IMHO, we should always add instance.host, and then if there is a migration_context, add any of the hosts specified there that we don\u0027t already have (source or dest). What do you think?","commit_id":"5c36ba702c3a448fe600b5a22ab77feab3defb72"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"04b4fd09634bc2f6d8be02e0ca8b028267adc9e7","unresolved":false,"context_lines":[{"line_number":3897,"context_line":"                          \u0027%(host)s \u0027 % {\u0027instance\u0027: instance.uuid,"},{"line_number":3898,"context_line":"                                         \u0027host\u0027: dest_compute})"},{"line_number":3899,"context_line":"                instances_by_host[dest_compute].append(instance)"},{"line_number":3900,"context_line":"                hosts_by_instance[instance.uuid].append(dest_compute)"},{"line_number":3901,"context_line":""},{"line_number":3902,"context_line":"        for event in events:"},{"line_number":3903,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa6399be_3aad2132","line":3900,"in_reply_to":"1a95cdbc_bff6865a","updated":"2016-10-10 19:16:25.000000000","message":"I think that all makes sense. I keep being afraid of sending an event to a host that\u0027s not supposed to get one, but unless the host specifically sets it up so that it processes the event, the event will just be ignored.\n\nSo if we end up with a bug where a hosts processes an event that it shouldn\u0027t process, that should get fixed in the compute code, not the event dispatcher code.","commit_id":"5c36ba702c3a448fe600b5a22ab77feab3defb72"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"94ccd89f6ac1b7122fb32b49b93d0d56601e8904","unresolved":false,"context_lines":[{"line_number":3911,"context_line":"                context, instances_by_host[host], events_by_host[host],"},{"line_number":3912,"context_line":"                host\u003dhost)"},{"line_number":3913,"context_line":""},{"line_number":3914,"context_line":"    def _get_destination_compute(self, context, instance):"},{"line_number":3915,"context_line":"        if instance.migration_context is not None:"},{"line_number":3916,"context_line":"            migration_id \u003d instance.migration_context.migration_id"},{"line_number":3917,"context_line":"            migration \u003d objects.Migration.get_by_id(context, migration_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a95cdbc_ffc1eee4","line":3914,"updated":"2016-10-10 14:50:03.000000000","message":"Per above, I think this should just return both hosts and we should merge those with instance.host for the complete \"anywhere the instance might be\" behavior.","commit_id":"5c36ba702c3a448fe600b5a22ab77feab3defb72"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"04b4fd09634bc2f6d8be02e0ca8b028267adc9e7","unresolved":false,"context_lines":[{"line_number":3911,"context_line":"                context, instances_by_host[host], events_by_host[host],"},{"line_number":3912,"context_line":"                host\u003dhost)"},{"line_number":3913,"context_line":""},{"line_number":3914,"context_line":"    def _get_destination_compute(self, context, instance):"},{"line_number":3915,"context_line":"        if instance.migration_context is not None:"},{"line_number":3916,"context_line":"            migration_id \u003d instance.migration_context.migration_id"},{"line_number":3917,"context_line":"            migration \u003d objects.Migration.get_by_id(context, migration_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa6399be_5aaad51a","line":3914,"in_reply_to":"1a95cdbc_ffc1eee4","updated":"2016-10-10 19:16:25.000000000","message":"Done","commit_id":"5c36ba702c3a448fe600b5a22ab77feab3defb72"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"03776e4b970c01df8a8e5fbf0d6dce7861f75149","unresolved":false,"context_lines":[{"line_number":3886,"context_line":"        # according to host"},{"line_number":3887,"context_line":"        instances_by_host \u003d collections.defaultdict(list)"},{"line_number":3888,"context_line":"        events_by_host \u003d collections.defaultdict(list)"},{"line_number":3889,"context_line":"        hosts_by_instance \u003d collections.defaultdict(list)"},{"line_number":3890,"context_line":"        for instance in instances:"},{"line_number":3891,"context_line":"            for host in self._get_relevant_hosts(context, instance):"},{"line_number":3892,"context_line":"                instances_by_host[host].append(instance)"}],"source_content_type":"text/x-python","patch_set":10,"id":"da6895a0_40a8e91f","line":3889,"updated":"2016-10-23 06:50:35.000000000","message":"Note to others: this looks like it might have dupes, but shouldn\u0027t because we use a set inside _get_relevant_hosts().","commit_id":"a5b920a197c70d2ae08a1e1335d979857f923b4f"}]}
