)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"f0284d9446a904e4d9761f5bdc13df01cac05755","unresolved":false,"context_lines":[{"line_number":1162,"context_line":"        self._migration_executor.shutdown(wait\u003dFalse)"},{"line_number":1163,"context_line":"        # Step2: For any queued migrations, set the migration status to"},{"line_number":1164,"context_line":"        # \u0027cancelled\u0027."},{"line_number":1165,"context_line":"        for migration in self._waiting_live_migrations:"},{"line_number":1166,"context_line":"            self._set_migration_status(migration, \u0027cancelled\u0027)"},{"line_number":1167,"context_line":"        # Step3: Cancel all the running tasks"},{"line_number":1168,"context_line":"        for future_obj in self._migration_executor._work_queue:"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_db7c6b22","line":1165,"range":{"start_line":1165,"start_character":8,"end_line":1165,"end_character":55},"updated":"2018-05-03 01:28:25.000000000","message":"this is wrong...","commit_id":"07b86a774aedd5499af2fa2ef3616f83fb37f7e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"0cf40d99b5a0136318e10e91e04f00a6baf911f2","unresolved":false,"context_lines":[{"line_number":1164,"context_line":"        # \u0027cancelled\u0027."},{"line_number":1165,"context_line":"        for migration in self._waiting_live_migrations:"},{"line_number":1166,"context_line":"            self._set_migration_status(migration, \u0027cancelled\u0027)"},{"line_number":1167,"context_line":"        # Step3: Cancel all the running tasks"},{"line_number":1168,"context_line":"        for future_obj in self._migration_executor._work_queue:"},{"line_number":1169,"context_line":"            future_obj.cancel()"},{"line_number":1170,"context_line":""},{"line_number":1171,"context_line":""},{"line_number":1172,"context_line":"    def pre_start_hook(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_1b83c306","line":1169,"range":{"start_line":1167,"start_character":0,"end_line":1169,"end_character":31},"updated":"2018-05-03 01:27:55.000000000","message":"Maybe I should create a new queue to represent the migrations in status other than \"queued\", in order to avoid access the protected field \"_work_queue\" directly.","commit_id":"07b86a774aedd5499af2fa2ef3616f83fb37f7e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"925770052e792bf5ca2f1bd4139adf8c6d3a896f","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"import base64"},{"line_number":29,"context_line":"import binascii"},{"line_number":30,"context_line":"from concurrent import futures as c_futures"},{"line_number":31,"context_line":"import contextlib"},{"line_number":32,"context_line":"import functools"},{"line_number":33,"context_line":"import inspect"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_a81edf09","line":30,"range":{"start_line":30,"start_character":34,"end_line":30,"end_character":43},"updated":"2018-05-04 18:42:16.000000000","message":"nit: just leave it as futures\n\nThis also needs to be listed in requirements.txt for py27:\n\nhttps://github.com/openstack/requirements/blob/master/global-requirements.txt#L64","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aab2d5de7c259734f626dd976b8f24191be6ec1","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"import base64"},{"line_number":29,"context_line":"import binascii"},{"line_number":30,"context_line":"from concurrent import futures as c_futures"},{"line_number":31,"context_line":"import contextlib"},{"line_number":32,"context_line":"import functools"},{"line_number":33,"context_line":"import inspect"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_13286884","line":30,"range":{"start_line":30,"start_character":34,"end_line":30,"end_character":43},"in_reply_to":"5f7c97a3_a81edf09","updated":"2018-05-04 20:40:38.000000000","message":"Done","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b1d05401314d431188c7bcc3e838fdf585fb792d","unresolved":false,"context_lines":[{"line_number":522,"context_line":"        else:"},{"line_number":523,"context_line":"            self._build_semaphore \u003d compute_utils.UnlimitedSemaphore()"},{"line_number":524,"context_line":"        if max(CONF.max_concurrent_live_migrations, 0) !\u003d 0:"},{"line_number":525,"context_line":"            self._migration_executor \u003d c_futures.ThreadPoolExecutor("},{"line_number":526,"context_line":"                max_workers\u003dCONF.max_concurrent_live_migrations)"},{"line_number":527,"context_line":"        else:"},{"line_number":528,"context_line":"            self._migration_executor \u003d c_futures.ThreadPoolExecutor()"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_887683d8","line":525,"range":{"start_line":525,"start_character":17,"end_line":525,"end_character":36},"updated":"2018-05-04 18:48:15.000000000","message":"Rename as _live_migration_executor - so people don\u0027t get confused with cold migration.","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aab2d5de7c259734f626dd976b8f24191be6ec1","unresolved":false,"context_lines":[{"line_number":522,"context_line":"        else:"},{"line_number":523,"context_line":"            self._build_semaphore \u003d compute_utils.UnlimitedSemaphore()"},{"line_number":524,"context_line":"        if max(CONF.max_concurrent_live_migrations, 0) !\u003d 0:"},{"line_number":525,"context_line":"            self._migration_executor \u003d c_futures.ThreadPoolExecutor("},{"line_number":526,"context_line":"                max_workers\u003dCONF.max_concurrent_live_migrations)"},{"line_number":527,"context_line":"        else:"},{"line_number":528,"context_line":"            self._migration_executor \u003d c_futures.ThreadPoolExecutor()"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_332d6495","line":525,"range":{"start_line":525,"start_character":17,"end_line":525,"end_character":36},"in_reply_to":"5f7c97a3_887683d8","updated":"2018-05-04 20:40:38.000000000","message":"Done","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"925770052e792bf5ca2f1bd4139adf8c6d3a896f","unresolved":false,"context_lines":[{"line_number":525,"context_line":"            self._migration_executor \u003d c_futures.ThreadPoolExecutor("},{"line_number":526,"context_line":"                max_workers\u003dCONF.max_concurrent_live_migrations)"},{"line_number":527,"context_line":"        else:"},{"line_number":528,"context_line":"            self._migration_executor \u003d c_futures.ThreadPoolExecutor()"},{"line_number":529,"context_line":"        self._waiting_live_migrations \u003d {}"},{"line_number":530,"context_line":"        self._failed_builds \u003d 0"},{"line_number":531,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_68c6876a","line":528,"updated":"2018-05-04 18:42:16.000000000","message":"There is a slight behavior change here:\n\nhttps://docs.python.org/3.5/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor\n\n\"Changed in version 3.5: If max_workers is None or not given, it will default to the number of processors on the machine, multiplied by 5, assuming that ThreadPoolExecutor is often used to overlap I/O instead of CPU work and the number of workers should be higher than the number of workers for ProcessPoolExecutor.\"\n\nSo we\u0027re no longer unlimited, but ncpu * 5 seems sane since max_concurrent_live_migrations defaults to 1 anyway, and I don\u0027t think anyone running a large system with lets say 32 cores is going to want to be running 160 concurrent live migrations.","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aab2d5de7c259734f626dd976b8f24191be6ec1","unresolved":false,"context_lines":[{"line_number":525,"context_line":"            self._migration_executor \u003d c_futures.ThreadPoolExecutor("},{"line_number":526,"context_line":"                max_workers\u003dCONF.max_concurrent_live_migrations)"},{"line_number":527,"context_line":"        else:"},{"line_number":528,"context_line":"            self._migration_executor \u003d c_futures.ThreadPoolExecutor()"},{"line_number":529,"context_line":"        self._waiting_live_migrations \u003d {}"},{"line_number":530,"context_line":"        self._failed_builds \u003d 0"},{"line_number":531,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_f3260cb8","line":528,"in_reply_to":"5f7c97a3_68c6876a","updated":"2018-05-04 20:40:38.000000000","message":"This can be mentioned in the commit message.","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"925770052e792bf5ca2f1bd4139adf8c6d3a896f","unresolved":false,"context_lines":[{"line_number":526,"context_line":"                max_workers\u003dCONF.max_concurrent_live_migrations)"},{"line_number":527,"context_line":"        else:"},{"line_number":528,"context_line":"            self._migration_executor \u003d c_futures.ThreadPoolExecutor()"},{"line_number":529,"context_line":"        self._waiting_live_migrations \u003d {}"},{"line_number":530,"context_line":"        self._failed_builds \u003d 0"},{"line_number":531,"context_line":""},{"line_number":532,"context_line":"        super(ComputeManager, self).__init__(service_name\u003d\"compute\","}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_08a113aa","line":529,"updated":"2018-05-04 18:42:16.000000000","message":"nit: Leave a comment about what this dict is using for keys and values.","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aab2d5de7c259734f626dd976b8f24191be6ec1","unresolved":false,"context_lines":[{"line_number":526,"context_line":"                max_workers\u003dCONF.max_concurrent_live_migrations)"},{"line_number":527,"context_line":"        else:"},{"line_number":528,"context_line":"            self._migration_executor \u003d c_futures.ThreadPoolExecutor()"},{"line_number":529,"context_line":"        self._waiting_live_migrations \u003d {}"},{"line_number":530,"context_line":"        self._failed_builds \u003d 0"},{"line_number":531,"context_line":""},{"line_number":532,"context_line":"        super(ComputeManager, self).__init__(service_name\u003d\"compute\","}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_933b18d0","line":529,"in_reply_to":"5f7c97a3_08a113aa","updated":"2018-05-04 20:40:38.000000000","message":"Done","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"925770052e792bf5ca2f1bd4139adf8c6d3a896f","unresolved":false,"context_lines":[{"line_number":1162,"context_line":"        self._migration_executor.shutdown(wait\u003dFalse)"},{"line_number":1163,"context_line":"        # Step2: For any queued migrations, set the migration status to"},{"line_number":1164,"context_line":"        # \u0027cancelled\u0027."},{"line_number":1165,"context_line":"        for key, value in self._waiting_live_migrations.items():"},{"line_number":1166,"context_line":"            self._set_migration_status(value[0], \u0027cancelled\u0027)"},{"line_number":1167,"context_line":"        # Step3: Cancel all the running tasks"},{"line_number":1168,"context_line":"        for future_obj in self._migration_executor._work_queue:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_a8f6df8e","line":1165,"range":{"start_line":1165,"start_character":12,"end_line":1165,"end_character":22},"updated":"2018-05-04 18:42:16.000000000","message":"You only need the values here, right? So just do this:\n\nfor migration, future in self._waiting_live_migrations.values():\n   self._set_migration_status(migration, \u0027cancelled\u0027)\n   if future.cancel():\n       LOG.info(\u0027Live migration successfully cancelled.\u0027,\n                instance_uuid\u003dmigration.instance_uuid)\n   else:\n       LOG.warning(\u0027Unable to cancel running live migration.\u0027,\n                   instance_uuid\u003dmigration.instance_uuid)","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aab2d5de7c259734f626dd976b8f24191be6ec1","unresolved":false,"context_lines":[{"line_number":1162,"context_line":"        self._migration_executor.shutdown(wait\u003dFalse)"},{"line_number":1163,"context_line":"        # Step2: For any queued migrations, set the migration status to"},{"line_number":1164,"context_line":"        # \u0027cancelled\u0027."},{"line_number":1165,"context_line":"        for key, value in self._waiting_live_migrations.items():"},{"line_number":1166,"context_line":"            self._set_migration_status(value[0], \u0027cancelled\u0027)"},{"line_number":1167,"context_line":"        # Step3: Cancel all the running tasks"},{"line_number":1168,"context_line":"        for future_obj in self._migration_executor._work_queue:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_b33894d3","line":1165,"range":{"start_line":1165,"start_character":12,"end_line":1165,"end_character":22},"in_reply_to":"5f7c97a3_a8f6df8e","updated":"2018-05-04 20:40:38.000000000","message":"Done","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"925770052e792bf5ca2f1bd4139adf8c6d3a896f","unresolved":false,"context_lines":[{"line_number":1165,"context_line":"        for key, value in self._waiting_live_migrations.items():"},{"line_number":1166,"context_line":"            self._set_migration_status(value[0], \u0027cancelled\u0027)"},{"line_number":1167,"context_line":"        # Step3: Cancel all the running tasks"},{"line_number":1168,"context_line":"        for future_obj in self._migration_executor._work_queue:"},{"line_number":1169,"context_line":"            future_obj.cancel()"},{"line_number":1170,"context_line":""},{"line_number":1171,"context_line":"    def pre_start_hook(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_e8393741","line":1168,"range":{"start_line":1168,"start_character":51,"end_line":1168,"end_character":62},"updated":"2018-05-04 18:42:16.000000000","message":"We should never be touching the internals of a standard library data structure like this. The Future class has it\u0027s own cancel(), see above, and:\n\nhttps://docs.python.org/3.5/library/concurrent.futures.html#concurrent.futures.Future.cancel","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aab2d5de7c259734f626dd976b8f24191be6ec1","unresolved":false,"context_lines":[{"line_number":1165,"context_line":"        for key, value in self._waiting_live_migrations.items():"},{"line_number":1166,"context_line":"            self._set_migration_status(value[0], \u0027cancelled\u0027)"},{"line_number":1167,"context_line":"        # Step3: Cancel all the running tasks"},{"line_number":1168,"context_line":"        for future_obj in self._migration_executor._work_queue:"},{"line_number":1169,"context_line":"            future_obj.cancel()"},{"line_number":1170,"context_line":""},{"line_number":1171,"context_line":"    def pre_start_hook(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_533580d9","line":1168,"range":{"start_line":1168,"start_character":51,"end_line":1168,"end_character":62},"in_reply_to":"5f7c97a3_e8393741","updated":"2018-05-04 20:40:38.000000000","message":"Done","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ff3644941e04e0157e34551720d3308e06990f38","unresolved":false,"context_lines":[{"line_number":1166,"context_line":"            self._set_migration_status(value[0], \u0027cancelled\u0027)"},{"line_number":1167,"context_line":"        # Step3: Cancel all the running tasks"},{"line_number":1168,"context_line":"        for future_obj in self._migration_executor._work_queue:"},{"line_number":1169,"context_line":"            future_obj.cancel()"},{"line_number":1170,"context_line":""},{"line_number":1171,"context_line":"    def pre_start_hook(self):"},{"line_number":1172,"context_line":"        \"\"\"After the service is initialized, but before we fully bring"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_a8001f36","line":1169,"range":{"start_line":1169,"start_character":12,"end_line":1169,"end_character":31},"updated":"2018-05-04 18:43:28.000000000","message":"If this returns False, we probably shouldn\u0027t set the migration status to cancelled. So we should probably try to cancel() first and then set the migration status.","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aab2d5de7c259734f626dd976b8f24191be6ec1","unresolved":false,"context_lines":[{"line_number":1166,"context_line":"            self._set_migration_status(value[0], \u0027cancelled\u0027)"},{"line_number":1167,"context_line":"        # Step3: Cancel all the running tasks"},{"line_number":1168,"context_line":"        for future_obj in self._migration_executor._work_queue:"},{"line_number":1169,"context_line":"            future_obj.cancel()"},{"line_number":1170,"context_line":""},{"line_number":1171,"context_line":"    def pre_start_hook(self):"},{"line_number":1172,"context_line":"        \"\"\"After the service is initialized, but before we fully bring"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_7332fcf3","line":1169,"range":{"start_line":1169,"start_character":12,"end_line":1169,"end_character":31},"in_reply_to":"5f7c97a3_a8001f36","updated":"2018-05-04 20:40:38.000000000","message":"Done","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"925770052e792bf5ca2f1bd4139adf8c6d3a896f","unresolved":false,"context_lines":[{"line_number":6150,"context_line":"            self._set_migration_status(migration, \u0027error\u0027)"},{"line_number":6151,"context_line":"            raise exception.LiveMigrationNotSubmitted("},{"line_number":6152,"context_line":"                migration_uuid\u003dmigration.uuid, instance_uuid\u003dinstance.uuid)"},{"line_number":6153,"context_line":"        if migration.uuid in self._waiting_live_migrations:"},{"line_number":6154,"context_line":"            self._waiting_live_migrations[migration.uuid] \u003d (migration, fut)"},{"line_number":6155,"context_line":""},{"line_number":6156,"context_line":"    @wrap_exception()"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_e8eb77ad","line":6153,"updated":"2018-05-04 18:42:16.000000000","message":"This is weird, because at this point migration.uuid should always be in self._waiting_live_migrations because we just set it above. We should just map the migration uuid to the Future in the try block:\n\ntry:\n    future \u003d self._migration_executor.submit(...)\n    self._waiting_live_migrations[migration.uuid] \u003d future\nexcept RuntimeError:\n    ...","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aab2d5de7c259734f626dd976b8f24191be6ec1","unresolved":false,"context_lines":[{"line_number":6150,"context_line":"            self._set_migration_status(migration, \u0027error\u0027)"},{"line_number":6151,"context_line":"            raise exception.LiveMigrationNotSubmitted("},{"line_number":6152,"context_line":"                migration_uuid\u003dmigration.uuid, instance_uuid\u003dinstance.uuid)"},{"line_number":6153,"context_line":"        if migration.uuid in self._waiting_live_migrations:"},{"line_number":6154,"context_line":"            self._waiting_live_migrations[migration.uuid] \u003d (migration, fut)"},{"line_number":6155,"context_line":""},{"line_number":6156,"context_line":"    @wrap_exception()"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_134dc871","line":6153,"in_reply_to":"5f7c97a3_e8eb77ad","updated":"2018-05-04 20:40:38.000000000","message":"Done","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ae5f485763a747fad0ee4f37079ea48c4d321325","unresolved":false,"context_lines":[{"line_number":530,"context_line":"            # Starting in python 3.5, this is technically bounded, but it\u0027s"},{"line_number":531,"context_line":"            # ncpu * 5 which is probably much higher than anyone would sanely"},{"line_number":532,"context_line":"            # use for concurrently running live migrations."},{"line_number":533,"context_line":"            self._live_migration_executor \u003d futures.ThreadPoolExecutor()"},{"line_number":534,"context_line":"        # This is a dict, keyed by migration uuid, to a two-item tuple of"},{"line_number":535,"context_line":"        # migration object and Future for the queued live migration."},{"line_number":536,"context_line":"        self._waiting_live_migrations \u003d {}"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_aec82755","line":533,"updated":"2018-05-04 20:43:26.000000000","message":"We did validate that ThreadPoolExecutor will do the right thing under eventlet and start green threads not real threads right?","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"eb21e62b2157866b6373a357d605ec446159611a","unresolved":false,"context_lines":[{"line_number":530,"context_line":"            # Starting in python 3.5, this is technically bounded, but it\u0027s"},{"line_number":531,"context_line":"            # ncpu * 5 which is probably much higher than anyone would sanely"},{"line_number":532,"context_line":"            # use for concurrently running live migrations."},{"line_number":533,"context_line":"            self._live_migration_executor \u003d futures.ThreadPoolExecutor()"},{"line_number":534,"context_line":"        # This is a dict, keyed by migration uuid, to a two-item tuple of"},{"line_number":535,"context_line":"        # migration object and Future for the queued live migration."},{"line_number":536,"context_line":"        self._waiting_live_migrations \u003d {}"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_4184b85e","line":533,"in_reply_to":"5f7c97a3_aec82755","updated":"2018-05-07 09:23:45.000000000","message":"I will have to check this","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aab2d5de7c259734f626dd976b8f24191be6ec1","unresolved":false,"context_lines":[{"line_number":1164,"context_line":"        self.driver.cleanup_host(host\u003dself.host)"},{"line_number":1165,"context_line":"        self._cleanup_live_migrations_in_pool()"},{"line_number":1166,"context_line":""},{"line_number":1167,"context_line":"    def _cleanup_live_migrations_in_pool(self):"},{"line_number":1168,"context_line":"        # Shutdown the pool so we don\u0027t get new requests."},{"line_number":1169,"context_line":"        self._live_migration_executor.shutdown(wait\u003dFalse)"},{"line_number":1170,"context_line":"        # For any queued migrations, cancel the migration and update"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_ce98036c","line":1167,"range":{"start_line":1167,"start_character":8,"end_line":1167,"end_character":40},"updated":"2018-05-04 20:40:38.000000000","message":"There are no unit tests for this.","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"eb21e62b2157866b6373a357d605ec446159611a","unresolved":false,"context_lines":[{"line_number":1164,"context_line":"        self.driver.cleanup_host(host\u003dself.host)"},{"line_number":1165,"context_line":"        self._cleanup_live_migrations_in_pool()"},{"line_number":1166,"context_line":""},{"line_number":1167,"context_line":"    def _cleanup_live_migrations_in_pool(self):"},{"line_number":1168,"context_line":"        # Shutdown the pool so we don\u0027t get new requests."},{"line_number":1169,"context_line":"        self._live_migration_executor.shutdown(wait\u003dFalse)"},{"line_number":1170,"context_line":"        # For any queued migrations, cancel the migration and update"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_a1602cd0","line":1167,"range":{"start_line":1167,"start_character":8,"end_line":1167,"end_character":40},"in_reply_to":"5f7c97a3_ce98036c","updated":"2018-05-07 09:23:45.000000000","message":"Will add one","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ae5f485763a747fad0ee4f37079ea48c4d321325","unresolved":false,"context_lines":[{"line_number":6157,"context_line":"            future \u003d self._live_migration_executor.submit("},{"line_number":6158,"context_line":"                self._do_live_migration, context, dest, instance,"},{"line_number":6159,"context_line":"                block_migration, migration, migrate_data)"},{"line_number":6160,"context_line":"            self._waiting_live_migrations[migration.uuid] \u003d (migration, future)"},{"line_number":6161,"context_line":"        except RuntimeError:"},{"line_number":6162,"context_line":"            # ThreadPoolExecutor.submit will raise RuntimeError if the pool"},{"line_number":6163,"context_line":"            # is shutdown, which happens in _cleanup_live_migrations_in_pool."}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_6e744f36","line":6160,"updated":"2018-05-04 20:43:26.000000000","message":"I\u0027m guessing that you\u0027re indexing here by migration uuid instead of instance uuid because of how the cancel call will/does work? Seems like we should be storing by instance uuid here, especially since we may need to cancel a migration by instance uuid if something else happens other than a migration cancel (like maybe a virt event or something).\n\nWould it be okay to index by instance here or is there a reason we need to do it by migration?\n\nAlso, the way you have it, if something wend sideweird, we could end up with two migrations for the same instance in the set, but if we store by instance, we could assert that it\u0027s not in the running set before we put it there.","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"eb21e62b2157866b6373a357d605ec446159611a","unresolved":false,"context_lines":[{"line_number":6157,"context_line":"            future \u003d self._live_migration_executor.submit("},{"line_number":6158,"context_line":"                self._do_live_migration, context, dest, instance,"},{"line_number":6159,"context_line":"                block_migration, migration, migrate_data)"},{"line_number":6160,"context_line":"            self._waiting_live_migrations[migration.uuid] \u003d (migration, future)"},{"line_number":6161,"context_line":"        except RuntimeError:"},{"line_number":6162,"context_line":"            # ThreadPoolExecutor.submit will raise RuntimeError if the pool"},{"line_number":6163,"context_line":"            # is shutdown, which happens in _cleanup_live_migrations_in_pool."}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_a1e34c33","line":6160,"in_reply_to":"5f7c97a3_6e744f36","updated":"2018-05-07 09:23:45.000000000","message":"We are abort live_migration with migration id, and also instance uuid is provided, actually after double check, I think we might use instance.uuid since the API is using migration_id not migration_uuid, seems better to use instance.uuid and do a simple match latter.","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"665b84003c1fdf91a0441744a7a2db8c276714a4","unresolved":false,"context_lines":[{"line_number":6157,"context_line":"            future \u003d self._live_migration_executor.submit("},{"line_number":6158,"context_line":"                self._do_live_migration, context, dest, instance,"},{"line_number":6159,"context_line":"                block_migration, migration, migrate_data)"},{"line_number":6160,"context_line":"            self._waiting_live_migrations[migration.uuid] \u003d (migration, future)"},{"line_number":6161,"context_line":"        except RuntimeError:"},{"line_number":6162,"context_line":"            # ThreadPoolExecutor.submit will raise RuntimeError if the pool"},{"line_number":6163,"context_line":"            # is shutdown, which happens in _cleanup_live_migrations_in_pool."}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_c6521968","line":6160,"in_reply_to":"5f7c97a3_a1e34c33","updated":"2018-05-07 13:49:57.000000000","message":"Yeah.","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aab2d5de7c259734f626dd976b8f24191be6ec1","unresolved":false,"context_lines":[{"line_number":6158,"context_line":"                self._do_live_migration, context, dest, instance,"},{"line_number":6159,"context_line":"                block_migration, migration, migrate_data)"},{"line_number":6160,"context_line":"            self._waiting_live_migrations[migration.uuid] \u003d (migration, future)"},{"line_number":6161,"context_line":"        except RuntimeError:"},{"line_number":6162,"context_line":"            # ThreadPoolExecutor.submit will raise RuntimeError if the pool"},{"line_number":6163,"context_line":"            # is shutdown, which happens in _cleanup_live_migrations_in_pool."},{"line_number":6164,"context_line":"            LOG.exception(\u0027Migration %s failed to submit as the compute \u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_0e8fdb23","line":6161,"updated":"2018-05-04 20:40:38.000000000","message":"We need a unit test for this scenario.","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ae5f485763a747fad0ee4f37079ea48c4d321325","unresolved":false,"context_lines":[{"line_number":6161,"context_line":"        except RuntimeError:"},{"line_number":6162,"context_line":"            # ThreadPoolExecutor.submit will raise RuntimeError if the pool"},{"line_number":6163,"context_line":"            # is shutdown, which happens in _cleanup_live_migrations_in_pool."},{"line_number":6164,"context_line":"            LOG.exception(\u0027Migration %s failed to submit as the compute \u0027"},{"line_number":6165,"context_line":"                          \u0027service is shutting down.\u0027, migration.uuid,"},{"line_number":6166,"context_line":"                          instance\u003dinstance)"},{"line_number":6167,"context_line":"            self._set_migration_status(migration, \u0027error\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_ee9dbf59","line":6164,"updated":"2018-05-04 20:43:26.000000000","message":"We don\u0027t need to log exception here since this is a legit situation, right?","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"665b84003c1fdf91a0441744a7a2db8c276714a4","unresolved":false,"context_lines":[{"line_number":6161,"context_line":"        except RuntimeError:"},{"line_number":6162,"context_line":"            # ThreadPoolExecutor.submit will raise RuntimeError if the pool"},{"line_number":6163,"context_line":"            # is shutdown, which happens in _cleanup_live_migrations_in_pool."},{"line_number":6164,"context_line":"            LOG.exception(\u0027Migration %s failed to submit as the compute \u0027"},{"line_number":6165,"context_line":"                          \u0027service is shutting down.\u0027, migration.uuid,"},{"line_number":6166,"context_line":"                          instance\u003dinstance)"},{"line_number":6167,"context_line":"            self._set_migration_status(migration, \u0027error\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_a6da7de6","line":6164,"in_reply_to":"5f7c97a3_c1c52890","updated":"2018-05-07 13:49:57.000000000","message":"Info is probably good.","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"eb21e62b2157866b6373a357d605ec446159611a","unresolved":false,"context_lines":[{"line_number":6161,"context_line":"        except RuntimeError:"},{"line_number":6162,"context_line":"            # ThreadPoolExecutor.submit will raise RuntimeError if the pool"},{"line_number":6163,"context_line":"            # is shutdown, which happens in _cleanup_live_migrations_in_pool."},{"line_number":6164,"context_line":"            LOG.exception(\u0027Migration %s failed to submit as the compute \u0027"},{"line_number":6165,"context_line":"                          \u0027service is shutting down.\u0027, migration.uuid,"},{"line_number":6166,"context_line":"                          instance\u003dinstance)"},{"line_number":6167,"context_line":"            self._set_migration_status(migration, \u0027error\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_c1c52890","line":6164,"in_reply_to":"5f7c97a3_ee9dbf59","updated":"2018-05-07 09:23:45.000000000","message":"Hmm maybe a INFO or DEBUG level?","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ae5f485763a747fad0ee4f37079ea48c4d321325","unresolved":false,"context_lines":[{"line_number":6165,"context_line":"                          \u0027service is shutting down.\u0027, migration.uuid,"},{"line_number":6166,"context_line":"                          instance\u003dinstance)"},{"line_number":6167,"context_line":"            self._set_migration_status(migration, \u0027error\u0027)"},{"line_number":6168,"context_line":"            raise exception.LiveMigrationNotSubmitted("},{"line_number":6169,"context_line":"                migration_uuid\u003dmigration.uuid, instance_uuid\u003dinstance.uuid)"},{"line_number":6170,"context_line":""},{"line_number":6171,"context_line":"    @wrap_exception()"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_ae9fc74e","line":6168,"updated":"2018-05-04 20:43:26.000000000","message":"I\u0027m also not sure we need to raise something specific to this situation here as we haven\u0027t started anything yet, but...","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"665b84003c1fdf91a0441744a7a2db8c276714a4","unresolved":false,"context_lines":[{"line_number":6165,"context_line":"                          \u0027service is shutting down.\u0027, migration.uuid,"},{"line_number":6166,"context_line":"                          instance\u003dinstance)"},{"line_number":6167,"context_line":"            self._set_migration_status(migration, \u0027error\u0027)"},{"line_number":6168,"context_line":"            raise exception.LiveMigrationNotSubmitted("},{"line_number":6169,"context_line":"                migration_uuid\u003dmigration.uuid, instance_uuid\u003dinstance.uuid)"},{"line_number":6170,"context_line":""},{"line_number":6171,"context_line":"    @wrap_exception()"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_a6883dc6","line":6168,"in_reply_to":"5f7c97a3_0141e00b","updated":"2018-05-07 13:49:57.000000000","message":"Yes, raise something. I\u0027m just saying we could probably get away without a specialized exception and just use MigrationError. But, not a huge deal, just a nit.","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"eb21e62b2157866b6373a357d605ec446159611a","unresolved":false,"context_lines":[{"line_number":6165,"context_line":"                          \u0027service is shutting down.\u0027, migration.uuid,"},{"line_number":6166,"context_line":"                          instance\u003dinstance)"},{"line_number":6167,"context_line":"            self._set_migration_status(migration, \u0027error\u0027)"},{"line_number":6168,"context_line":"            raise exception.LiveMigrationNotSubmitted("},{"line_number":6169,"context_line":"                migration_uuid\u003dmigration.uuid, instance_uuid\u003dinstance.uuid)"},{"line_number":6170,"context_line":""},{"line_number":6171,"context_line":"    @wrap_exception()"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_0141e00b","line":6168,"in_reply_to":"5f7c97a3_ae9fc74e","updated":"2018-05-07 09:23:45.000000000","message":"I was thinking maybe we should return something to the user in this situation?","commit_id":"a28f4cd6767a9c05c99b7ab0246d0c35343c0559"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7777d4f9bb621498eaf3973578d99cb34a6a1e02","unresolved":false,"context_lines":[{"line_number":1166,"context_line":""},{"line_number":1167,"context_line":"    def _cleanup_live_migrations_in_pool(self):"},{"line_number":1168,"context_line":"        # Shutdown the pool so we don\u0027t get new requests."},{"line_number":1169,"context_line":"        self._live_migration_executor.shutdown(wait\u003dFalse)"},{"line_number":1170,"context_line":"        # For any queued migrations, cancel the migration and update"},{"line_number":1171,"context_line":"        # its status."},{"line_number":1172,"context_line":"        for migration, future in self._waiting_live_migrations.values():"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_60bef7b4","line":1169,"range":{"start_line":1169,"start_character":38,"end_line":1169,"end_character":46},"updated":"2018-05-14 21:34:37.000000000","message":"Your unit tests should assert that this is called.","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"61a43dd0cae16edf95179ac105835c839bd894ea","unresolved":false,"context_lines":[{"line_number":1166,"context_line":""},{"line_number":1167,"context_line":"    def _cleanup_live_migrations_in_pool(self):"},{"line_number":1168,"context_line":"        # Shutdown the pool so we don\u0027t get new requests."},{"line_number":1169,"context_line":"        self._live_migration_executor.shutdown(wait\u003dFalse)"},{"line_number":1170,"context_line":"        # For any queued migrations, cancel the migration and update"},{"line_number":1171,"context_line":"        # its status."},{"line_number":1172,"context_line":"        for migration, future in self._waiting_live_migrations.values():"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_5e8b9bc1","line":1169,"range":{"start_line":1169,"start_character":38,"end_line":1169,"end_character":46},"in_reply_to":"5f7c97a3_60bef7b4","updated":"2018-05-15 01:21:43.000000000","message":"Ah,I did do it in the first version, somehow it rolled back, seems due to I used too much \"undo\" in IDE, I will add it.","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7777d4f9bb621498eaf3973578d99cb34a6a1e02","unresolved":false,"context_lines":[{"line_number":1172,"context_line":"        for migration, future in self._waiting_live_migrations.values():"},{"line_number":1173,"context_line":"            # If we got here before the Future was submitted then we need"},{"line_number":1174,"context_line":"            # to move on since there isn\u0027t anything we can do."},{"line_number":1175,"context_line":"            if future is None:"},{"line_number":1176,"context_line":"                continue"},{"line_number":1177,"context_line":"            if future.cancel():"},{"line_number":1178,"context_line":"                self._set_migration_status(migration, \u0027cancelled\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_20b47fd0","line":1175,"range":{"start_line":1175,"start_character":12,"end_line":1175,"end_character":30},"updated":"2018-05-14 21:34:37.000000000","message":"You don\u0027t have coverage for this. You can adjust your test to have two entries in _waiting_live_migrations and one maps to None for this case.","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"61a43dd0cae16edf95179ac105835c839bd894ea","unresolved":false,"context_lines":[{"line_number":1172,"context_line":"        for migration, future in self._waiting_live_migrations.values():"},{"line_number":1173,"context_line":"            # If we got here before the Future was submitted then we need"},{"line_number":1174,"context_line":"            # to move on since there isn\u0027t anything we can do."},{"line_number":1175,"context_line":"            if future is None:"},{"line_number":1176,"context_line":"                continue"},{"line_number":1177,"context_line":"            if future.cancel():"},{"line_number":1178,"context_line":"                self._set_migration_status(migration, \u0027cancelled\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_7e8697bb","line":1175,"range":{"start_line":1175,"start_character":12,"end_line":1175,"end_character":30},"in_reply_to":"5f7c97a3_20b47fd0","updated":"2018-05-15 01:21:43.000000000","message":"Done","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"d95babb58f28be9b4865c7c132efdb394ff81ac3","unresolved":false,"context_lines":[{"line_number":1169,"context_line":"        self._live_migration_executor.shutdown(wait\u003dFalse)"},{"line_number":1170,"context_line":"        # For any queued migrations, cancel the migration and update"},{"line_number":1171,"context_line":"        # its status."},{"line_number":1172,"context_line":"        for migration, future in self._waiting_live_migrations.values():"},{"line_number":1173,"context_line":"            # If we got here before the Future was submitted then we need"},{"line_number":1174,"context_line":"            # to move on since there isn\u0027t anything we can do."},{"line_number":1175,"context_line":"            if future is None:"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_827bcd79","line":1172,"updated":"2018-06-05 00:05:51.000000000","message":"Why not just do this iteration + cancel first; then do\n\n  self._live_migration_executor.shutdown(wait\u003dTrue)\n\nThat way you aren\u0027t just leaving threads running that should not be.","commit_id":"44b502b7601b7279c0221801e150b4ae8633b31b"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"ccf0f7a06935d611e39ec619aa434d6fb5fd2b33","unresolved":false,"context_lines":[{"line_number":1169,"context_line":"        self._live_migration_executor.shutdown(wait\u003dFalse)"},{"line_number":1170,"context_line":"        # For any queued migrations, cancel the migration and update"},{"line_number":1171,"context_line":"        # its status."},{"line_number":1172,"context_line":"        for migration, future in self._waiting_live_migrations.values():"},{"line_number":1173,"context_line":"            # If we got here before the Future was submitted then we need"},{"line_number":1174,"context_line":"            # to move on since there isn\u0027t anything we can do."},{"line_number":1175,"context_line":"            if future is None:"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_e533ab12","line":1172,"in_reply_to":"5f7c97a3_827bcd79","updated":"2018-06-05 02:17:34.000000000","message":"we have to shutdown the queue first to avoid new process submitted.","commit_id":"44b502b7601b7279c0221801e150b4ae8633b31b"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"d95babb58f28be9b4865c7c132efdb394ff81ac3","unresolved":false,"context_lines":[{"line_number":6094,"context_line":"        self._set_migration_status(migration, \u0027preparing\u0027)"},{"line_number":6095,"context_line":"        # NOTE(Kevin_Zheng): The migration is no longer in the `queued` status"},{"line_number":6096,"context_line":"        # so lets remove it from the mapping."},{"line_number":6097,"context_line":"        self._waiting_live_migrations.pop(instance.uuid)"},{"line_number":6098,"context_line":""},{"line_number":6099,"context_line":"        try:"},{"line_number":6100,"context_line":"            if (\u0027block_migration\u0027 in migrate_data and"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_a2f5a9ef","line":6097,"updated":"2018-06-05 00:05:51.000000000","message":"I\u0027d recommend just using the following:\n\nhttps://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Future.add_done_callback\n\nThen add a done callback that does the pop instead of doing it here (which may or may not get called, depending on what exceptions happen).","commit_id":"44b502b7601b7279c0221801e150b4ae8633b31b"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"ccf0f7a06935d611e39ec619aa434d6fb5fd2b33","unresolved":false,"context_lines":[{"line_number":6094,"context_line":"        self._set_migration_status(migration, \u0027preparing\u0027)"},{"line_number":6095,"context_line":"        # NOTE(Kevin_Zheng): The migration is no longer in the `queued` status"},{"line_number":6096,"context_line":"        # so lets remove it from the mapping."},{"line_number":6097,"context_line":"        self._waiting_live_migrations.pop(instance.uuid)"},{"line_number":6098,"context_line":""},{"line_number":6099,"context_line":"        try:"},{"line_number":6100,"context_line":"            if (\u0027block_migration\u0027 in migrate_data and"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_45861fbd","line":6097,"in_reply_to":"5f7c97a3_a2f5a9ef","updated":"2018-06-05 02:17:34.000000000","message":"Hi, thanks for the adivse, but we are going to use this for some logics in abort live migration in the following patch.","commit_id":"44b502b7601b7279c0221801e150b4ae8633b31b"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"d95babb58f28be9b4865c7c132efdb394ff81ac3","unresolved":false,"context_lines":[{"line_number":6163,"context_line":"        # in order to be able to track and abort it in the future."},{"line_number":6164,"context_line":"        self._waiting_live_migrations[instance.uuid] \u003d (None, None)"},{"line_number":6165,"context_line":"        try:"},{"line_number":6166,"context_line":"            future \u003d self._live_migration_executor.submit("},{"line_number":6167,"context_line":"                self._do_live_migration, context, dest, instance,"},{"line_number":6168,"context_line":"                block_migration, migration, migrate_data)"},{"line_number":6169,"context_line":"            self._waiting_live_migrations[instance.uuid] \u003d (migration, future)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_a2804948","line":6166,"updated":"2018-06-05 00:05:51.000000000","message":"So there is no size limit to the backlog of items that can be submitted here (they all just end up in a queue); is that ok/acceptable?","commit_id":"44b502b7601b7279c0221801e150b4ae8633b31b"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"ccf0f7a06935d611e39ec619aa434d6fb5fd2b33","unresolved":false,"context_lines":[{"line_number":6163,"context_line":"        # in order to be able to track and abort it in the future."},{"line_number":6164,"context_line":"        self._waiting_live_migrations[instance.uuid] \u003d (None, None)"},{"line_number":6165,"context_line":"        try:"},{"line_number":6166,"context_line":"            future \u003d self._live_migration_executor.submit("},{"line_number":6167,"context_line":"                self._do_live_migration, context, dest, instance,"},{"line_number":6168,"context_line":"                block_migration, migration, migrate_data)"},{"line_number":6169,"context_line":"            self._waiting_live_migrations[instance.uuid] \u003d (migration, future)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_65831bab","line":6166,"in_reply_to":"5f7c97a3_a2804948","updated":"2018-06-05 02:17:34.000000000","message":"yeah, we just limit the number of concurrent jobs not the size of the whole queue here.","commit_id":"44b502b7601b7279c0221801e150b4ae8633b31b"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"5fc9b9e0fb89cc0f64e03ced054e0e9fb023d234","unresolved":false,"context_lines":[{"line_number":6094,"context_line":"        self._set_migration_status(migration, \u0027preparing\u0027)"},{"line_number":6095,"context_line":"        # NOTE(Kevin_Zheng): The migration is no longer in the `queued` status"},{"line_number":6096,"context_line":"        # so lets remove it from the mapping."},{"line_number":6097,"context_line":"        self._waiting_live_migrations.pop(instance.uuid)"},{"line_number":6098,"context_line":""},{"line_number":6099,"context_line":"        try:"},{"line_number":6100,"context_line":"            if (\u0027block_migration\u0027 in migrate_data and"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_914d269b","line":6097,"updated":"2018-06-06 21:42:42.000000000","message":"I\u0027d still recommend having a on done callback that pops this, even if it doesn\u0027t pop anything.","commit_id":"9d57f86c459335ba612a929d5fc372b7d73fc885"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"23d8ee51fd93aa691a91dffebd8ded10561d94bb","unresolved":false,"context_lines":[{"line_number":6094,"context_line":"        self._set_migration_status(migration, \u0027preparing\u0027)"},{"line_number":6095,"context_line":"        # NOTE(Kevin_Zheng): The migration is no longer in the `queued` status"},{"line_number":6096,"context_line":"        # so lets remove it from the mapping."},{"line_number":6097,"context_line":"        self._waiting_live_migrations.pop(instance.uuid)"},{"line_number":6098,"context_line":""},{"line_number":6099,"context_line":"        try:"},{"line_number":6100,"context_line":"            if (\u0027block_migration\u0027 in migrate_data and"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_45290435","line":6097,"in_reply_to":"5f7c97a3_914d269b","updated":"2018-06-07 01:44:42.000000000","message":"Hi, Thanks for the advise, after thinking about the whole process again, I still think this will make no difference, lets see what others think?","commit_id":"9d57f86c459335ba612a929d5fc372b7d73fc885"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"019ecec35286dbe7423854334354ed835e1e4d92","unresolved":false,"context_lines":[{"line_number":29,"context_line":"import binascii"},{"line_number":30,"context_line":"# If py2, concurrent.futures comes from the futures library otherwise it"},{"line_number":31,"context_line":"# comes from the py3 standard library."},{"line_number":32,"context_line":"from concurrent import futures"},{"line_number":33,"context_line":"import contextlib"},{"line_number":34,"context_line":"import functools"},{"line_number":35,"context_line":"import inspect"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_1d13d25d","line":32,"updated":"2018-06-13 18:49:54.000000000","message":"U can also use futurist here also, which is like a add-on library that adds a few nice things ontop of concurrent.futures.\n\nhttps://github.com/openstack/futurist","commit_id":"6b369d238ae87ff67c9a670c098475c76ba40eaa"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"e6920f17b0022210bf8524f866cd7348038ca645","unresolved":false,"context_lines":[{"line_number":29,"context_line":"import binascii"},{"line_number":30,"context_line":"# If py2, concurrent.futures comes from the futures library otherwise it"},{"line_number":31,"context_line":"# comes from the py3 standard library."},{"line_number":32,"context_line":"from concurrent import futures"},{"line_number":33,"context_line":"import contextlib"},{"line_number":34,"context_line":"import functools"},{"line_number":35,"context_line":"import inspect"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_9f8a7218","line":32,"in_reply_to":"5f7c97a3_1d13d25d","updated":"2018-06-14 01:15:53.000000000","message":"Thanks I will have a look on how it helps","commit_id":"6b369d238ae87ff67c9a670c098475c76ba40eaa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cec97b6c42fb08766ec2ece85f3ad265b86cb859","unresolved":false,"context_lines":[{"line_number":29,"context_line":"import binascii"},{"line_number":30,"context_line":"# If py2, concurrent.futures comes from the futures library otherwise it"},{"line_number":31,"context_line":"# comes from the py3 standard library."},{"line_number":32,"context_line":"from concurrent import futures"},{"line_number":33,"context_line":"import contextlib"},{"line_number":34,"context_line":"import functools"},{"line_number":35,"context_line":"import inspect"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_a9200eb3","line":32,"in_reply_to":"5f7c97a3_897992c6","updated":"2018-06-29 14:36:17.000000000","message":"The only advantage might be using something like futurist.GreenThreadPoolExecutor in case ThreadPoolExecutor doesn\u0027t play well with eventlet? Are there known cases of that happening in openstack?\n\nOtherwise it looks like these are the features:\n\nhttps://docs.openstack.org/futurist/latest/user/features.html\n\nIt would be nice if the docs on that library explained at some level in what cases you\u0027d want to use that over the futures or standard library, i.e. are there known applications for openstack situations that it would be needed, like the eventlet interaction?","commit_id":"6b369d238ae87ff67c9a670c098475c76ba40eaa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"010f16e1f3193e14f799f364b5afb9ed1626d545","unresolved":false,"context_lines":[{"line_number":29,"context_line":"import binascii"},{"line_number":30,"context_line":"# If py2, concurrent.futures comes from the futures library otherwise it"},{"line_number":31,"context_line":"# comes from the py3 standard library."},{"line_number":32,"context_line":"from concurrent import futures"},{"line_number":33,"context_line":"import contextlib"},{"line_number":34,"context_line":"import functools"},{"line_number":35,"context_line":"import inspect"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_897992c6","line":32,"in_reply_to":"5f7c97a3_9f8a7218","updated":"2018-06-29 14:32:15.000000000","message":"I saw that and noticed it\u0027s in global-requirements, but I\u0027d stick with what\u0027s in the standard library if possible to avoid running into an issue down the line where a 3rd party library could be no longer maintained.","commit_id":"6b369d238ae87ff67c9a670c098475c76ba40eaa"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"fde96bdc287e6b6037a2640026de46b4f0de6cc6","unresolved":false,"context_lines":[{"line_number":531,"context_line":"            # ncpu * 5 which is probably much higher than anyone would sanely"},{"line_number":532,"context_line":"            # use for concurrently running live migrations."},{"line_number":533,"context_line":"            self._live_migration_executor \u003d futures.ThreadPoolExecutor()"},{"line_number":534,"context_line":"        # This is a dict, keyed by migration uuid, to a two-item tuple of"},{"line_number":535,"context_line":"        # migration object and Future for the queued live migration."},{"line_number":536,"context_line":"        self._waiting_live_migrations \u003d {}"},{"line_number":537,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"5f7c97a3_05520237","line":534,"range":{"start_line":534,"start_character":35,"end_line":534,"end_character":49},"updated":"2018-07-16 22:47:31.000000000","message":"This isn\u0027t true according to the code. The dict is keyed by instance uuid.","commit_id":"79dac41fee178dabb547f4d7bc10609630767131"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"29a320ed0cc0ed69227b0f3575bc0bee8f276cef","unresolved":false,"context_lines":[{"line_number":531,"context_line":"            # ncpu * 5 which is probably much higher than anyone would sanely"},{"line_number":532,"context_line":"            # use for concurrently running live migrations."},{"line_number":533,"context_line":"            self._live_migration_executor \u003d futures.ThreadPoolExecutor()"},{"line_number":534,"context_line":"        # This is a dict, keyed by migration uuid, to a two-item tuple of"},{"line_number":535,"context_line":"        # migration object and Future for the queued live migration."},{"line_number":536,"context_line":"        self._waiting_live_migrations \u003d {}"},{"line_number":537,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"5f7c97a3_24dff767","line":534,"range":{"start_line":534,"start_character":35,"end_line":534,"end_character":49},"in_reply_to":"5f7c97a3_05520237","updated":"2018-07-17 08:14:17.000000000","message":"I will update in a new patch, in order to avoid all the rebases.","commit_id":"79dac41fee178dabb547f4d7bc10609630767131"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"88d07e8c77503feaccd7142d1edb5b7bdf696a40","unresolved":false,"context_lines":[{"line_number":531,"context_line":"            # ncpu * 5 which is probably much higher than anyone would sanely"},{"line_number":532,"context_line":"            # use for concurrently running live migrations."},{"line_number":533,"context_line":"            self._live_migration_executor \u003d futures.ThreadPoolExecutor()"},{"line_number":534,"context_line":"        # This is a dict, keyed by migration uuid, to a two-item tuple of"},{"line_number":535,"context_line":"        # migration object and Future for the queued live migration."},{"line_number":536,"context_line":"        self._waiting_live_migrations \u003d {}"},{"line_number":537,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"5f7c97a3_d30b6779","line":534,"range":{"start_line":534,"start_character":35,"end_line":534,"end_character":49},"in_reply_to":"5f7c97a3_24dff767","updated":"2018-07-17 11:43:20.000000000","message":"Hi, I have uploaded a patch https://review.openstack.org/#/c/583212/ it can be used also for all the nits from future reviews of the series.","commit_id":"79dac41fee178dabb547f4d7bc10609630767131"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"17df69b9ad0a4fe8f685db03d8f62e18e10b95df","unresolved":false,"context_lines":[{"line_number":531,"context_line":"            # ncpu * 5 which is probably much higher than anyone would sanely"},{"line_number":532,"context_line":"            # use for concurrently running live migrations."},{"line_number":533,"context_line":"            self._live_migration_executor \u003d futures.ThreadPoolExecutor()"},{"line_number":534,"context_line":"        # This is a dict, keyed by migration uuid, to a two-item tuple of"},{"line_number":535,"context_line":"        # migration object and Future for the queued live migration."},{"line_number":536,"context_line":"        self._waiting_live_migrations \u003d {}"},{"line_number":537,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"5f7c97a3_c61e3573","line":534,"range":{"start_line":534,"start_character":35,"end_line":534,"end_character":49},"in_reply_to":"5f7c97a3_d30b6779","updated":"2018-07-17 22:00:09.000000000","message":"Ack, thanks.","commit_id":"79dac41fee178dabb547f4d7bc10609630767131"}],"nova/exception.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"925770052e792bf5ca2f1bd4139adf8c6d3a896f","unresolved":false,"context_lines":[{"line_number":1820,"context_line":"class LiveMigrationNotSubmitted(NovaException):"},{"line_number":1821,"context_line":"    msg_fmt \u003d _(\"Live migration %(migration_uuid) for instance \""},{"line_number":1822,"context_line":"                \"%(instance_uuid) failed to submit as the compute service \""},{"line_number":1823,"context_line":"                \"is shutting down, and is unable to accept new requests.\")"},{"line_number":1824,"context_line":""},{"line_number":1825,"context_line":""},{"line_number":1826,"context_line":"class LiveMigrationWithOldNovaNotSupported(NovaException):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_68c20736","line":1823,"range":{"start_line":1823,"start_character":29,"end_line":1823,"end_character":34},"updated":"2018-05-04 18:42:16.000000000","message":"s/down,/down/","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8aab2d5de7c259734f626dd976b8f24191be6ec1","unresolved":false,"context_lines":[{"line_number":1820,"context_line":"class LiveMigrationNotSubmitted(NovaException):"},{"line_number":1821,"context_line":"    msg_fmt \u003d _(\"Live migration %(migration_uuid) for instance \""},{"line_number":1822,"context_line":"                \"%(instance_uuid) failed to submit as the compute service \""},{"line_number":1823,"context_line":"                \"is shutting down, and is unable to accept new requests.\")"},{"line_number":1824,"context_line":""},{"line_number":1825,"context_line":""},{"line_number":1826,"context_line":"class LiveMigrationWithOldNovaNotSupported(NovaException):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_33524415","line":1823,"range":{"start_line":1823,"start_character":29,"end_line":1823,"end_character":34},"in_reply_to":"5f7c97a3_68c20736","updated":"2018-05-04 20:40:38.000000000","message":"Done - I just re-worded this to be a more generic error message. The details about why we failed to submit for processing can be in the compute logs.","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"925770052e792bf5ca2f1bd4139adf8c6d3a896f","unresolved":false,"context_lines":[{"line_number":6836,"context_line":"        self.flags(max_concurrent_live_migrations\u003d123)"},{"line_number":6837,"context_line":"        self.assertEqual("},{"line_number":6838,"context_line":"            123,"},{"line_number":6839,"context_line":"            manager.ComputeManager()._migration_executor._max_workers)"},{"line_number":6840,"context_line":""},{"line_number":6841,"context_line":"    def test_max_concurrent_live_semaphore_unlimited(self):"},{"line_number":6842,"context_line":"        self.flags(max_concurrent_live_migrations\u003d0)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_a869ff25","line":6839,"range":{"start_line":6839,"start_character":57,"end_line":6839,"end_character":69},"updated":"2018-05-04 18:42:16.000000000","message":"This is a bad idea. Just mock out manager.ComputeManager()._migration_executor and assert that it\u0027s constructed with max_workers\u003d123.","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"925770052e792bf5ca2f1bd4139adf8c6d3a896f","unresolved":false,"context_lines":[{"line_number":6841,"context_line":"    def test_max_concurrent_live_semaphore_unlimited(self):"},{"line_number":6842,"context_line":"        self.flags(max_concurrent_live_migrations\u003d0)"},{"line_number":6843,"context_line":"        compute \u003d manager.ComputeManager()"},{"line_number":6844,"context_line":"        self.assertEqual(0, compute._migration_executor._max_workers)"},{"line_number":6845,"context_line":"        self.assertIsInstance(compute._migration_executor,"},{"line_number":6846,"context_line":"                              compute_utils.UnlimitedSemaphore)"},{"line_number":6847,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_6873e716","line":6844,"range":{"start_line":6844,"start_character":56,"end_line":6844,"end_character":68},"updated":"2018-05-04 18:42:16.000000000","message":"same","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"925770052e792bf5ca2f1bd4139adf8c6d3a896f","unresolved":false,"context_lines":[{"line_number":6848,"context_line":"    def test_max_concurrent_live_semaphore_negative(self):"},{"line_number":6849,"context_line":"        self.flags(max_concurrent_live_migrations\u003d-2)"},{"line_number":6850,"context_line":"        compute \u003d manager.ComputeManager()"},{"line_number":6851,"context_line":"        self.assertEqual(0, compute._migration_executor._max_workers)"},{"line_number":6852,"context_line":"        self.assertIsInstance(compute._live_migration_semaphore,"},{"line_number":6853,"context_line":"                              compute_utils.UnlimitedSemaphore)"},{"line_number":6854,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_48e4ebac","line":6851,"range":{"start_line":6851,"start_character":56,"end_line":6851,"end_character":68},"updated":"2018-05-04 18:42:16.000000000","message":"same","commit_id":"794a17d00d3bdb93b90e7ed7bba288196e579624"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7777d4f9bb621498eaf3973578d99cb34a6a1e02","unresolved":false,"context_lines":[{"line_number":666,"context_line":"                mock.call(self.compute.handle_events), mock.call(None)])"},{"line_number":667,"context_line":"            mock_driver.cleanup_host.assert_called_once_with(host\u003d\u0027fake-mini\u0027)"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"    @mock.patch(\u0027concurrent.futures._base.Future\u0027)"},{"line_number":670,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList\u0027)"},{"line_number":671,"context_line":"    @mock.patch(\u0027nova.objects.MigrationList.get_by_filters\u0027)"},{"line_number":672,"context_line":"    def test_cleanup_host_with_live_migration_in_queue("}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_408dfb2f","line":669,"updated":"2018-05-14 21:34:37.000000000","message":"Mocking an internal is potentially dangerous and we don\u0027t even really need this since you\u0027re mocking _live_migration_executor you can just make the Future a MagicMock in the test. If you\u0027re trying to use a mock with the Future spec, then use:\n\nfake_future \u003d mock.MagicMock(spec_set\u003d\u0027concurrent.futures.Future\u0027)\n\nsince you can import Future on it\u0027s own:\n\n\u003e\u003e\u003e from concurrent import futures\n\u003e\u003e\u003e futures.Future()\n\u003cFuture at 0x7f536330ba90 state\u003dpending\u003e\n\u003e\u003e\u003e","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"61a43dd0cae16edf95179ac105835c839bd894ea","unresolved":false,"context_lines":[{"line_number":666,"context_line":"                mock.call(self.compute.handle_events), mock.call(None)])"},{"line_number":667,"context_line":"            mock_driver.cleanup_host.assert_called_once_with(host\u003d\u0027fake-mini\u0027)"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"    @mock.patch(\u0027concurrent.futures._base.Future\u0027)"},{"line_number":670,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList\u0027)"},{"line_number":671,"context_line":"    @mock.patch(\u0027nova.objects.MigrationList.get_by_filters\u0027)"},{"line_number":672,"context_line":"    def test_cleanup_host_with_live_migration_in_queue("}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_5eb4fb7f","line":669,"in_reply_to":"5f7c97a3_408dfb2f","updated":"2018-05-15 01:21:43.000000000","message":"Ah, that helps","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7777d4f9bb621498eaf3973578d99cb34a6a1e02","unresolved":false,"context_lines":[{"line_number":667,"context_line":"            mock_driver.cleanup_host.assert_called_once_with(host\u003d\u0027fake-mini\u0027)"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"    @mock.patch(\u0027concurrent.futures._base.Future\u0027)"},{"line_number":670,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList\u0027)"},{"line_number":671,"context_line":"    @mock.patch(\u0027nova.objects.MigrationList.get_by_filters\u0027)"},{"line_number":672,"context_line":"    def test_cleanup_host_with_live_migration_in_queue("},{"line_number":673,"context_line":"            self, mock_miglist_get, mock_instance_list, mock_future):"},{"line_number":674,"context_line":"        # Test cleanup_host works correctly when there are live migrations"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_60e357da","line":671,"range":{"start_line":670,"start_character":4,"end_line":671,"end_character":60},"updated":"2018-05-14 21:34:37.000000000","message":"Just call _cleanup_live_migrations_in_pool directly, not cleanup_host(), then you don\u0027t need all of this other stuff.","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"61a43dd0cae16edf95179ac105835c839bd894ea","unresolved":false,"context_lines":[{"line_number":667,"context_line":"            mock_driver.cleanup_host.assert_called_once_with(host\u003d\u0027fake-mini\u0027)"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"    @mock.patch(\u0027concurrent.futures._base.Future\u0027)"},{"line_number":670,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList\u0027)"},{"line_number":671,"context_line":"    @mock.patch(\u0027nova.objects.MigrationList.get_by_filters\u0027)"},{"line_number":672,"context_line":"    def test_cleanup_host_with_live_migration_in_queue("},{"line_number":673,"context_line":"            self, mock_miglist_get, mock_instance_list, mock_future):"},{"line_number":674,"context_line":"        # Test cleanup_host works correctly when there are live migrations"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_9eb6138a","line":671,"range":{"start_line":670,"start_character":4,"end_line":671,"end_character":60},"in_reply_to":"5f7c97a3_60e357da","updated":"2018-05-15 01:21:43.000000000","message":"Done","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7777d4f9bb621498eaf3973578d99cb34a6a1e02","unresolved":false,"context_lines":[{"line_number":696,"context_line":"            mock_driver.register_event_listener.assert_has_calls(["},{"line_number":697,"context_line":"                mock.call(self.compute.handle_events), mock.call(None)])"},{"line_number":698,"context_line":"            mock_driver.cleanup_host.assert_called_once_with(host\u003d\u0027fake-mini\u0027)"},{"line_number":699,"context_line":"            self.assertEqual(fake_migration.status, \u0027cancelled\u0027)"},{"line_number":700,"context_line":"            self.assertTrue(mock_future.cancel.called)"},{"line_number":701,"context_line":"            self.assertEqual(self.compute._waiting_live_migrations, {})"},{"line_number":702,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_4092db4d","line":699,"range":{"start_line":699,"start_character":29,"end_line":699,"end_character":63},"updated":"2018-05-14 21:34:37.000000000","message":"nit: swap the order of these arguments, assertEqual(expected, actual)","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"61a43dd0cae16edf95179ac105835c839bd894ea","unresolved":false,"context_lines":[{"line_number":696,"context_line":"            mock_driver.register_event_listener.assert_has_calls(["},{"line_number":697,"context_line":"                mock.call(self.compute.handle_events), mock.call(None)])"},{"line_number":698,"context_line":"            mock_driver.cleanup_host.assert_called_once_with(host\u003d\u0027fake-mini\u0027)"},{"line_number":699,"context_line":"            self.assertEqual(fake_migration.status, \u0027cancelled\u0027)"},{"line_number":700,"context_line":"            self.assertTrue(mock_future.cancel.called)"},{"line_number":701,"context_line":"            self.assertEqual(self.compute._waiting_live_migrations, {})"},{"line_number":702,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_7eaf7729","line":699,"range":{"start_line":699,"start_character":29,"end_line":699,"end_character":63},"in_reply_to":"5f7c97a3_4092db4d","updated":"2018-05-15 01:21:43.000000000","message":"Done","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7777d4f9bb621498eaf3973578d99cb34a6a1e02","unresolved":false,"context_lines":[{"line_number":697,"context_line":"                mock.call(self.compute.handle_events), mock.call(None)])"},{"line_number":698,"context_line":"            mock_driver.cleanup_host.assert_called_once_with(host\u003d\u0027fake-mini\u0027)"},{"line_number":699,"context_line":"            self.assertEqual(fake_migration.status, \u0027cancelled\u0027)"},{"line_number":700,"context_line":"            self.assertTrue(mock_future.cancel.called)"},{"line_number":701,"context_line":"            self.assertEqual(self.compute._waiting_live_migrations, {})"},{"line_number":702,"context_line":""},{"line_number":703,"context_line":"    def test_init_virt_events_disabled(self):"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_80ab1373","line":700,"updated":"2018-05-14 21:34:37.000000000","message":"nit: on your magicmock Future object:\n\nfake_future.cancel.assert_called_once_with()","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"61a43dd0cae16edf95179ac105835c839bd894ea","unresolved":false,"context_lines":[{"line_number":697,"context_line":"                mock.call(self.compute.handle_events), mock.call(None)])"},{"line_number":698,"context_line":"            mock_driver.cleanup_host.assert_called_once_with(host\u003d\u0027fake-mini\u0027)"},{"line_number":699,"context_line":"            self.assertEqual(fake_migration.status, \u0027cancelled\u0027)"},{"line_number":700,"context_line":"            self.assertTrue(mock_future.cancel.called)"},{"line_number":701,"context_line":"            self.assertEqual(self.compute._waiting_live_migrations, {})"},{"line_number":702,"context_line":""},{"line_number":703,"context_line":"    def test_init_virt_events_disabled(self):"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_1eaa0318","line":700,"in_reply_to":"5f7c97a3_80ab1373","updated":"2018-05-15 01:21:43.000000000","message":"Done","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7777d4f9bb621498eaf3973578d99cb34a6a1e02","unresolved":false,"context_lines":[{"line_number":698,"context_line":"            mock_driver.cleanup_host.assert_called_once_with(host\u003d\u0027fake-mini\u0027)"},{"line_number":699,"context_line":"            self.assertEqual(fake_migration.status, \u0027cancelled\u0027)"},{"line_number":700,"context_line":"            self.assertTrue(mock_future.cancel.called)"},{"line_number":701,"context_line":"            self.assertEqual(self.compute._waiting_live_migrations, {})"},{"line_number":702,"context_line":""},{"line_number":703,"context_line":"    def test_init_virt_events_disabled(self):"},{"line_number":704,"context_line":"        self.flags(handle_virt_lifecycle_events\u003dFalse, group\u003d\u0027workarounds\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_a0a64faa","line":701,"range":{"start_line":701,"start_character":29,"end_line":701,"end_character":70},"updated":"2018-05-14 21:34:37.000000000","message":"swap the order the args","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"61a43dd0cae16edf95179ac105835c839bd894ea","unresolved":false,"context_lines":[{"line_number":698,"context_line":"            mock_driver.cleanup_host.assert_called_once_with(host\u003d\u0027fake-mini\u0027)"},{"line_number":699,"context_line":"            self.assertEqual(fake_migration.status, \u0027cancelled\u0027)"},{"line_number":700,"context_line":"            self.assertTrue(mock_future.cancel.called)"},{"line_number":701,"context_line":"            self.assertEqual(self.compute._waiting_live_migrations, {})"},{"line_number":702,"context_line":""},{"line_number":703,"context_line":"    def test_init_virt_events_disabled(self):"},{"line_number":704,"context_line":"        self.flags(handle_virt_lifecycle_events\u003dFalse, group\u003d\u0027workarounds\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_3ea57f47","line":701,"range":{"start_line":701,"start_character":29,"end_line":701,"end_character":70},"in_reply_to":"5f7c97a3_a0a64faa","updated":"2018-05-15 01:21:43.000000000","message":"Done","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7777d4f9bb621498eaf3973578d99cb34a6a1e02","unresolved":false,"context_lines":[{"line_number":7026,"context_line":"        with mock.patch.object("},{"line_number":7027,"context_line":"                self.compute._live_migration_executor, \u0027submit\u0027) as mock_sub:"},{"line_number":7028,"context_line":"            mock_sub.side_effect \u003d RuntimeError"},{"line_number":7029,"context_line":"            mock_sub.return_vaule \u003d mock.MagicMock()"},{"line_number":7030,"context_line":"            self.assertRaises(exception.LiveMigrationNotSubmitted,"},{"line_number":7031,"context_line":"                              self.compute.live_migration, self.context,"},{"line_number":7032,"context_line":"                              \u0027fake\u0027, self.instance, True, migration, {})"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_00e623e9","line":7029,"range":{"start_line":7029,"start_character":12,"end_line":7029,"end_character":52},"updated":"2018-05-14 21:34:37.000000000","message":"You can\u0027t have both a side_effect and a return_value on the mock...","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"61a43dd0cae16edf95179ac105835c839bd894ea","unresolved":false,"context_lines":[{"line_number":7026,"context_line":"        with mock.patch.object("},{"line_number":7027,"context_line":"                self.compute._live_migration_executor, \u0027submit\u0027) as mock_sub:"},{"line_number":7028,"context_line":"            mock_sub.side_effect \u003d RuntimeError"},{"line_number":7029,"context_line":"            mock_sub.return_vaule \u003d mock.MagicMock()"},{"line_number":7030,"context_line":"            self.assertRaises(exception.LiveMigrationNotSubmitted,"},{"line_number":7031,"context_line":"                              self.compute.live_migration, self.context,"},{"line_number":7032,"context_line":"                              \u0027fake\u0027, self.instance, True, migration, {})"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_fe6867f5","line":7029,"range":{"start_line":7029,"start_character":12,"end_line":7029,"end_character":52},"in_reply_to":"5f7c97a3_00e623e9","updated":"2018-05-15 01:21:43.000000000","message":"Ah, yes, RuntimeError will raise directly.","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7777d4f9bb621498eaf3973578d99cb34a6a1e02","unresolved":false,"context_lines":[{"line_number":7030,"context_line":"            self.assertRaises(exception.LiveMigrationNotSubmitted,"},{"line_number":7031,"context_line":"                              self.compute.live_migration, self.context,"},{"line_number":7032,"context_line":"                              \u0027fake\u0027, self.instance, True, migration, {})"},{"line_number":7033,"context_line":"            self.assertEqual(migration.status, \u0027error\u0027)"},{"line_number":7034,"context_line":""},{"line_number":7035,"context_line":"    def test_live_migration_force_complete_succeeded(self):"},{"line_number":7036,"context_line":"        migration \u003d objects.Migration()"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_20e9dfb5","line":7033,"range":{"start_line":7033,"start_character":29,"end_line":7033,"end_character":54},"updated":"2018-05-14 21:34:37.000000000","message":"swap the order of these arguments","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"61a43dd0cae16edf95179ac105835c839bd894ea","unresolved":false,"context_lines":[{"line_number":7030,"context_line":"            self.assertRaises(exception.LiveMigrationNotSubmitted,"},{"line_number":7031,"context_line":"                              self.compute.live_migration, self.context,"},{"line_number":7032,"context_line":"                              \u0027fake\u0027, self.instance, True, migration, {})"},{"line_number":7033,"context_line":"            self.assertEqual(migration.status, \u0027error\u0027)"},{"line_number":7034,"context_line":""},{"line_number":7035,"context_line":"    def test_live_migration_force_complete_succeeded(self):"},{"line_number":7036,"context_line":"        migration \u003d objects.Migration()"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_de656b1f","line":7033,"range":{"start_line":7033,"start_character":29,"end_line":7033,"end_character":54},"in_reply_to":"5f7c97a3_20e9dfb5","updated":"2018-05-15 01:21:43.000000000","message":"Done","commit_id":"8ca64ad990d86c1684f875cff2321b179eb0c33f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"93ef5262b0130a1735271b31cf587d4098ab62e3","unresolved":false,"context_lines":[{"line_number":667,"context_line":"            mock_driver.cleanup_host.assert_called_once_with(host\u003d\u0027fake-mini\u0027)"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"    def test_cleanup_live_migrations_in_pool_with_record(self):"},{"line_number":670,"context_line":"        fake_future \u003d mock.MagicMock()"},{"line_number":671,"context_line":"        fake_instance_uuid \u003d uuids.instance"},{"line_number":672,"context_line":"        fake_migration \u003d objects.Migration("},{"line_number":673,"context_line":"            uuid\u003duuids.migration, instance_uuid\u003dfake_instance_uuid)"}],"source_content_type":"text/x-python","patch_set":13,"id":"5f7c97a3_8e5d7448","line":670,"range":{"start_line":670,"start_character":27,"end_line":670,"end_character":36},"updated":"2018-05-15 12:41:03.000000000","message":"nit: spec_set\u003d\u0027concurrent.futures.Future\u0027\n\nThat way any calls on the mock which aren\u0027t in the Future class it will raise AttributeError.","commit_id":"65efaa593206bab3d9bdcd6a25da22404d200b96"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"3ae92feab83b132d966055fb72613be4a860d721","unresolved":false,"context_lines":[{"line_number":667,"context_line":"            mock_driver.cleanup_host.assert_called_once_with(host\u003d\u0027fake-mini\u0027)"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"    def test_cleanup_live_migrations_in_pool_with_record(self):"},{"line_number":670,"context_line":"        fake_future \u003d mock.MagicMock()"},{"line_number":671,"context_line":"        fake_instance_uuid \u003d uuids.instance"},{"line_number":672,"context_line":"        fake_migration \u003d objects.Migration("},{"line_number":673,"context_line":"            uuid\u003duuids.migration, instance_uuid\u003dfake_instance_uuid)"}],"source_content_type":"text/x-python","patch_set":13,"id":"5f7c97a3_4a863f16","line":670,"range":{"start_line":670,"start_character":27,"end_line":670,"end_character":36},"in_reply_to":"5f7c97a3_8e5d7448","updated":"2018-06-04 07:22:55.000000000","message":"Done, fixed this while rebasing to the latest master.","commit_id":"65efaa593206bab3d9bdcd6a25da22404d200b96"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8409d26540fa507b478da5e060b6872b0887a76b","unresolved":false,"context_lines":[{"line_number":698,"context_line":"            mock_driver.cleanup_host.assert_called_once_with(host\u003d\u0027fake-mini\u0027)"},{"line_number":699,"context_line":""},{"line_number":700,"context_line":"    def test_cleanup_live_migrations_in_pool_with_record(self):"},{"line_number":701,"context_line":"        fake_future \u003d mock.MagicMock()"},{"line_number":702,"context_line":"        fake_instance_uuid \u003d uuids.instance"},{"line_number":703,"context_line":"        fake_migration \u003d objects.Migration("},{"line_number":704,"context_line":"            uuid\u003duuids.migration, instance_uuid\u003dfake_instance_uuid)"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_4407e182","line":701,"range":{"start_line":701,"start_character":27,"end_line":701,"end_character":36},"updated":"2018-06-29 14:56:23.000000000","message":"nit: spec_set\u003d\u0027concurrent.futures.Future\u0027\n\nThat way any calls on the mock which aren\u0027t in the Future class it will raise AttributeError.","commit_id":"3bf41607bd90048178c1ebd54fcf0cdc7a8a2329"}]}
