)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"e935d683e3b3381fc99eba18c9f30252e5d1281a","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Set error when rebuild container without port"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When rebuild a container, if we can\u0027t get the container\u0027s port,"},{"line_number":10,"context_line":"the container\u0027s status is always Rebuilding."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I2d6da4739e409f99db33395f0bb5c15bf78f87d9"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"bf659307_303e7cda","line":10,"updated":"2018-04-10 02:26:32.000000000","message":"@weikeyou,\n\nIt is better to give reviewers the exact steps to reproduce the error. Could you help to create a bug report with the reproducing steps?","commit_id":"c8eb44dd749c7ad8a5bc8cddcaf3e09f6f7b0d5a"}],"zun/compute/manager.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"e935d683e3b3381fc99eba18c9f30252e5d1281a","unresolved":false,"context_lines":[{"line_number":589,"context_line":"        try:"},{"line_number":590,"context_line":"            network_info \u003d self._get_network_info(context, container)"},{"line_number":591,"context_line":"            vol_info \u003d self._get_vol_info(context, container)"},{"line_number":592,"context_line":"        except Exception as e:"},{"line_number":593,"context_line":"            with excutils.save_and_reraise_exception(reraise\u003dTrue):"},{"line_number":594,"context_line":"                LOG.error(\"Rebuild container:%s failed, \""},{"line_number":595,"context_line":"                          \"reason of failure is:%s\","}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_f008042e","line":592,"range":{"start_line":592,"start_character":15,"end_line":592,"end_character":24},"updated":"2018-04-10 02:26:32.000000000","message":"In general, it is not a good practice to catch a generic exception like this. We should catch a more specific exception type whenever it is possible.","commit_id":"c8eb44dd749c7ad8a5bc8cddcaf3e09f6f7b0d5a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"e935d683e3b3381fc99eba18c9f30252e5d1281a","unresolved":false,"context_lines":[{"line_number":595,"context_line":"                          \"reason of failure is:%s\","},{"line_number":596,"context_line":"                          container.uuid,"},{"line_number":597,"context_line":"                          six.text_type(e))"},{"line_number":598,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":599,"context_line":"        self._update_container_state(context, container, consts.REBUILDING)"},{"line_number":600,"context_line":"        if self.driver.check_container_exist(container):"},{"line_number":601,"context_line":"            for addr in container.addresses.values():"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_2b5a9129","line":598,"range":{"start_line":598,"start_character":21,"end_line":598,"end_character":36},"updated":"2018-04-10 02:26:32.000000000","message":"From my perspective, it is better to continue the rebuild process even if the container doesn\u0027t have a port because it is totally legitimate to have a container without port.","commit_id":"c8eb44dd749c7ad8a5bc8cddcaf3e09f6f7b0d5a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"a609be3f17ec5fc981b7e6bc221c85ac561d8f28","unresolved":false,"context_lines":[{"line_number":595,"context_line":"                          \"reason of failure is:%s\","},{"line_number":596,"context_line":"                          container.uuid,"},{"line_number":597,"context_line":"                          six.text_type(e))"},{"line_number":598,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":599,"context_line":"        self._update_container_state(context, container, consts.REBUILDING)"},{"line_number":600,"context_line":"        if self.driver.check_container_exist(container):"},{"line_number":601,"context_line":"            for addr in container.addresses.values():"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f6a8fd7_67c23e36","line":598,"range":{"start_line":598,"start_character":21,"end_line":598,"end_character":36},"in_reply_to":"bf659307_2b5a9129","updated":"2018-04-17 02:06:38.000000000","message":"Sorry, I re-visit the problem and think I was wrong. It is actually better to fail the container in this case. I uploaded a new patchset to address it.","commit_id":"c8eb44dd749c7ad8a5bc8cddcaf3e09f6f7b0d5a"},{"author":{"_account_id":21428,"name":"JiWei","email":"17366060309@163.com","username":"WeiJi"},"change_message_id":"2df4bc0691e61547125d7e5863c46b33e2bd609e","unresolved":false,"context_lines":[{"line_number":589,"context_line":"        vol_info \u003d self._get_vol_info(context, container)"},{"line_number":590,"context_line":"        try:"},{"line_number":591,"context_line":"            network_info \u003d self._get_network_info(context, container)"},{"line_number":592,"context_line":"        except exception.PortNotFound as e:"},{"line_number":593,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":594,"context_line":"                LOG.warning(\"The rebuilt container\u0027s port \""},{"line_number":595,"context_line":"                            \"has been lost: %s\", e)"},{"line_number":596,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":597,"context_line":"        except exception.NetworkNotFound as e:"},{"line_number":598,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":599,"context_line":"                LOG.error(\"The rebuilt container\u0027s network \""},{"line_number":600,"context_line":"                          \"has been lost: %s\", e)"},{"line_number":601,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":602,"context_line":"        except Exception as e:"},{"line_number":603,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":604,"context_line":"                LOG.error(\"Unexpected exception: %s\", e)"},{"line_number":605,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":606,"context_line":"        self._update_container_state(context, container, consts.REBUILDING)"},{"line_number":607,"context_line":"        if self.driver.check_container_exist(container):"},{"line_number":608,"context_line":"            for addr in container.addresses.values():"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f6a8fd7_87daf2e6","line":605,"range":{"start_line":592,"start_character":0,"end_line":605,"end_character":74},"updated":"2018-04-17 02:22:52.000000000","message":"repeat operation\nsee #654","commit_id":"e17c94c8f254253e1383bad1afee65b08c5c8a28"},{"author":{"_account_id":23829,"name":"weikeyou","email":"wei.keyou@zte.com.cn","username":"weikeyou"},"change_message_id":"1373f5e2d4f2547795933bde187bb84ce438f416","unresolved":false,"context_lines":[{"line_number":589,"context_line":"        vol_info \u003d self._get_vol_info(context, container)"},{"line_number":590,"context_line":"        try:"},{"line_number":591,"context_line":"            network_info \u003d self._get_network_info(context, container)"},{"line_number":592,"context_line":"        except exception.PortNotFound as e:"},{"line_number":593,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":594,"context_line":"                LOG.warning(\"The rebuilt container\u0027s port \""},{"line_number":595,"context_line":"                            \"has been lost: %s\", e)"},{"line_number":596,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":597,"context_line":"        except exception.NetworkNotFound as e:"},{"line_number":598,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":599,"context_line":"                LOG.error(\"The rebuilt container\u0027s network \""},{"line_number":600,"context_line":"                          \"has been lost: %s\", e)"},{"line_number":601,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":602,"context_line":"        except Exception as e:"},{"line_number":603,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":604,"context_line":"                LOG.error(\"Unexpected exception: %s\", e)"},{"line_number":605,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":606,"context_line":"        self._update_container_state(context, container, consts.REBUILDING)"},{"line_number":607,"context_line":"        if self.driver.check_container_exist(container):"},{"line_number":608,"context_line":"            for addr in container.addresses.values():"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f6a8fd7_82f8a0c4","line":605,"range":{"start_line":592,"start_character":0,"end_line":605,"end_character":74},"in_reply_to":"9f6a8fd7_02e9f018","updated":"2018-04-17 03:03:12.000000000","message":"If container can be set error when port is lost, I think we can catch a generic exception here:\n        try:\n            network_info \u003d self._get_network_info(context,   container)\n        except Exception as e:\n            self._fail_container(context, container, six.text_type(e))\n            raise\nWhat do you think about?","commit_id":"e17c94c8f254253e1383bad1afee65b08c5c8a28"},{"author":{"_account_id":23829,"name":"weikeyou","email":"wei.keyou@zte.com.cn","username":"weikeyou"},"change_message_id":"991a540271c154772e0dfac59bfa967d6bfcf019","unresolved":false,"context_lines":[{"line_number":589,"context_line":"        vol_info \u003d self._get_vol_info(context, container)"},{"line_number":590,"context_line":"        try:"},{"line_number":591,"context_line":"            network_info \u003d self._get_network_info(context, container)"},{"line_number":592,"context_line":"        except exception.PortNotFound as e:"},{"line_number":593,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":594,"context_line":"                LOG.warning(\"The rebuilt container\u0027s port \""},{"line_number":595,"context_line":"                            \"has been lost: %s\", e)"},{"line_number":596,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":597,"context_line":"        except exception.NetworkNotFound as e:"},{"line_number":598,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":599,"context_line":"                LOG.error(\"The rebuilt container\u0027s network \""},{"line_number":600,"context_line":"                          \"has been lost: %s\", e)"},{"line_number":601,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":602,"context_line":"        except Exception as e:"},{"line_number":603,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":604,"context_line":"                LOG.error(\"Unexpected exception: %s\", e)"},{"line_number":605,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":606,"context_line":"        self._update_container_state(context, container, consts.REBUILDING)"},{"line_number":607,"context_line":"        if self.driver.check_container_exist(container):"},{"line_number":608,"context_line":"            for addr in container.addresses.values():"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f6a8fd7_62b54c31","line":605,"range":{"start_line":592,"start_character":0,"end_line":605,"end_character":74},"in_reply_to":"9f6a8fd7_2252f414","updated":"2018-04-17 02:47:51.000000000","message":"#654 capture the exceptions and raise them to the upper funtion, but the funcion _do_container_rebuild() doesn\u0027t handle these raised excetions. The progress will stop when raising occures, but the status of container is still Rebuilding.","commit_id":"e17c94c8f254253e1383bad1afee65b08c5c8a28"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"996da0837918e2554d8839321bbabf844fcf1ae1","unresolved":false,"context_lines":[{"line_number":589,"context_line":"        vol_info \u003d self._get_vol_info(context, container)"},{"line_number":590,"context_line":"        try:"},{"line_number":591,"context_line":"            network_info \u003d self._get_network_info(context, container)"},{"line_number":592,"context_line":"        except exception.PortNotFound as e:"},{"line_number":593,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":594,"context_line":"                LOG.warning(\"The rebuilt container\u0027s port \""},{"line_number":595,"context_line":"                            \"has been lost: %s\", e)"},{"line_number":596,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":597,"context_line":"        except exception.NetworkNotFound as e:"},{"line_number":598,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":599,"context_line":"                LOG.error(\"The rebuilt container\u0027s network \""},{"line_number":600,"context_line":"                          \"has been lost: %s\", e)"},{"line_number":601,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":602,"context_line":"        except Exception as e:"},{"line_number":603,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":604,"context_line":"                LOG.error(\"Unexpected exception: %s\", e)"},{"line_number":605,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":606,"context_line":"        self._update_container_state(context, container, consts.REBUILDING)"},{"line_number":607,"context_line":"        if self.driver.check_container_exist(container):"},{"line_number":608,"context_line":"            for addr in container.addresses.values():"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f6a8fd7_02e9f018","line":605,"range":{"start_line":592,"start_character":0,"end_line":605,"end_character":74},"in_reply_to":"9f6a8fd7_62b54c31","updated":"2018-04-17 02:50:40.000000000","message":"Agree with you. It looks what is repeating is the duplicated log statement. The call of _fail_container is fine.","commit_id":"e17c94c8f254253e1383bad1afee65b08c5c8a28"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"c7243a1b0ea408de6f8d32f1cca53a54975e72de","unresolved":false,"context_lines":[{"line_number":589,"context_line":"        vol_info \u003d self._get_vol_info(context, container)"},{"line_number":590,"context_line":"        try:"},{"line_number":591,"context_line":"            network_info \u003d self._get_network_info(context, container)"},{"line_number":592,"context_line":"        except exception.PortNotFound as e:"},{"line_number":593,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":594,"context_line":"                LOG.warning(\"The rebuilt container\u0027s port \""},{"line_number":595,"context_line":"                            \"has been lost: %s\", e)"},{"line_number":596,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":597,"context_line":"        except exception.NetworkNotFound as e:"},{"line_number":598,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":599,"context_line":"                LOG.error(\"The rebuilt container\u0027s network \""},{"line_number":600,"context_line":"                          \"has been lost: %s\", e)"},{"line_number":601,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":602,"context_line":"        except Exception as e:"},{"line_number":603,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":604,"context_line":"                LOG.error(\"Unexpected exception: %s\", e)"},{"line_number":605,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":606,"context_line":"        self._update_container_state(context, container, consts.REBUILDING)"},{"line_number":607,"context_line":"        if self.driver.check_container_exist(container):"},{"line_number":608,"context_line":"            for addr in container.addresses.values():"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f6a8fd7_4d6399dd","line":605,"range":{"start_line":592,"start_character":0,"end_line":605,"end_character":74},"in_reply_to":"9f6a8fd7_82f8a0c4","updated":"2018-04-17 04:04:45.000000000","message":"I think this is a good idea. Sorry, I was commenting on patchset #1 for suggesting not catching a generic exception. However, I re-visit it and think it should be fine.","commit_id":"e17c94c8f254253e1383bad1afee65b08c5c8a28"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"29c057111b5575bf4303062ccb3f2a00d9b89e18","unresolved":false,"context_lines":[{"line_number":589,"context_line":"        vol_info \u003d self._get_vol_info(context, container)"},{"line_number":590,"context_line":"        try:"},{"line_number":591,"context_line":"            network_info \u003d self._get_network_info(context, container)"},{"line_number":592,"context_line":"        except exception.PortNotFound as e:"},{"line_number":593,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":594,"context_line":"                LOG.warning(\"The rebuilt container\u0027s port \""},{"line_number":595,"context_line":"                            \"has been lost: %s\", e)"},{"line_number":596,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":597,"context_line":"        except exception.NetworkNotFound as e:"},{"line_number":598,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":599,"context_line":"                LOG.error(\"The rebuilt container\u0027s network \""},{"line_number":600,"context_line":"                          \"has been lost: %s\", e)"},{"line_number":601,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":602,"context_line":"        except Exception as e:"},{"line_number":603,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":604,"context_line":"                LOG.error(\"Unexpected exception: %s\", e)"},{"line_number":605,"context_line":"                self._fail_container(context, container, six.text_type(e))"},{"line_number":606,"context_line":"        self._update_container_state(context, container, consts.REBUILDING)"},{"line_number":607,"context_line":"        if self.driver.check_container_exist(container):"},{"line_number":608,"context_line":"            for addr in container.addresses.values():"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f6a8fd7_2252f414","line":605,"range":{"start_line":592,"start_character":0,"end_line":605,"end_character":74},"in_reply_to":"9f6a8fd7_87daf2e6","updated":"2018-04-17 02:41:40.000000000","message":"indeed!","commit_id":"e17c94c8f254253e1383bad1afee65b08c5c8a28"},{"author":{"_account_id":21428,"name":"JiWei","email":"17366060309@163.com","username":"WeiJi"},"change_message_id":"c5d74add820375f64aff6ee5512a87a13f5f32aa","unresolved":false,"context_lines":[{"line_number":654,"context_line":"            except exception.PortNotFound:"},{"line_number":655,"context_line":"                LOG.exception(\"The port: %s used by the source container \""},{"line_number":656,"context_line":"                              \"does not exist, can not rebuild\", port_id)"},{"line_number":657,"context_line":"                raise"},{"line_number":658,"context_line":"            except exception.NetworkNotFound:"},{"line_number":659,"context_line":"                LOG.exception(\"The network: %s used by the source container \""},{"line_number":660,"context_line":"                              \"does not exist, can not rebuild\", network_id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f6a8fd7_22a0b4f4","line":657,"range":{"start_line":657,"start_character":15,"end_line":657,"end_character":21},"updated":"2018-04-17 02:47:13.000000000","message":"@Hongbin @keyou\nMaybe we can add it here:\nself._fail_container(context, container, six.text_type(e))","commit_id":"e17c94c8f254253e1383bad1afee65b08c5c8a28"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"02a6cd70ded5cdf656c05942a5e4d27a94c1d8bb","unresolved":false,"context_lines":[{"line_number":592,"context_line":"        except Exception as e:"},{"line_number":593,"context_line":"            self._fail_container(context, container,"},{"line_number":594,"context_line":"                                 six.text_type(e))"},{"line_number":595,"context_line":"            raise"},{"line_number":596,"context_line":"        self._update_container_state(context, container, consts.REBUILDING)"},{"line_number":597,"context_line":"        if self.driver.check_container_exist(container):"},{"line_number":598,"context_line":"            for addr in container.addresses.values():"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f6a8fd7_e8803f8e","line":595,"range":{"start_line":595,"start_character":12,"end_line":595,"end_character":17},"updated":"2018-04-18 01:39:29.000000000","message":"A better approach is to use save_and_reraise_exception (https://docs.openstack.org/oslo.utils/latest/reference/excutils.html#oslo_utils.excutils.save_and_reraise_exception) but this is fine.","commit_id":"7c4f67a7c5f8454afab038c58410cd8534454c5e"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"1c3f58b83d7da2a463187b20dc2b0bf8832a4c7a","unresolved":false,"context_lines":[{"line_number":592,"context_line":"        except Exception as e:"},{"line_number":593,"context_line":"            self._fail_container(context, container,"},{"line_number":594,"context_line":"                                 six.text_type(e))"},{"line_number":595,"context_line":"            raise"},{"line_number":596,"context_line":"        self._update_container_state(context, container, consts.REBUILDING)"},{"line_number":597,"context_line":"        if self.driver.check_container_exist(container):"},{"line_number":598,"context_line":"            for addr in container.addresses.values():"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f6a8fd7_0f692b8a","line":595,"range":{"start_line":595,"start_character":12,"end_line":595,"end_character":17},"in_reply_to":"9f6a8fd7_919eccb6","updated":"2018-04-27 01:23:00.000000000","message":"Done","commit_id":"7c4f67a7c5f8454afab038c58410cd8534454c5e"},{"author":{"_account_id":22406,"name":"Kien Nguyen","email":"kiennt2609@gmail.com","username":"kiennt"},"change_message_id":"30cbe0ef90d975dc4058ba77a7bfcb8b06602735","unresolved":false,"context_lines":[{"line_number":592,"context_line":"        except Exception as e:"},{"line_number":593,"context_line":"            self._fail_container(context, container,"},{"line_number":594,"context_line":"                                 six.text_type(e))"},{"line_number":595,"context_line":"            raise"},{"line_number":596,"context_line":"        self._update_container_state(context, container, consts.REBUILDING)"},{"line_number":597,"context_line":"        if self.driver.check_container_exist(container):"},{"line_number":598,"context_line":"            for addr in container.addresses.values():"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f6a8fd7_919eccb6","line":595,"range":{"start_line":595,"start_character":12,"end_line":595,"end_character":17},"in_reply_to":"9f6a8fd7_e8803f8e","updated":"2018-04-26 14:23:09.000000000","message":"+1 for save_and_reraise_exception.","commit_id":"7c4f67a7c5f8454afab038c58410cd8534454c5e"}]}
