)]}'
{"ironic/drivers/modules/deploy_utils.py":[{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"6ee126fc6571fa3c9ff53e8a35e9da31cce1022c","unresolved":false,"context_lines":[{"line_number":408,"context_line":"        raise exception.InstanceDeployFailure(_(\"Parent device \u0027%s\u0027 not found\")"},{"line_number":409,"context_line":"                                              % dev)"},{"line_number":410,"context_line":"    try:"},{"line_number":411,"context_line":"        yield dev"},{"line_number":412,"context_line":"    except processutils.ProcessExecutionError as err:"},{"line_number":413,"context_line":"        with excutils.save_and_reraise_exception():"},{"line_number":414,"context_line":"            LOG.error(_LE(\"Deploy to address %s failed.\"), address)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa6399be_eea2d299","line":411,"updated":"2016-10-18 16:49:25.000000000","message":"If the exception is possible only during login_iscsi function, I\u0027d do the following:\n\ntry:\n    login_iscsi(address, port, iqn)\n    if not disk_utils.is_block_device(dev):\n        raise exception.InstanceDeployFailure(_(\"Parent device \u0027%s\u0027 not found\")\n                                              % dev)\n    try:\n        yield dev\n    except processutils.ProcessExecutionError as err:\n        with excutils.save_and_reraise_exception():\n            LOG.error(_LE(\"Deploy to address %s failed.\"), address)\n            LOG.error(_LE(\"Command: %s\"), err.cmd)\n            LOG.error(_LE(\"StdOut: %r\"), err.stdout)\n            LOG.error(_LE(\"StdErr: %r\"), err.stderr)\n    except exception.InstanceDeployFailure as e:\n        with excutils.save_and_reraise_exception():\n            LOG.error(_LE(\"Deploy to address %s failed.\"), address)\n            LOG.error(e)\nfinally:\n    logout_iscsi(address, port, iqn)\n    delete_iscsi(address, port, iqn)\n\nRe-raising InstanceDeployFailure after check of is_block_device is not a big deal I think.","commit_id":"ec97053e839f5965429c5fa3dabd10f0380ce9f8"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"682ee5b87a98041a71d13c03c8d74ffd7a29f588","unresolved":false,"context_lines":[{"line_number":408,"context_line":"        raise exception.InstanceDeployFailure(_(\"Parent device \u0027%s\u0027 not found\")"},{"line_number":409,"context_line":"                                              % dev)"},{"line_number":410,"context_line":"    try:"},{"line_number":411,"context_line":"        yield dev"},{"line_number":412,"context_line":"    except processutils.ProcessExecutionError as err:"},{"line_number":413,"context_line":"        with excutils.save_and_reraise_exception():"},{"line_number":414,"context_line":"            LOG.error(_LE(\"Deploy to address %s failed.\"), address)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5da102_d2c26852","line":411,"in_reply_to":"fa6399be_eea2d299","updated":"2016-11-03 13:38:18.000000000","message":"Done","commit_id":"ec97053e839f5965429c5fa3dabd10f0380ce9f8"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"2dda0d0468e10a6b0a2b53f490071b1d4043a0eb","unresolved":false,"context_lines":[{"line_number":419,"context_line":"                LOG.error(_LE(\"Deploy to address %s failed.\"), address)"},{"line_number":420,"context_line":"                LOG.error(e)"},{"line_number":421,"context_line":"    finally:"},{"line_number":422,"context_line":"        logout_iscsi(address, port, iqn)"},{"line_number":423,"context_line":"        delete_iscsi(address, port, iqn)"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5da102_93c36b38","line":422,"updated":"2016-11-04 12:18:06.000000000","message":"if login_iscsi fails, this will raise. we probably need to check if login was successful. or even better, we should handle exceptions from login_iscsi:\n\n try:\n   login_iscsi(..)\n except ProcessExecutionError:\n   with excutils.save_and_reraise_exception():\n      LOG.error(\"login failed\")\n      delete_iscsi(...)\n\nthen we won\u0027t have to move it to this try..finally.. block","commit_id":"217f2b6f6470449d2522c72732f9f13efa64ad81"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"11c2c64681a26d1b143e50f90cf767406124b7c6","unresolved":false,"context_lines":[{"line_number":419,"context_line":"                LOG.error(_LE(\"Deploy to address %s failed.\"), address)"},{"line_number":420,"context_line":"                LOG.error(e)"},{"line_number":421,"context_line":"    finally:"},{"line_number":422,"context_line":"        logout_iscsi(address, port, iqn)"},{"line_number":423,"context_line":"        delete_iscsi(address, port, iqn)"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a629dbe_c017cf52","line":422,"in_reply_to":"9a629dbe_11175c52","updated":"2016-11-07 11:51:33.000000000","message":"Right. Then we need to somehow handle potential errors here, or add try..finally.. to login_iscsi itself. I think the latter might be better.","commit_id":"217f2b6f6470449d2522c72732f9f13efa64ad81"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"f9031d793bd6a4ec1e6dd46e58ed2afd592d1d4c","unresolved":false,"context_lines":[{"line_number":419,"context_line":"                LOG.error(_LE(\"Deploy to address %s failed.\"), address)"},{"line_number":420,"context_line":"                LOG.error(e)"},{"line_number":421,"context_line":"    finally:"},{"line_number":422,"context_line":"        logout_iscsi(address, port, iqn)"},{"line_number":423,"context_line":"        delete_iscsi(address, port, iqn)"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a629dbe_11175c52","line":422,"in_reply_to":"ba5da102_93c36b38","updated":"2016-11-07 11:15:08.000000000","message":"login_iscsi() (https://review.openstack.org/#/c/388092/1/ironic/drivers/modules/deploy_utils.py@134) may be completed successfully.\nThe error occurs later during verify_iscsi_connection() or force_iscsi_lun_update() or check_file_system_for_iscsi_device() https://review.openstack.org/#/c/388092/1/ironic/drivers/modules/deploy_utils.py@144","commit_id":"217f2b6f6470449d2522c72732f9f13efa64ad81"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"eb553b87d458481499b95aaee513f68ca0452b89","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        # Ensure the login complete"},{"line_number":145,"context_line":"        verify_iscsi_connection(target_iqn)"},{"line_number":146,"context_line":"        # force iSCSI initiator to re-read luns"},{"line_number":147,"context_line":"        force_iscsi_lun_update(target_iqn)"},{"line_number":148,"context_line":"        # ensure file system sees the block device"},{"line_number":149,"context_line":"        check_file_system_for_iscsi_device(portal_address,"},{"line_number":150,"context_line":"                                           portal_port,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a629dbe_385560c5","line":147,"updated":"2016-11-10 22:31:51.000000000","message":"What if this raises process execution error? It won\u0027t be handled. Is it possible that iscsi connection verified successfully but lun update fails?","commit_id":"01c6eccb19a8f1bcd2f8f33739f20c8d004e7c23"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"c11abdb365bc103b9c719529b531f4bc8fd1fb65","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        # Ensure the login complete"},{"line_number":145,"context_line":"        verify_iscsi_connection(target_iqn)"},{"line_number":146,"context_line":"        # force iSCSI initiator to re-read luns"},{"line_number":147,"context_line":"        force_iscsi_lun_update(target_iqn)"},{"line_number":148,"context_line":"        # ensure file system sees the block device"},{"line_number":149,"context_line":"        check_file_system_for_iscsi_device(portal_address,"},{"line_number":150,"context_line":"                                           portal_port,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_9342f766","line":147,"in_reply_to":"9a629dbe_385560c5","updated":"2017-02-07 11:18:27.000000000","message":"Done for 1st. Yes for 2nd for example we may lost network connectivity in that moment.","commit_id":"01c6eccb19a8f1bcd2f8f33739f20c8d004e7c23"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"eb553b87d458481499b95aaee513f68ca0452b89","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    except exception.InstanceDeployFailure as e:"},{"line_number":153,"context_line":"        logout_iscsi(portal_address, portal_port, target_iqn)"},{"line_number":154,"context_line":"        delete_iscsi(portal_address, portal_port, target_iqn)"},{"line_number":155,"context_line":"        raise exception.InstanceDeployFailure(reason\u003de)"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"def check_file_system_for_iscsi_device(portal_address,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a629dbe_58ecd4f2","line":155,"updated":"2016-11-10 22:31:51.000000000","message":"There is no point in doing this, you can just use save and reraise  exception from Oslo utils.","commit_id":"01c6eccb19a8f1bcd2f8f33739f20c8d004e7c23"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"c11abdb365bc103b9c719529b531f4bc8fd1fb65","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    except exception.InstanceDeployFailure as e:"},{"line_number":153,"context_line":"        logout_iscsi(portal_address, portal_port, target_iqn)"},{"line_number":154,"context_line":"        delete_iscsi(portal_address, portal_port, target_iqn)"},{"line_number":155,"context_line":"        raise exception.InstanceDeployFailure(reason\u003de)"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"def check_file_system_for_iscsi_device(portal_address,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_3354e31f","line":155,"in_reply_to":"9a629dbe_5453ab16","updated":"2017-02-07 11:18:27.000000000","message":"Done","commit_id":"01c6eccb19a8f1bcd2f8f33739f20c8d004e7c23"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"147e3cd06293d861071a6e4e865c6f0a3432be40","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    except exception.InstanceDeployFailure as e:"},{"line_number":153,"context_line":"        logout_iscsi(portal_address, portal_port, target_iqn)"},{"line_number":154,"context_line":"        delete_iscsi(portal_address, portal_port, target_iqn)"},{"line_number":155,"context_line":"        raise exception.InstanceDeployFailure(reason\u003de)"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"def check_file_system_for_iscsi_device(portal_address,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a629dbe_5453ab16","line":155,"in_reply_to":"9a629dbe_58ecd4f2","updated":"2016-11-11 13:09:34.000000000","message":"+1 but exception can be raised also from l153-154. Oslo docstring: \"If another exception occurs, the saved exception is logged and the new exception is re-raised.\" I think better solution here is log exception from l153-154 if raised and re-raise original.","commit_id":"01c6eccb19a8f1bcd2f8f33739f20c8d004e7c23"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"2b895dab41169f420f47cb6c582667a5b3521865","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        with excutils.save_and_reraise_exception():"},{"line_number":170,"context_line":"            LOG.error(_LE(\"Failed to login to an iSCSI target due to %s\"),"},{"line_number":171,"context_line":"                      e)"},{"line_number":172,"context_line":"            logout_iscsi(portal_address, portal_port, target_iqn)"},{"line_number":173,"context_line":"            delete_iscsi(portal_address, portal_port, target_iqn)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"def check_file_system_for_iscsi_device(portal_address,"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_10c4388f","line":173,"range":{"start_line":172,"start_character":12,"end_line":173,"end_character":65},"updated":"2017-02-07 12:56:02.000000000","message":"I think we should raise only original exception from l160-166 here, what about\n\n error \u003d False\n try:\n     ...\n except ...\n     with excutils.save_and_reraise_exception():\n         LOG.error(...\n         error \u003d True\n finally:\n     if error:\n         try:\n             logout_iscsi(...\n             delete_iscsi(...\n         except ...\n             LOG.warning(...\n\nOr \"hack\" variaht:\n\n try:\n     ...\n except ...\n     with excutils.save_and_reraise_exception():\n         LOG.error(...\n         try:\n             logout_iscsi(...\n             delete_iscsi(...\n         except ...\n             LOG.warning(...\n             sys.exc_clear()","commit_id":"8493401ec9b767529e3f93c09f3b4c9b883c5170"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"56f49f15e01274a2f606ff46b512c89a76473035","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        with excutils.save_and_reraise_exception():"},{"line_number":170,"context_line":"            LOG.error(_LE(\"Failed to login to an iSCSI target due to %s\"),"},{"line_number":171,"context_line":"                      e)"},{"line_number":172,"context_line":"            logout_iscsi(portal_address, portal_port, target_iqn)"},{"line_number":173,"context_line":"            delete_iscsi(portal_address, portal_port, target_iqn)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"def check_file_system_for_iscsi_device(portal_address,"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_ab259309","line":173,"range":{"start_line":172,"start_character":12,"end_line":173,"end_character":65},"in_reply_to":"1a430d35_10c4388f","updated":"2017-02-08 08:11:24.000000000","message":"The first variant will not work as finally is always executed, and we shouldn\u0027t call logout_,delete_ if no errors occurred.\n\nWe don\u0027t wrap cleaunp of resources with try: catch at the moment, there is an example [0]. Why we should do that to provide better description in the logs? It looks like a separate issue not related to this patch wdyt?\n\n[0] https://github.com/openstack/ironic/blob/31d889a7c45c63664969c89878e88652697b7949/ironic/drivers/modules/deploy_utils.py#L441","commit_id":"8493401ec9b767529e3f93c09f3b4c9b883c5170"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"5473cb38f6c08dc9a56884ea480bfe9bc052504e","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        with excutils.save_and_reraise_exception():"},{"line_number":170,"context_line":"            LOG.error(_LE(\"Failed to login to an iSCSI target due to %s\"),"},{"line_number":171,"context_line":"                      e)"},{"line_number":172,"context_line":"            logout_iscsi(portal_address, portal_port, target_iqn)"},{"line_number":173,"context_line":"            delete_iscsi(portal_address, portal_port, target_iqn)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"def check_file_system_for_iscsi_device(portal_address,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba2be162_71e2c330","line":173,"range":{"start_line":172,"start_character":12,"end_line":173,"end_character":65},"in_reply_to":"1a430d35_ab259309","updated":"2017-03-03 11:45:03.000000000","message":"Done","commit_id":"8493401ec9b767529e3f93c09f3b4c9b883c5170"}],"releasenotes/notes/clear-hung-iscsi-sessions-d3b55c4c65fa4c8b.yaml":[{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"eb553b87d458481499b95aaee513f68ca0452b89","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - An issue when after failed deployment hung iscsi sessions"},{"line_number":4,"context_line":"    were left."}],"source_content_type":"text/x-yaml","patch_set":4,"id":"9a629dbe_78e0b8cd","line":4,"updated":"2016-11-10 22:31:51.000000000","message":"Fixes an issue with leaving iscsi session hanging after failing iscsi deployment.","commit_id":"01c6eccb19a8f1bcd2f8f33739f20c8d004e7c23"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"cae4ac8b6ee8b0a869345e117bd8d9020c9f1592","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"7a25e98e_7573324e","side":"PARENT","updated":"2017-03-13 19:53:54.000000000","message":"an issue with hung iscsi sessions not being cleaned up in case of deploy failure","commit_id":"77bcccf98c99eecc22b97c73d14ff5d1bdce7e8d"}]}
