)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"8444b3e04c46787ae7341071106d43454f0fe529","unresolved":false,"context_lines":[{"line_number":2360,"context_line":"        try:"},{"line_number":2361,"context_line":"            LOG.debug(\u0027Start destroying the instance on the hypervisor.\u0027,"},{"line_number":2362,"context_line":"                      instance\u003dinstance)"},{"line_number":2363,"context_line":"            with timeutils.StopWatch() as timer:"},{"line_number":2364,"context_line":"                self.driver.destroy(context, instance, network_info,"},{"line_number":2365,"context_line":"                                    block_device_info)"},{"line_number":2366,"context_line":"            LOG.info(\u0027Took %0.2f seconds to destroy the instance on the \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa0c359_05351ff7","line":2363,"range":{"start_line":2363,"start_character":38,"end_line":2363,"end_character":47},"updated":"2018-02-08 18:13:23.000000000","message":"timer is not used. I guess we don\u0027t need it at all places which use StopWatch() in this manager.py.","commit_id":"a5476c0ab84f600416b8a9ce7ed093cea4aab2f7"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"22ce471ce085aa704f3187631110e092e5d476f9","unresolved":false,"context_lines":[{"line_number":2360,"context_line":"        try:"},{"line_number":2361,"context_line":"            LOG.debug(\u0027Start destroying the instance on the hypervisor.\u0027,"},{"line_number":2362,"context_line":"                      instance\u003dinstance)"},{"line_number":2363,"context_line":"            with timeutils.StopWatch() as timer:"},{"line_number":2364,"context_line":"                self.driver.destroy(context, instance, network_info,"},{"line_number":2365,"context_line":"                                    block_device_info)"},{"line_number":2366,"context_line":"            LOG.info(\u0027Took %0.2f seconds to destroy the instance on the \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa0c359_60fad175","line":2363,"range":{"start_line":2363,"start_character":38,"end_line":2363,"end_character":47},"in_reply_to":"3fa0c359_05351ff7","updated":"2018-02-08 18:33:02.000000000","message":"ah, I missed the following timer..","commit_id":"a5476c0ab84f600416b8a9ce7ed093cea4aab2f7"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8711447a47fbc81fbab3272ccc6184ba66d52312","unresolved":false,"context_lines":[{"line_number":2363,"context_line":"            with timeutils.StopWatch() as timer:"},{"line_number":2364,"context_line":"                self.driver.destroy(context, instance, network_info,"},{"line_number":2365,"context_line":"                                    block_device_info)"},{"line_number":2366,"context_line":"            LOG.info(\u0027Took %0.2f seconds to destroy the instance on the \u0027"},{"line_number":2367,"context_line":"                     \u0027hypervisor.\u0027, timer.elapsed(), instance\u003dinstance)"},{"line_number":2368,"context_line":"        except exception.InstancePowerOffFailure:"},{"line_number":2369,"context_line":"            # if the instance can\u0027t power off, don\u0027t release the ip"},{"line_number":2370,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa0c359_d27b6278","line":2367,"range":{"start_line":2366,"start_character":0,"end_line":2367,"end_character":71},"updated":"2018-02-09 11:02:10.000000000","message":"Shouldn\u0027t this be indented to ensure the \u0027timer\u0027 hasn\u0027t been destroyed or anything?","commit_id":"a5476c0ab84f600416b8a9ce7ed093cea4aab2f7"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"d8831099f2def7d892b1c908b0c48c94d7c3177f","unresolved":false,"context_lines":[{"line_number":2363,"context_line":"            with timeutils.StopWatch() as timer:"},{"line_number":2364,"context_line":"                self.driver.destroy(context, instance, network_info,"},{"line_number":2365,"context_line":"                                    block_device_info)"},{"line_number":2366,"context_line":"            LOG.info(\u0027Took %0.2f seconds to destroy the instance on the \u0027"},{"line_number":2367,"context_line":"                     \u0027hypervisor.\u0027, timer.elapsed(), instance\u003dinstance)"},{"line_number":2368,"context_line":"        except exception.InstancePowerOffFailure:"},{"line_number":2369,"context_line":"            # if the instance can\u0027t power off, don\u0027t release the ip"},{"line_number":2370,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa0c359_9bc41261","line":2367,"range":{"start_line":2366,"start_character":0,"end_line":2367,"end_character":71},"in_reply_to":"3fa0c359_b2a1f696","updated":"2018-02-09 15:15:38.000000000","message":"Cool. Thanks for the info :)","commit_id":"a5476c0ab84f600416b8a9ce7ed093cea4aab2f7"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"b04f7ff94d4d10be67b3b52e6d85cad74962a5a3","unresolved":false,"context_lines":[{"line_number":2363,"context_line":"            with timeutils.StopWatch() as timer:"},{"line_number":2364,"context_line":"                self.driver.destroy(context, instance, network_info,"},{"line_number":2365,"context_line":"                                    block_device_info)"},{"line_number":2366,"context_line":"            LOG.info(\u0027Took %0.2f seconds to destroy the instance on the \u0027"},{"line_number":2367,"context_line":"                     \u0027hypervisor.\u0027, timer.elapsed(), instance\u003dinstance)"},{"line_number":2368,"context_line":"        except exception.InstancePowerOffFailure:"},{"line_number":2369,"context_line":"            # if the instance can\u0027t power off, don\u0027t release the ip"},{"line_number":2370,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa0c359_b2a1f696","line":2367,"range":{"start_line":2366,"start_character":0,"end_line":2367,"end_character":71},"in_reply_to":"3fa0c359_d27b6278","updated":"2018-02-09 11:17:34.000000000","message":"answer here for both 2 patches on the related change :)\n\nhttps://github.com/openstack/nova/blob/master/nova/compute/manager.py#L1661 has existing usage\n\n\nhttps://github.com/openstack/oslo.utils/blob/master/oslo_utils/timeutils.py#L395 is the definition of the class, my understanding is the timer is a variable and won\u0027t be destroyed before leave this function, the __enter__ and __exit__ handles the start and stop","commit_id":"a5476c0ab84f600416b8a9ce7ed093cea4aab2f7"}]}
