)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9e5371f312c4e65b61ad067754180703bfcdfbab","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"During attach_volume operation, initialize_connection in Cinder"},{"line_number":10,"context_line":"is called. If timeout happens during initialize_connection, the"},{"line_number":11,"context_line":"volume state will be changed back to available."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"However, volume could be already mapped to the host on the array."},{"line_number":14,"context_line":"This leaves the database and array out of sync. If rescan happens"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"9a1a9d01_16095f31","line":11,"updated":"2015-09-28 17:48:00.000000000","message":"Why is the volume state changed back to available?  Why isn\u0027t it changed to ERROR?","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"916dde079af0106f4dd8dae87042dcf2134bf079","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"During attach_volume operation, initialize_connection in Cinder"},{"line_number":10,"context_line":"is called. If timeout happens during initialize_connection, the"},{"line_number":11,"context_line":"volume state will be changed back to available."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"However, volume could be already mapped to the host on the array."},{"line_number":14,"context_line":"This leaves the database and array out of sync. If rescan happens"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"9a1a9d01_8ad46047","line":11,"in_reply_to":"9a1a9d01_16095f31","updated":"2015-09-28 20:00:47.000000000","message":"It is changed to \"available\" here if attach volume fails:\n\nhttps://github.com/openstack/nova/blob/master/nova/compute/manager.py#L4624\n\nunreserve will change status from \"attaching\" to \"available\".  There\u0027s no non-admin API in Cinder that allows the status to be changed from \"attaching\" to \"error\".\n\nThis is something that should be looked at as part of the contract between Cinder and Nova.","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b5f6c81ede36a344e59acb30492008419ddcb582","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"During attach_volume operation, initialize_connection in Cinder"},{"line_number":10,"context_line":"is called. If timeout happens during initialize_connection, the"},{"line_number":11,"context_line":"volume state will be changed back to available."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"However, volume could be already mapped to the host on the array."},{"line_number":14,"context_line":"This leaves the database and array out of sync. If rescan happens"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"9a1a9d01_3c9e1908","line":11,"in_reply_to":"9a1a9d01_8ad46047","updated":"2015-10-02 02:40:17.000000000","message":"OK nova does the unreserve which changes it to available - I was thinking this was something that could be controlled on the cinder side, i.e. cinder puts it in error state and then if nova tries to unreserve it\u0027s a 400 b/c you can\u0027t unreserve a volume in error state.","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7241a81a3bbad94160fcc5784075d782833ddc37","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Xing Yang \u003cxing.yang@emc.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-24 18:46:50 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Rollback is needed if attach_volume times out"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"During attach_volume operation, initialize_connection in Cinder"},{"line_number":10,"context_line":"is called. If timeout happens during initialize_connection, the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9a1a9d01_471f7a5b","line":7,"updated":"2015-10-02 02:51:39.000000000","message":"s/attach_volume times out/initialize_connection errors out/\n\nWe initialize the connection in more cases than just attach_volume (we do it in post live migrate also).","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f5318931a77db221db36ddec3ed7cac2fafc2a24","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Xing Yang \u003cxing.yang@emc.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-24 18:46:50 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Rollback is needed if attach_volume times out"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"During attach_volume operation, initialize_connection in Cinder"},{"line_number":10,"context_line":"is called. If timeout happens during initialize_connection, the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9a1a9d01_5e85dc56","line":7,"in_reply_to":"9a1a9d01_471f7a5b","updated":"2015-10-02 20:56:00.000000000","message":"Done","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b24f49cd8813529cc75e945001572c81829ef5aa","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"During attach_volume operation, initialize_connection in Cinder"},{"line_number":10,"context_line":"is called. If timeout happens during initialize_connection, the"},{"line_number":11,"context_line":"volume state will be changed back to available."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"However, volume could be already mapped to the host on the array."},{"line_number":14,"context_line":"This leaves the database and array out of sync. If rescan happens"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9a1a9d01_5cbaed6f","line":11,"updated":"2015-10-02 02:50:14.000000000","message":"Per PS6 it might be worthwhile explaining why it goes back to available state here.  I was originally thinking cinder was putting it in available state but it\u0027s the unreserve call that the compute manager is making when the attach fails.","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f5318931a77db221db36ddec3ed7cac2fafc2a24","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"During attach_volume operation, initialize_connection in Cinder"},{"line_number":10,"context_line":"is called. If timeout happens during initialize_connection, the"},{"line_number":11,"context_line":"volume state will be changed back to available."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"However, volume could be already mapped to the host on the array."},{"line_number":14,"context_line":"This leaves the database and array out of sync. If rescan happens"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9a1a9d01_bec43892","line":11,"in_reply_to":"9a1a9d01_5cbaed6f","updated":"2015-10-02 20:56:00.000000000","message":"Done","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b24f49cd8813529cc75e945001572c81829ef5aa","unresolved":false,"context_lines":[{"line_number":19,"context_line":"The timeout exception during attach_volume should be handled and a"},{"line_number":20,"context_line":"rollback should be triggered by calling terminate_connection in"},{"line_number":21,"context_line":"Cinder."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: I8c195b7cfc6e9b296fc3b8f5ce56bb5e130769e8"},{"line_number":24,"context_line":"Closes-Bug: #1387807"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9a1a9d01_dcf83d4c","line":22,"updated":"2015-10-02 02:50:14.000000000","message":"@xyang - you probably want a Co-Authored-By in here now.","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f5318931a77db221db36ddec3ed7cac2fafc2a24","unresolved":false,"context_lines":[{"line_number":19,"context_line":"The timeout exception during attach_volume should be handled and a"},{"line_number":20,"context_line":"rollback should be triggered by calling terminate_connection in"},{"line_number":21,"context_line":"Cinder."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: I8c195b7cfc6e9b296fc3b8f5ce56bb5e130769e8"},{"line_number":24,"context_line":"Closes-Bug: #1387807"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9a1a9d01_7e0300b9","line":22,"in_reply_to":"9a1a9d01_dcf83d4c","updated":"2015-10-02 20:56:00.000000000","message":"Done","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"16e8ebb04fb088baa69681d129df17e2afaba1c6","unresolved":false,"context_lines":[{"line_number":22,"context_line":"should be handled and a rollback should be triggered by calling"},{"line_number":23,"context_line":"terminate_connection in Cinder."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Co-Authored-By: Jeegn Chen \u003cjeegn.chen@emc.com\u003e"},{"line_number":26,"context_line":"Co-Authored-By: xing-yang \u003cxing.yang@emc.com\u003e"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: I8c195b7cfc6e9b296fc3b8f5ce56bb5e130769e8"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"7a2fa921_1d79f493","line":25,"updated":"2015-10-05 16:47:01.000000000","message":"Probably not necessary for Jeegn since they are the author already.","commit_id":"ecc3085cf6eb5d22e72dbf8f3c699bea28260756"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"959407da1b0cde586b3ced7aecd051be74cb4323","unresolved":false,"context_lines":[{"line_number":22,"context_line":"should be handled and a rollback should be triggered by calling"},{"line_number":23,"context_line":"terminate_connection in Cinder."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Co-Authored-By: Jeegn Chen \u003cjeegn.chen@emc.com\u003e"},{"line_number":26,"context_line":"Co-Authored-By: xing-yang \u003cxing.yang@emc.com\u003e"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: I8c195b7cfc6e9b296fc3b8f5ce56bb5e130769e8"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"7a2fa921_f6ed358f","line":25,"in_reply_to":"7a2fa921_1d79f493","updated":"2015-10-05 21:24:25.000000000","message":"Removed Jeegn. I think http://stackalytics.com/ won\u0027t show him as a committer if I don\u0027t add his name.  He\u0027ll still get credit on git and remain his ATC status, though his email won\u0027t work any more.","commit_id":"ecc3085cf6eb5d22e72dbf8f3c699bea28260756"}],"nova/tests/unit/volume/test_cinder.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"13d1bc5448d737b7c31376f6e60eca86b95c2f46","unresolved":false,"context_lines":[{"line_number":293,"context_line":"                cinder_exception.ClientException(500, \"500\"),"},{"line_number":294,"context_line":"                cinder_exception.ClientException(504, \"504\")]"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        http500 \u003d False"},{"line_number":297,"context_line":"        try:"},{"line_number":298,"context_line":"            self.api.initialize_connection(self.ctx, \u0027id1\u0027, \u0027connector\u0027)"},{"line_number":299,"context_line":"        except cinder_exception.ClientException as ex:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_b9bf44fa","line":296,"updated":"2015-09-28 17:53:32.000000000","message":"This is a bit clunky.  Use this instead:\n\nex \u003d self.assertRaises(api.initialize_connection, self.ctx, \u0027id1\u0027, \u0027connector\u0027)\n\nself.assertEqual(500, ex.code)","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"916dde079af0106f4dd8dae87042dcf2134bf079","unresolved":false,"context_lines":[{"line_number":293,"context_line":"                cinder_exception.ClientException(500, \"500\"),"},{"line_number":294,"context_line":"                cinder_exception.ClientException(504, \"504\")]"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        http500 \u003d False"},{"line_number":297,"context_line":"        try:"},{"line_number":298,"context_line":"            self.api.initialize_connection(self.ctx, \u0027id1\u0027, \u0027connector\u0027)"},{"line_number":299,"context_line":"        except cinder_exception.ClientException as ex:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_058603b9","line":296,"in_reply_to":"9a1a9d01_b9bf44fa","updated":"2015-09-28 20:00:47.000000000","message":"Done","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"13d1bc5448d737b7c31376f6e60eca86b95c2f46","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        mock_cinderclient.return_value.volumes.\\"},{"line_number":304,"context_line":"            terminate_connection.assert_called_once_with(\u0027id1\u0027, \u0027connector\u0027)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"        http504 \u003d False"},{"line_number":307,"context_line":"        try:"},{"line_number":308,"context_line":"            self.api.initialize_connection(self.ctx, \u0027id2\u0027, \u0027connector\u0027)"},{"line_number":309,"context_line":"        except cinder_exception.ClientException as ex:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_993b609c","line":306,"updated":"2015-09-28 17:53:32.000000000","message":"Same as above.","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"916dde079af0106f4dd8dae87042dcf2134bf079","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        mock_cinderclient.return_value.volumes.\\"},{"line_number":304,"context_line":"            terminate_connection.assert_called_once_with(\u0027id1\u0027, \u0027connector\u0027)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"        http504 \u003d False"},{"line_number":307,"context_line":"        try:"},{"line_number":308,"context_line":"            self.api.initialize_connection(self.ctx, \u0027id2\u0027, \u0027connector\u0027)"},{"line_number":309,"context_line":"        except cinder_exception.ClientException as ex:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_a594f7e1","line":306,"in_reply_to":"9a1a9d01_993b609c","updated":"2015-09-28 20:00:47.000000000","message":"Done","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b24f49cd8813529cc75e945001572c81829ef5aa","unresolved":false,"context_lines":[{"line_number":294,"context_line":"                cinder_exception.ClientException(504, \"504\")]"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        connector \u003d {\u0027host\u0027: \u0027host1\u0027}"},{"line_number":297,"context_line":"        ex \u003d self.assertRaises(cinder_exception.ClientException,"},{"line_number":298,"context_line":"                               self.api.initialize_connection,"},{"line_number":299,"context_line":"                               self.ctx,"},{"line_number":300,"context_line":"                               \u0027id1\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_1c7475cd","line":297,"updated":"2015-10-02 02:50:14.000000000","message":"nit: I feel like we could do this in a loop to avoid some copy paste.\n\nAlso, you could just do the assertion once at the end using assert_has_calls.\n\nJust nits at this point.  Maybe I\u0027ll see if I can whip up a more concise way to test this in a loop with a single assertion.\n\n--\n\nActually, you could scratch that - we don\u0027t even need the two exceptions with specific codes to be tested - we aren\u0027t checking the codes in the code anymore, we\u0027re just rolling back and re-raising the exception if it\u0027s any ClientException, regardless of code.  So I think we should just test a single exception case and we\u0027re good.","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f5318931a77db221db36ddec3ed7cac2fafc2a24","unresolved":false,"context_lines":[{"line_number":294,"context_line":"                cinder_exception.ClientException(504, \"504\")]"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        connector \u003d {\u0027host\u0027: \u0027host1\u0027}"},{"line_number":297,"context_line":"        ex \u003d self.assertRaises(cinder_exception.ClientException,"},{"line_number":298,"context_line":"                               self.api.initialize_connection,"},{"line_number":299,"context_line":"                               self.ctx,"},{"line_number":300,"context_line":"                               \u0027id1\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_d9f4abd0","line":297,"in_reply_to":"9a1a9d01_1c7475cd","updated":"2015-10-02 20:56:00.000000000","message":"Sure.  Reduced it to just one test.","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"16e8ebb04fb088baa69681d129df17e2afaba1c6","unresolved":false,"context_lines":[{"line_number":287,"context_line":"        self.api.initialize_connection(self.ctx, \u0027id1\u0027, \u0027connector\u0027)"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"    @mock.patch(\u0027nova.volume.cinder.cinderclient\u0027)"},{"line_number":290,"context_line":"    def test_initialize_connection_rollback(self, mock_cinderclient):"},{"line_number":291,"context_line":"        mock_cinderclient.return_value.volumes.\\"},{"line_number":292,"context_line":"            initialize_connection.side_effect \u003d ("},{"line_number":293,"context_line":"                cinder_exception.ClientException(500, \"500\"))"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a2fa921_ddf7fcf3","line":290,"updated":"2015-10-05 16:47:01.000000000","message":"If you need to respin, it\u0027d be good to have another failure scenario test to show that we\u0027re specifically catching ClientException and not just all Exceptions.  The way I\u0027d do this is basically the same test but with nova.test.TestingException and then we assert that is raised and terminate_connection is not called.  Could also be a follow on patch.","commit_id":"ecc3085cf6eb5d22e72dbf8f3c699bea28260756"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"959407da1b0cde586b3ced7aecd051be74cb4323","unresolved":false,"context_lines":[{"line_number":287,"context_line":"        self.api.initialize_connection(self.ctx, \u0027id1\u0027, \u0027connector\u0027)"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"    @mock.patch(\u0027nova.volume.cinder.cinderclient\u0027)"},{"line_number":290,"context_line":"    def test_initialize_connection_rollback(self, mock_cinderclient):"},{"line_number":291,"context_line":"        mock_cinderclient.return_value.volumes.\\"},{"line_number":292,"context_line":"            initialize_connection.side_effect \u003d ("},{"line_number":293,"context_line":"                cinder_exception.ClientException(500, \"500\"))"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a2fa921_cac72544","line":290,"in_reply_to":"7a2fa921_ddf7fcf3","updated":"2015-10-05 21:24:25.000000000","message":"Sure.  Added another test with test.TestingException.","commit_id":"ecc3085cf6eb5d22e72dbf8f3c699bea28260756"}],"nova/virt/block_device.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0a7730dbbf15046d78ebf28c869a3a1cadb38b1b","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            try:"},{"line_number":51,"context_line":"                self.volume_api.terminate_connection(self.context,"},{"line_number":52,"context_line":"                                                     self.volume_id,"},{"line_number":53,"context_line":"                                                     self.connector)"},{"line_number":54,"context_line":"            except Exception:"},{"line_number":55,"context_line":"                LOG.error(_LE(\u0027Failed to rollback the connection between \u0027"},{"line_number":56,"context_line":"                             \u0027volume %(vol)s and host %(host)s.\u0027),"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_4ac116e3","line":53,"updated":"2014-12-03 12:00:17.000000000","message":"why not return True here after the termination has completed successfully","commit_id":"742da2eea8e6c24a63f47b00c732d568c86a9eb6"},{"author":{"_account_id":9924,"name":"Jeegn Chen","email":"Jeegn.Chen@emc.com","username":"jeegn-chen"},"change_message_id":"bf3fe14992fa9aec59db32285b9920404b0254ca","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            try:"},{"line_number":51,"context_line":"                self.volume_api.terminate_connection(self.context,"},{"line_number":52,"context_line":"                                                     self.volume_id,"},{"line_number":53,"context_line":"                                                     self.connector)"},{"line_number":54,"context_line":"            except Exception:"},{"line_number":55,"context_line":"                LOG.error(_LE(\u0027Failed to rollback the connection between \u0027"},{"line_number":56,"context_line":"                             \u0027volume %(vol)s and host %(host)s.\u0027),"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_c96a67b4","line":53,"in_reply_to":"5a890539_4ac116e3","updated":"2014-12-03 15:48:42.000000000","message":"When terminate_connection succeeds, it just mean the rollback succeeds.\n\nWe need to reraise the exception to make the caller of initialize_connection() aware that initialize_connection() fails.","commit_id":"742da2eea8e6c24a63f47b00c732d568c86a9eb6"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0a7730dbbf15046d78ebf28c869a3a1cadb38b1b","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                                                     self.connector)"},{"line_number":54,"context_line":"            except Exception:"},{"line_number":55,"context_line":"                LOG.error(_LE(\u0027Failed to rollback the connection between \u0027"},{"line_number":56,"context_line":"                             \u0027volume %(vol)s and host %(host)s.\u0027),"},{"line_number":57,"context_line":"                             {\u0027vol\u0027: self.volume_id,"},{"line_number":58,"context_line":"                              \u0027host\u0027: self.connector[\u0027host\u0027]})"},{"line_number":59,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_6a9b3217","line":56,"updated":"2014-12-03 12:00:17.000000000","message":"indentation is a little odd here","commit_id":"742da2eea8e6c24a63f47b00c732d568c86a9eb6"},{"author":{"_account_id":9924,"name":"Jeegn Chen","email":"Jeegn.Chen@emc.com","username":"jeegn-chen"},"change_message_id":"bf3fe14992fa9aec59db32285b9920404b0254ca","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                                                     self.connector)"},{"line_number":54,"context_line":"            except Exception:"},{"line_number":55,"context_line":"                LOG.error(_LE(\u0027Failed to rollback the connection between \u0027"},{"line_number":56,"context_line":"                             \u0027volume %(vol)s and host %(host)s.\u0027),"},{"line_number":57,"context_line":"                             {\u0027vol\u0027: self.volume_id,"},{"line_number":58,"context_line":"                              \u0027host\u0027: self.connector[\u0027host\u0027]})"},{"line_number":59,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_89e93f1c","line":56,"in_reply_to":"5a890539_6a9b3217","updated":"2014-12-03 15:48:42.000000000","message":"Good catch.\n\nI will update it.","commit_id":"742da2eea8e6c24a63f47b00c732d568c86a9eb6"},{"author":{"_account_id":12909,"name":"Mark Wu","email":"wudx05@gmail.com","username":"markw"},"change_message_id":"b02fb7f1c52443dfbf1fd2c9914d29e7d3d5071b","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                              \u0027volume %(vol)s and host %(host)s.\u0027),"},{"line_number":57,"context_line":"                          {\u0027vol\u0027: self.volume_id,"},{"line_number":58,"context_line":"                           \u0027host\u0027: self.connector[\u0027host\u0027]})"},{"line_number":59,"context_line":"        return False"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"class _NotTransformable(Exception):"}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_74c64318","line":59,"updated":"2015-02-08 14:13:41.000000000","message":"IMHO,  we don\u0027t really need a context manager to handle the rollback. Basically, we just need to add an timeout exception handler.  To make the code reusable,  we can add a wrapper to initialize_connection and add the exception handler in the new wrapper.  And I think nova/volume/cinder.py is more suitable to hold this logic.","commit_id":"d4c01726662d71a408c1765a01dd72cc10a1bbe2"},{"author":{"_account_id":9924,"name":"Jeegn Chen","email":"Jeegn.Chen@emc.com","username":"jeegn-chen"},"change_message_id":"6b9eead71aa40dbe4487dd092cb3e1615c9bc231","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                              \u0027volume %(vol)s and host %(host)s.\u0027),"},{"line_number":57,"context_line":"                          {\u0027vol\u0027: self.volume_id,"},{"line_number":58,"context_line":"                           \u0027host\u0027: self.connector[\u0027host\u0027]})"},{"line_number":59,"context_line":"        return False"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"class _NotTransformable(Exception):"}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_75c6989b","line":59,"in_reply_to":"da86d52c_74c64318","updated":"2015-02-12 05:39:47.000000000","message":"Done","commit_id":"d4c01726662d71a408c1765a01dd72cc10a1bbe2"}],"nova/volume/cinder.py":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"4ddd5224c49016f664eaf836d9366e5d3375d49e","unresolved":false,"context_lines":[{"line_number":368,"context_line":"        try:"},{"line_number":369,"context_line":"            return cinderclient(context).volumes.initialize_connection("},{"line_number":370,"context_line":"                volume_id,"},{"line_number":371,"context_line":"                connector)"},{"line_number":372,"context_line":"        except cinder_exception.ClientException as ex:"},{"line_number":373,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":374,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_4eb8f5c7","line":371,"updated":"2015-02-12 23:22:39.000000000","message":"only a question\nis it possible to handle this in cinder?\nsince cinder know it\u0027s a a timeout , know what happened?","commit_id":"3b4a16c791994ef003a618150ed0991a25e1a085"},{"author":{"_account_id":9924,"name":"Jeegn Chen","email":"Jeegn.Chen@emc.com","username":"jeegn-chen"},"change_message_id":"769812e6aed31dd0def6d166314618a9f3c74083","unresolved":false,"context_lines":[{"line_number":368,"context_line":"        try:"},{"line_number":369,"context_line":"            return cinderclient(context).volumes.initialize_connection("},{"line_number":370,"context_line":"                volume_id,"},{"line_number":371,"context_line":"                connector)"},{"line_number":372,"context_line":"        except cinder_exception.ClientException as ex:"},{"line_number":373,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":374,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_96bd3105","line":371,"in_reply_to":"da86d52c_4eb8f5c7","updated":"2015-02-17 08:22:39.000000000","message":"Not all cases can be covered in Cinder side since time out may happens in HA Proxy or Cinder","commit_id":"3b4a16c791994ef003a618150ed0991a25e1a085"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"4ddd5224c49016f664eaf836d9366e5d3375d49e","unresolved":false,"context_lines":[{"line_number":375,"context_line":"                    # 500 is due to RPC timeout between Cinder-API"},{"line_number":376,"context_line":"                    #     and Cinder-Volume"},{"line_number":377,"context_line":"                    # 504 is due to timeout in HA Proxy"},{"line_number":378,"context_line":"                    if ex.code in (500, 504):"},{"line_number":379,"context_line":"                        self.terminate_connection(context,"},{"line_number":380,"context_line":"                                                  volume_id,"},{"line_number":381,"context_line":"                                                  connector)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_6ebbf9c3","line":378,"updated":"2015-02-12 23:22:39.000000000","message":"do we have a more solid exception?\n500 / 504 is too generic I think\n\nif you see neutron client, you will find \neutron_client_exc.IpAddressGenerationFailureClient:\nneutron_client_exc.MacAddressInUseClient","commit_id":"3b4a16c791994ef003a618150ed0991a25e1a085"},{"author":{"_account_id":9924,"name":"Jeegn Chen","email":"Jeegn.Chen@emc.com","username":"jeegn-chen"},"change_message_id":"769812e6aed31dd0def6d166314618a9f3c74083","unresolved":false,"context_lines":[{"line_number":375,"context_line":"                    # 500 is due to RPC timeout between Cinder-API"},{"line_number":376,"context_line":"                    #     and Cinder-Volume"},{"line_number":377,"context_line":"                    # 504 is due to timeout in HA Proxy"},{"line_number":378,"context_line":"                    if ex.code in (500, 504):"},{"line_number":379,"context_line":"                        self.terminate_connection(context,"},{"line_number":380,"context_line":"                                                  volume_id,"},{"line_number":381,"context_line":"                                                  connector)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_56f819c4","line":378,"in_reply_to":"da86d52c_6ebbf9c3","updated":"2015-02-17 08:22:39.000000000","message":"I\u0027m afraid I don\u0027t find the specific error","commit_id":"3b4a16c791994ef003a618150ed0991a25e1a085"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"4ddd5224c49016f664eaf836d9366e5d3375d49e","unresolved":false,"context_lines":[{"line_number":380,"context_line":"                                                  volume_id,"},{"line_number":381,"context_line":"                                                  connector)"},{"line_number":382,"context_line":"                except Exception:"},{"line_number":383,"context_line":"                    LOG.error(_LE(\u0027Failed to rollback the connection between \u0027"},{"line_number":384,"context_line":"                                  \u0027volume %(vol)s and host %(host)s.\u0027),"},{"line_number":385,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":386,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027]})"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_0e535de2","line":383,"updated":"2015-02-12 23:22:39.000000000","message":"import is needed, pep8 fail is valid","commit_id":"3b4a16c791994ef003a618150ed0991a25e1a085"},{"author":{"_account_id":9924,"name":"Jeegn Chen","email":"Jeegn.Chen@emc.com","username":"jeegn-chen"},"change_message_id":"a86974d3d609b4fbaeb2c449d25c531e53614686","unresolved":false,"context_lines":[{"line_number":380,"context_line":"                                                  volume_id,"},{"line_number":381,"context_line":"                                                  connector)"},{"line_number":382,"context_line":"                except Exception:"},{"line_number":383,"context_line":"                    LOG.error(_LE(\u0027Failed to rollback the connection between \u0027"},{"line_number":384,"context_line":"                                  \u0027volume %(vol)s and host %(host)s.\u0027),"},{"line_number":385,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":386,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027]})"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_36b9e579","line":383,"in_reply_to":"da86d52c_0e535de2","updated":"2015-02-17 08:38:37.000000000","message":"Done","commit_id":"3b4a16c791994ef003a618150ed0991a25e1a085"},{"author":{"_account_id":9924,"name":"Jeegn Chen","email":"Jeegn.Chen@emc.com","username":"jeegn-chen"},"change_message_id":"769812e6aed31dd0def6d166314618a9f3c74083","unresolved":false,"context_lines":[{"line_number":380,"context_line":"                                                  volume_id,"},{"line_number":381,"context_line":"                                                  connector)"},{"line_number":382,"context_line":"                except Exception:"},{"line_number":383,"context_line":"                    LOG.error(_LE(\u0027Failed to rollback the connection between \u0027"},{"line_number":384,"context_line":"                                  \u0027volume %(vol)s and host %(host)s.\u0027),"},{"line_number":385,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":386,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027]})"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_561f3909","line":383,"in_reply_to":"da86d52c_0e535de2","updated":"2015-02-17 08:22:39.000000000","message":"Thanks for the good catch!\n\nWeird, it is not reported in my local ./run_test.sh.","commit_id":"3b4a16c791994ef003a618150ed0991a25e1a085"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"5dc95fbffbd8b31b6757ec74d787eb1bb98087b9","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                    # 500 is due to RPC timeout between Cinder-API"},{"line_number":377,"context_line":"                    #     and Cinder-Volume"},{"line_number":378,"context_line":"                    # 504 is due to timeout in HA Proxy"},{"line_number":379,"context_line":"                    if ex.code in (500, 504):"},{"line_number":380,"context_line":"                        self.terminate_connection(context,"},{"line_number":381,"context_line":"                                                  volume_id,"},{"line_number":382,"context_line":"                                                  connector)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a80dd14_f4d4a548","line":379,"updated":"2015-03-05 21:32:49.000000000","message":"there are many reasons for a 500 error, not just the ones you listed.\n\nIs there a reason why we shouldn\u0027t terminate_connection on any ClientExceptions? Or a reason that cinder client shouldn\u0027t do that automatically for us?","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"49b3d6159b92d7765e5f9ab89ed182e954199c18","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                    # 500 is due to RPC timeout between Cinder-API"},{"line_number":377,"context_line":"                    #     and Cinder-Volume"},{"line_number":378,"context_line":"                    # 504 is due to timeout in HA Proxy"},{"line_number":379,"context_line":"                    if ex.code in (500, 504):"},{"line_number":380,"context_line":"                        self.terminate_connection(context,"},{"line_number":381,"context_line":"                                                  volume_id,"},{"line_number":382,"context_line":"                                                  connector)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_161ddf0e","line":379,"in_reply_to":"1aca2d91_e0f56f83","updated":"2015-09-28 17:35:05.000000000","message":"volume_api.initialize_connection is called from more than just nova.virt.block_device, it\u0027s also in the libvirt driver\u0027s post_live_migration method:\n\nhttps://review.openstack.org/#/c/202770/17/nova/virt/libvirt/driver.py\n\nSo we should handle this consistently in one place, and this method is the root so that seems to make sense.  Unless we want to do this in a static method in nova.virt.block_device and have the libvirt driver re-use that?","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a20a8925f97f7b8bdc4095896b9c3b43384ceeee","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                    # 500 is due to RPC timeout between Cinder-API"},{"line_number":377,"context_line":"                    #     and Cinder-Volume"},{"line_number":378,"context_line":"                    # 504 is due to timeout in HA Proxy"},{"line_number":379,"context_line":"                    if ex.code in (500, 504):"},{"line_number":380,"context_line":"                        self.terminate_connection(context,"},{"line_number":381,"context_line":"                                                  volume_id,"},{"line_number":382,"context_line":"                                                  connector)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_f9cffc7c","line":379,"in_reply_to":"9a1a9d01_161ddf0e","updated":"2015-09-28 17:57:16.000000000","message":"We should drop the 500/504 checks, see the discussion in the alternative change here:\n\nhttps://review.openstack.org/#/c/225278/3/nova/virt/block_device.py\n\nCinder should gracefully handle a terminate_connection call when the initialize_connection call failed - and we\u0027ll wrap the terminate_connection call so that if that fails we don\u0027t report it up the stack since we\u0027re in the excutils.save_and_reraise_exception() context.","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"916dde079af0106f4dd8dae87042dcf2134bf079","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                    # 500 is due to RPC timeout between Cinder-API"},{"line_number":377,"context_line":"                    #     and Cinder-Volume"},{"line_number":378,"context_line":"                    # 504 is due to timeout in HA Proxy"},{"line_number":379,"context_line":"                    if ex.code in (500, 504):"},{"line_number":380,"context_line":"                        self.terminate_connection(context,"},{"line_number":381,"context_line":"                                                  volume_id,"},{"line_number":382,"context_line":"                                                  connector)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_4f241aae","line":379,"in_reply_to":"9a1a9d01_f9cffc7c","updated":"2015-09-28 20:00:47.000000000","message":"Done","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"41a2f654f465e86f8a00e0a2b291bb27aa321d90","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                    # 500 is due to RPC timeout between Cinder-API"},{"line_number":377,"context_line":"                    #     and Cinder-Volume"},{"line_number":378,"context_line":"                    # 504 is due to timeout in HA Proxy"},{"line_number":379,"context_line":"                    if ex.code in (500, 504):"},{"line_number":380,"context_line":"                        self.terminate_connection(context,"},{"line_number":381,"context_line":"                                                  volume_id,"},{"line_number":382,"context_line":"                                                  connector)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aca2d91_e0f56f83","line":379,"in_reply_to":"9a80dd14_88ca6a6c","updated":"2015-05-06 19:05:59.000000000","message":"Agreed with this - we need to do this in places where intialize connection get\u0027s called.","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"3ed9f67dc3db86dda36f31aa475bc7165949131d","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                    # 500 is due to RPC timeout between Cinder-API"},{"line_number":377,"context_line":"                    #     and Cinder-Volume"},{"line_number":378,"context_line":"                    # 504 is due to timeout in HA Proxy"},{"line_number":379,"context_line":"                    if ex.code in (500, 504):"},{"line_number":380,"context_line":"                        self.terminate_connection(context,"},{"line_number":381,"context_line":"                                                  volume_id,"},{"line_number":382,"context_line":"                                                  connector)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a80dd14_88ca6a6c","line":379,"in_reply_to":"9a80dd14_f4d4a548","updated":"2015-03-06 02:07:03.000000000","message":"Cinder client is a thin layer. Usually one Cinder client interface is corresponding to one Cinder API. So initialize_connection shouldn\u0027t be calling terminate_connection. It is up to the caller to handle exceptions.\n\nIf the exception is thrown because of timeout, the backend could be still trying to attach the volume. So the volume could end up being attached to the host on the array while Nova and Cinder thought the volume is not attached due to time out.  That\u0027s why we want to call terminate_connection to clean up here.  If the exception is thrown because of some other reason, that usually means the backend failed to attach the volume to the host.  Therefore we don\u0027t need to detach it by calling terminate_connection.","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"b0b56b49a515ec13471e8d70f2cad3e3bb8c115a","unresolved":false,"context_lines":[{"line_number":381,"context_line":"                                                  volume_id,"},{"line_number":382,"context_line":"                                                  connector)"},{"line_number":383,"context_line":"                except Exception:"},{"line_number":384,"context_line":"                    LOG.error(_LE(\u0027Failed to rollback the connection between \u0027"},{"line_number":385,"context_line":"                                  \u0027volume %(vol)s and host %(host)s.\u0027),"},{"line_number":386,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":387,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027]})"}],"source_content_type":"text/x-python","patch_set":6,"id":"da9b358b_81a6710e","line":384,"updated":"2015-03-31 20:12:59.000000000","message":"I think that this error message could be misleading, in the case where a 50x error is returned for some reason other than a timeout on the backend which still results in a volume attach, i.e. network issue, AMQP issue, etc.\nIn most cases, there won\u0027t have been a connection created if we get to L#374, and the attempt to call terminate_connection will fail.\nPerhaps the error message could state this to keep the admin from seeking a connection to cleanup where there is none?\ni.e.\n\"Connection between volume %(vol)s and host %(hosts)s might have succeeded, but attempt to rollback has failed.\"","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"916dde079af0106f4dd8dae87042dcf2134bf079","unresolved":false,"context_lines":[{"line_number":381,"context_line":"                                                  volume_id,"},{"line_number":382,"context_line":"                                                  connector)"},{"line_number":383,"context_line":"                except Exception:"},{"line_number":384,"context_line":"                    LOG.error(_LE(\u0027Failed to rollback the connection between \u0027"},{"line_number":385,"context_line":"                                  \u0027volume %(vol)s and host %(host)s.\u0027),"},{"line_number":386,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":387,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027]})"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_6f279eb6","line":384,"in_reply_to":"da9b358b_81a6710e","updated":"2015-09-28 20:00:47.000000000","message":"Done","commit_id":"58960fabab7c6df92fd8f3c8fef5510874eb99e3"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7c86a5fae56f7a5a9aca9b72233bb2221e204464","unresolved":false,"context_lines":[{"line_number":351,"context_line":"    def initialize_connection(self, context, volume_id, connector):"},{"line_number":352,"context_line":"        try:"},{"line_number":353,"context_line":"            return cinderclient(context).volumes.initialize_connection("},{"line_number":354,"context_line":"                volume_id,"},{"line_number":355,"context_line":"                connector)"},{"line_number":356,"context_line":"        except cinder_exception.ClientException as ex:"},{"line_number":357,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":358,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a1a9d01_214f3f6c","line":355,"range":{"start_line":354,"start_character":16,"end_line":355,"end_character":26},"updated":"2015-09-29 23:48:33.000000000","message":"These can go on one line since you\u0027re not aligning with any parens","commit_id":"d88c9286f07db54d01952022388530f62c38015d"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"de71009c68c6c054667b8881bc269c99cddf1c66","unresolved":false,"context_lines":[{"line_number":352,"context_line":"        try:"},{"line_number":353,"context_line":"            return cinderclient(context).volumes.initialize_connection("},{"line_number":354,"context_line":"                volume_id,"},{"line_number":355,"context_line":"                connector)"},{"line_number":356,"context_line":"        except cinder_exception.ClientException as ex:"},{"line_number":357,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":358,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a1a9d01_8dc67a98","line":355,"in_reply_to":"9a1a9d01_214f3f6c","updated":"2015-09-30 04:43:16.000000000","message":"Done","commit_id":"d88c9286f07db54d01952022388530f62c38015d"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7c86a5fae56f7a5a9aca9b72233bb2221e204464","unresolved":false,"context_lines":[{"line_number":361,"context_line":"                                  \u0027Attempting to roll back.\u0027),"},{"line_number":362,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":363,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027],"},{"line_number":364,"context_line":"                               \u0027msg\u0027: ex.message})"},{"line_number":365,"context_line":"                    self.terminate_connection(context,"},{"line_number":366,"context_line":"                                              volume_id,"},{"line_number":367,"context_line":"                                              connector)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a1a9d01_de0f3e37","line":364,"updated":"2015-09-29 23:48:33.000000000","message":"-1 I don\u0027t think we want to put the log statement inside the try block. It can go before the try-except\n\nAlso, I noticed in the test that the exception object can have a status code in it. Would that be important to log too, or is the message sufficient?","commit_id":"d88c9286f07db54d01952022388530f62c38015d"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"de71009c68c6c054667b8881bc269c99cddf1c66","unresolved":false,"context_lines":[{"line_number":361,"context_line":"                                  \u0027Attempting to roll back.\u0027),"},{"line_number":362,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":363,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027],"},{"line_number":364,"context_line":"                               \u0027msg\u0027: ex.message})"},{"line_number":365,"context_line":"                    self.terminate_connection(context,"},{"line_number":366,"context_line":"                                              volume_id,"},{"line_number":367,"context_line":"                                              connector)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a1a9d01_4dbce205","line":364,"in_reply_to":"9a1a9d01_de0f3e37","updated":"2015-09-30 04:43:16.000000000","message":"Moved log before the try-except.\n\nLogged error code.","commit_id":"d88c9286f07db54d01952022388530f62c38015d"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7c86a5fae56f7a5a9aca9b72233bb2221e204464","unresolved":false,"context_lines":[{"line_number":362,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":363,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027],"},{"line_number":364,"context_line":"                               \u0027msg\u0027: ex.message})"},{"line_number":365,"context_line":"                    self.terminate_connection(context,"},{"line_number":366,"context_line":"                                              volume_id,"},{"line_number":367,"context_line":"                                              connector)"},{"line_number":368,"context_line":"                except Exception as exc:"},{"line_number":369,"context_line":"                    LOG.error(_LE(\u0027Connection between volume %(vol)s and host \u0027"},{"line_number":370,"context_line":"                                  \u0027%(host)s might have succeeded, but attempt \u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a1a9d01_412d9393","line":367,"range":{"start_line":365,"start_character":20,"end_line":367,"end_character":56},"updated":"2015-09-29 23:48:33.000000000","message":"This statement can fit on one line","commit_id":"d88c9286f07db54d01952022388530f62c38015d"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"de71009c68c6c054667b8881bc269c99cddf1c66","unresolved":false,"context_lines":[{"line_number":364,"context_line":"                               \u0027msg\u0027: ex.message})"},{"line_number":365,"context_line":"                    self.terminate_connection(context,"},{"line_number":366,"context_line":"                                              volume_id,"},{"line_number":367,"context_line":"                                              connector)"},{"line_number":368,"context_line":"                except Exception as exc:"},{"line_number":369,"context_line":"                    LOG.error(_LE(\u0027Connection between volume %(vol)s and host \u0027"},{"line_number":370,"context_line":"                                  \u0027%(host)s might have succeeded, but attempt \u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a1a9d01_0d390aa4","line":367,"in_reply_to":"9a1a9d01_412d9393","updated":"2015-09-30 04:43:16.000000000","message":"Done","commit_id":"d88c9286f07db54d01952022388530f62c38015d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b24f49cd8813529cc75e945001572c81829ef5aa","unresolved":false,"context_lines":[{"line_number":356,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":357,"context_line":"                LOG.error(_LE(\u0027Initialize connection failed for volume \u0027"},{"line_number":358,"context_line":"                              \u0027%(vol)s on host %(host)s. Error: %(msg)s \u0027"},{"line_number":359,"context_line":"                              \u0027Code: %(code)s. Attempting to roll back.\u0027),"},{"line_number":360,"context_line":"                          {\u0027vol\u0027: volume_id,"},{"line_number":361,"context_line":"                           \u0027host\u0027: connector[\u0027host\u0027],"},{"line_number":362,"context_line":"                           \u0027msg\u0027: ex.message,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_9c35e5f8","line":359,"updated":"2015-10-02 02:50:14.000000000","message":"Should we say \u0027Attempting to terminate connection.\u0027 rather than rollback so it\u0027s more specific?  Just a thought.","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f5318931a77db221db36ddec3ed7cac2fafc2a24","unresolved":false,"context_lines":[{"line_number":356,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":357,"context_line":"                LOG.error(_LE(\u0027Initialize connection failed for volume \u0027"},{"line_number":358,"context_line":"                              \u0027%(vol)s on host %(host)s. Error: %(msg)s \u0027"},{"line_number":359,"context_line":"                              \u0027Code: %(code)s. Attempting to roll back.\u0027),"},{"line_number":360,"context_line":"                          {\u0027vol\u0027: volume_id,"},{"line_number":361,"context_line":"                           \u0027host\u0027: connector[\u0027host\u0027],"},{"line_number":362,"context_line":"                           \u0027msg\u0027: ex.message,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_0ef65bf9","line":359,"in_reply_to":"9a1a9d01_9c35e5f8","updated":"2015-10-02 20:56:00.000000000","message":"Done","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b24f49cd8813529cc75e945001572c81829ef5aa","unresolved":false,"context_lines":[{"line_number":358,"context_line":"                              \u0027%(vol)s on host %(host)s. Error: %(msg)s \u0027"},{"line_number":359,"context_line":"                              \u0027Code: %(code)s. Attempting to roll back.\u0027),"},{"line_number":360,"context_line":"                          {\u0027vol\u0027: volume_id,"},{"line_number":361,"context_line":"                           \u0027host\u0027: connector[\u0027host\u0027],"},{"line_number":362,"context_line":"                           \u0027msg\u0027: ex.message,"},{"line_number":363,"context_line":"                           \u0027code\u0027: ex.code})"},{"line_number":364,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_fc5d0149","line":361,"updated":"2015-10-02 02:50:14.000000000","message":"Are we sure that host is going to be in here?  Maybe connector.get(\u0027host\u0027) would be more prudent.","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f5318931a77db221db36ddec3ed7cac2fafc2a24","unresolved":false,"context_lines":[{"line_number":358,"context_line":"                              \u0027%(vol)s on host %(host)s. Error: %(msg)s \u0027"},{"line_number":359,"context_line":"                              \u0027Code: %(code)s. Attempting to roll back.\u0027),"},{"line_number":360,"context_line":"                          {\u0027vol\u0027: volume_id,"},{"line_number":361,"context_line":"                           \u0027host\u0027: connector[\u0027host\u0027],"},{"line_number":362,"context_line":"                           \u0027msg\u0027: ex.message,"},{"line_number":363,"context_line":"                           \u0027code\u0027: ex.code})"},{"line_number":364,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_ced86382","line":361,"in_reply_to":"9a1a9d01_fc5d0149","updated":"2015-10-02 20:56:00.000000000","message":"Done","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b24f49cd8813529cc75e945001572c81829ef5aa","unresolved":false,"context_lines":[{"line_number":359,"context_line":"                              \u0027Code: %(code)s. Attempting to roll back.\u0027),"},{"line_number":360,"context_line":"                          {\u0027vol\u0027: volume_id,"},{"line_number":361,"context_line":"                           \u0027host\u0027: connector[\u0027host\u0027],"},{"line_number":362,"context_line":"                           \u0027msg\u0027: ex.message,"},{"line_number":363,"context_line":"                           \u0027code\u0027: ex.code})"},{"line_number":364,"context_line":"                try:"},{"line_number":365,"context_line":"                    self.terminate_connection(context, volume_id, connector)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_bc578925","line":362,"updated":"2015-10-02 02:50:14.000000000","message":"I think in newer python, Exception.message is deprecated so we should do this instead:\n\nsix.text_type(ex)","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f5318931a77db221db36ddec3ed7cac2fafc2a24","unresolved":false,"context_lines":[{"line_number":359,"context_line":"                              \u0027Code: %(code)s. Attempting to roll back.\u0027),"},{"line_number":360,"context_line":"                          {\u0027vol\u0027: volume_id,"},{"line_number":361,"context_line":"                           \u0027host\u0027: connector[\u0027host\u0027],"},{"line_number":362,"context_line":"                           \u0027msg\u0027: ex.message,"},{"line_number":363,"context_line":"                           \u0027code\u0027: ex.code})"},{"line_number":364,"context_line":"                try:"},{"line_number":365,"context_line":"                    self.terminate_connection(context, volume_id, connector)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_8ee26b2e","line":362,"in_reply_to":"9a1a9d01_bc578925","updated":"2015-10-02 20:56:00.000000000","message":"Done","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b24f49cd8813529cc75e945001572c81829ef5aa","unresolved":false,"context_lines":[{"line_number":366,"context_line":"                except Exception as exc:"},{"line_number":367,"context_line":"                    LOG.error(_LE(\u0027Connection between volume %(vol)s and host \u0027"},{"line_number":368,"context_line":"                                  \u0027%(host)s might have succeeded, but attempt \u0027"},{"line_number":369,"context_line":"                                  \u0027to roll back has failed. Error: %(msg)s \u0027"},{"line_number":370,"context_line":"                                  \u0027Code: %(code)s.\u0027),"},{"line_number":371,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":372,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_1c09d531","line":369,"updated":"2015-10-02 02:50:14.000000000","message":"Would it be worthwhile to say anything in here about suggesting that the operator reading this check something on the host and attempt a manual cleanup - or that they might need to do that?  That might be a bit detailed, but I\u0027m trying to think of next actions if we\u0027re logging an error for this.  What would I do if I saw this?","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f5318931a77db221db36ddec3ed7cac2fafc2a24","unresolved":false,"context_lines":[{"line_number":366,"context_line":"                except Exception as exc:"},{"line_number":367,"context_line":"                    LOG.error(_LE(\u0027Connection between volume %(vol)s and host \u0027"},{"line_number":368,"context_line":"                                  \u0027%(host)s might have succeeded, but attempt \u0027"},{"line_number":369,"context_line":"                                  \u0027to roll back has failed. Error: %(msg)s \u0027"},{"line_number":370,"context_line":"                                  \u0027Code: %(code)s.\u0027),"},{"line_number":371,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":372,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_19f6a3f9","line":369,"in_reply_to":"9a1a9d01_1c09d531","updated":"2015-10-02 20:56:00.000000000","message":"Ok, I added \"Validate the connection and determine if manual cleanup is needed\".  Not sure if it is appropriate.","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b24f49cd8813529cc75e945001572c81829ef5aa","unresolved":false,"context_lines":[{"line_number":369,"context_line":"                                  \u0027to roll back has failed. Error: %(msg)s \u0027"},{"line_number":370,"context_line":"                                  \u0027Code: %(code)s.\u0027),"},{"line_number":371,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":372,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027],"},{"line_number":373,"context_line":"                               \u0027msg\u0027: exc.message,"},{"line_number":374,"context_line":"                               \u0027code\u0027: exc.code})"},{"line_number":375,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_5c3f4dd6","line":372,"updated":"2015-10-02 02:50:14.000000000","message":"connector.get(\u0027host\u0027)","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f5318931a77db221db36ddec3ed7cac2fafc2a24","unresolved":false,"context_lines":[{"line_number":369,"context_line":"                                  \u0027to roll back has failed. Error: %(msg)s \u0027"},{"line_number":370,"context_line":"                                  \u0027Code: %(code)s.\u0027),"},{"line_number":371,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":372,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027],"},{"line_number":373,"context_line":"                               \u0027msg\u0027: exc.message,"},{"line_number":374,"context_line":"                               \u0027code\u0027: exc.code})"},{"line_number":375,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_4ed3f35f","line":372,"in_reply_to":"9a1a9d01_5c3f4dd6","updated":"2015-10-02 20:56:00.000000000","message":"Done","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b24f49cd8813529cc75e945001572c81829ef5aa","unresolved":false,"context_lines":[{"line_number":370,"context_line":"                                  \u0027Code: %(code)s.\u0027),"},{"line_number":371,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":372,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027],"},{"line_number":373,"context_line":"                               \u0027msg\u0027: exc.message,"},{"line_number":374,"context_line":"                               \u0027code\u0027: exc.code})"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_fc2421c7","line":373,"updated":"2015-10-02 02:50:14.000000000","message":"six.text_type(exc)","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f5318931a77db221db36ddec3ed7cac2fafc2a24","unresolved":false,"context_lines":[{"line_number":370,"context_line":"                                  \u0027Code: %(code)s.\u0027),"},{"line_number":371,"context_line":"                              {\u0027vol\u0027: volume_id,"},{"line_number":372,"context_line":"                               \u0027host\u0027: connector[\u0027host\u0027],"},{"line_number":373,"context_line":"                               \u0027msg\u0027: exc.message,"},{"line_number":374,"context_line":"                               \u0027code\u0027: exc.code})"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_eec9a7ad","line":373,"in_reply_to":"9a1a9d01_fc2421c7","updated":"2015-10-02 20:56:00.000000000","message":"Done","commit_id":"c5468cdf2e19a181d08cf6d1327a003e3a4ee442"}]}
