)]}'
{"etc/ironic/ironic.conf.sample":[{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"b46e2d59d51afc376f8e1c57e7d0960e82e65d08","unresolved":false,"context_lines":[{"line_number":1208,"context_line":"# Maximum retries in case of connection error or deadlock"},{"line_number":1209,"context_line":"# error before error is raised. Set to -1 to specify an"},{"line_number":1210,"context_line":"# infinite retry count. (integer value)"},{"line_number":1211,"context_line":"#db_max_retries \u003d 5"},{"line_number":1212,"context_line":""},{"line_number":1213,"context_line":""},{"line_number":1214,"context_line":"[deploy]"}],"source_content_type":"application/octet-stream","patch_set":15,"id":"ba2be162_ef1f5259","line":1211,"range":{"start_line":1211,"start_character":18,"end_line":1211,"end_character":19},"updated":"2017-02-28 15:50:28.000000000","message":"this is statically set value will be overridden on next tox -e genconfig.\nThe unit tests are missed for this case, we override default in ironic, so would be good to have a test that checks default value.","commit_id":"3428cb74f0a6fe05c23cf00dc66da4c1d9766409"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"453a8a4dfaba3adfe6d46d72c3e3dbd54a5574cd","unresolved":false,"context_lines":[{"line_number":1208,"context_line":"# Maximum retries in case of connection error or deadlock"},{"line_number":1209,"context_line":"# error before error is raised. Set to -1 to specify an"},{"line_number":1210,"context_line":"# infinite retry count. (integer value)"},{"line_number":1211,"context_line":"#db_max_retries \u003d 5"},{"line_number":1212,"context_line":""},{"line_number":1213,"context_line":""},{"line_number":1214,"context_line":"[deploy]"}],"source_content_type":"application/octet-stream","patch_set":15,"id":"ba2be162_59abc4d6","line":1211,"range":{"start_line":1211,"start_character":18,"end_line":1211,"end_character":19},"in_reply_to":"ba2be162_ef1f5259","updated":"2017-03-06 21:14:37.000000000","message":"I missed this. I didn\u0027t realize that this file had been manually modified as opposed to generated via \u0027tox -egenconfig\u0027 :-(\n\nWhat this means is that starting with this patch, ironic will use the default value of 5. However, when this file gets updated, it\u0027ll show \u0027#db_max_retries \u003d 20\u0027 even though it is really 5.\n\nIf I had known this, I would not have approved it :-( I\u0027m not sure what Vasyl means by missing unit tests; that is separate from this issue of manually updating this file?","commit_id":"3428cb74f0a6fe05c23cf00dc66da4c1d9766409"}],"ironic/conf/database.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"2a406a57c019669c8de19692cf0da703b4f8dc6f","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    conf.register_opts(opts, group\u003d\u0027database\u0027)"},{"line_number":29,"context_line":"    # Change the oslo_db side default to 5"},{"line_number":30,"context_line":"    conf.import_opt(\u0027db_max_retries\u0027, \u0027ironic.db.api\u0027, group\u003d\u0027database\u0027)"},{"line_number":31,"context_line":"    conf.set_override(\u0027db_max_retries\u0027, 5, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa31d9ce_4a74c8ce","line":31,"updated":"2017-02-10 03:26:16.000000000","message":"will this show up in our ironic.conf.sample if we regenerate it?","commit_id":"768fdc220d0688cb6d4187b7f10e78165e6cb4b6"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"bb64bf337069eb3bdb6dcb238655fb81399fcbc2","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    conf.register_opts(opts, group\u003d\u0027database\u0027)"},{"line_number":29,"context_line":"    # Change the oslo_db side default to 5"},{"line_number":30,"context_line":"    conf.import_opt(\u0027db_max_retries\u0027, \u0027ironic.db.api\u0027, group\u003d\u0027database\u0027)"},{"line_number":31,"context_line":"    conf.set_override(\u0027db_max_retries\u0027, 5, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa31d9ce_4f7e81e5","line":31,"in_reply_to":"fa31d9ce_4a74c8ce","updated":"2017-02-10 14:00:14.000000000","message":"Nope, it will not. To show it in the sample, I need to do something like described here http://docs.openstack.org/developer/oslo.config/generator.html#modifying-defaults-from-other-namespaces\n\nThe problem is, oslo_db.options.set_defaults (which is a recommended way in that ^^ doc to override defaults) method does not allow overriding db_max_retries - https://github.com/openstack/oslo.db/blob/b19738a13a08f9ff5ac2357060250d121c680163/oslo_db/options.py#L149\n\nMaybe it\u0027s better to leave it as is, 20? Also, in case of galera, it does not seem to mean the actual deadlock, but an indication to retry the write as it did not happen http://galeracluster.com/documentation-webpages/limitations.html#transaction-commits\n\nIn nova, they use wrap_db_retry hardcoding the value to 5, but that actually makes db_max_retries option useless, this 5 will override it. I\u0027d prefer keeping the possibility to use the config option.\n\nSo, my opinion is, to leave the option untouched and let the backend to handle this.","commit_id":"768fdc220d0688cb6d4187b7f10e78165e6cb4b6"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"052e6500f392d2d5b0ddc5c5fd0530d1067c004f","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    conf.register_opts(opts, group\u003d\u0027database\u0027)"},{"line_number":29,"context_line":"    # Change the oslo_db side default to 5"},{"line_number":30,"context_line":"    conf.import_opt(\u0027db_max_retries\u0027, \u0027ironic.db.api\u0027, group\u003d\u0027database\u0027)"},{"line_number":31,"context_line":"    conf.set_override(\u0027db_max_retries\u0027, 5, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da36d5c6_860f602d","line":31,"in_reply_to":"fa31d9ce_4f7e81e5","updated":"2017-02-21 12:23:46.000000000","message":"+1 to do not change oslo.db default and allow to use config option to set this value instead of hardcoding it.\n\nOslo team should checked all pros and cons when picking default value of 20.\n\nhttps://github.com/openstack/oslo.db/blob/b19738a13a08f9ff5ac2357060250d121c680163/oslo_db/options.py#L138\n\nIf we think 20 is to high we can start discussion with them to change the default.  wdyt?\n\nalso set_override will change any value in config file if it was changed by user https://github.com/openstack/oslo.config/blob/3ffb18ea600dd2e8455683e20dea79d871a221e2/oslo_config/cfg.py#L2574\nappropriate is set_default() here.","commit_id":"768fdc220d0688cb6d4187b7f10e78165e6cb4b6"}],"ironic/db/sqlalchemy/api.py":[{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"8aa1ced47a75efbed6a7f4dbe52cb04f314f0160","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        return _paginate_query(models.Node, limit, marker,"},{"line_number":250,"context_line":"                               sort_key, sort_dir, query)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003d5, retry_on_deadlock\u003dTrue)"},{"line_number":253,"context_line":"    def reserve_node(self, tag, node_id):"},{"line_number":254,"context_line":"        with _session_for_write():"},{"line_number":255,"context_line":"            query \u003d _get_node_query_with_tags()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a629dbe_1a7583ca","line":252,"range":{"start_line":252,"start_character":30,"end_line":252,"end_character":44},"updated":"2016-11-08 10:08:47.000000000","message":"Please do not hardcode this value because there is already oslo.db config option\n\n# Maximum retries in case of connection error or deadlock\n# error before error is raised. Set to -1 to specify an\n# infinite retry count. (integer value)\n#db_max_retries \u003d 20\n\nLooks like you should use this decorator https://github.com/openstack/oslo.db/blob/master/oslo_db/api.py#L65","commit_id":"0aeb8a8d8671eb63d081f917cceae527f4dd5ce2"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"5af63cd27ce049f8d10ada60ebb096fa42daea1b","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        return _paginate_query(models.Node, limit, marker,"},{"line_number":250,"context_line":"                               sort_key, sort_dir, query)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003d5, retry_on_deadlock\u003dTrue)"},{"line_number":253,"context_line":"    def reserve_node(self, tag, node_id):"},{"line_number":254,"context_line":"        with _session_for_write():"},{"line_number":255,"context_line":"            query \u003d _get_node_query_with_tags()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_18311e0c","line":252,"range":{"start_line":252,"start_character":30,"end_line":252,"end_character":44},"in_reply_to":"5a74a57a_00c3d9ed","updated":"2017-01-02 14:08:34.000000000","message":"I tagged the touch_conductor method with safe_for_db_retry.","commit_id":"0aeb8a8d8671eb63d081f917cceae527f4dd5ce2"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"d384791d39405fe38bc0bd81bb93a38b80db5713","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        return _paginate_query(models.Node, limit, marker,"},{"line_number":250,"context_line":"                               sort_key, sort_dir, query)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003d5, retry_on_deadlock\u003dTrue)"},{"line_number":253,"context_line":"    def reserve_node(self, tag, node_id):"},{"line_number":254,"context_line":"        with _session_for_write():"},{"line_number":255,"context_line":"            query \u003d _get_node_query_with_tags()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a74a57a_00c3d9ed","line":252,"range":{"start_line":252,"start_character":30,"end_line":252,"end_character":44},"in_reply_to":"5a74a57a_711e8a64","updated":"2016-11-28 12:46:30.000000000","message":"There is a special decorator https://github.com/openstack/oslo.db/blob/master/oslo_db/api.py#L44 Note that this retry can be unsafe.","commit_id":"0aeb8a8d8671eb63d081f917cceae527f4dd5ce2"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"5af63cd27ce049f8d10ada60ebb096fa42daea1b","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        return _paginate_query(models.Node, limit, marker,"},{"line_number":250,"context_line":"                               sort_key, sort_dir, query)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003d5, retry_on_deadlock\u003dTrue)"},{"line_number":253,"context_line":"    def reserve_node(self, tag, node_id):"},{"line_number":254,"context_line":"        with _session_for_write():"},{"line_number":255,"context_line":"            query \u003d _get_node_query_with_tags()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_3836e203","line":252,"range":{"start_line":252,"start_character":30,"end_line":252,"end_character":44},"in_reply_to":"9a629dbe_1a7583ca","updated":"2017-01-02 14:08:34.000000000","message":"Done","commit_id":"0aeb8a8d8671eb63d081f917cceae527f4dd5ce2"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"fab8e7c32d7cb4ca58a268aa9052e6036ba9b4a0","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        return _paginate_query(models.Node, limit, marker,"},{"line_number":250,"context_line":"                               sort_key, sort_dir, query)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003d5, retry_on_deadlock\u003dTrue)"},{"line_number":253,"context_line":"    def reserve_node(self, tag, node_id):"},{"line_number":254,"context_line":"        with _session_for_write():"},{"line_number":255,"context_line":"            query \u003d _get_node_query_with_tags()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a629dbe_80c02a2c","line":252,"range":{"start_line":252,"start_character":30,"end_line":252,"end_character":44},"in_reply_to":"9a629dbe_1a7583ca","updated":"2016-11-08 19:06:13.000000000","message":"Hm ,after doing a quick code search, all the projects use wrap_db_entry, but your suggestions seems to be more clear and concise.","commit_id":"0aeb8a8d8671eb63d081f917cceae527f4dd5ce2"},{"author":{"_account_id":7900,"name":"Tomasz Paszkowski","email":"ss7pro@gmail.com","username":"tpaszkowski"},"change_message_id":"a46d460e5986ce7d76c7729d49cac471f9612ca5","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        return _paginate_query(models.Node, limit, marker,"},{"line_number":250,"context_line":"                               sort_key, sort_dir, query)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003d5, retry_on_deadlock\u003dTrue)"},{"line_number":253,"context_line":"    def reserve_node(self, tag, node_id):"},{"line_number":254,"context_line":"        with _session_for_write():"},{"line_number":255,"context_line":"            query \u003d _get_node_query_with_tags()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a74a57a_711e8a64","line":252,"range":{"start_line":252,"start_character":30,"end_line":252,"end_character":44},"in_reply_to":"9a629dbe_80c02a2c","updated":"2016-11-24 11:28:10.000000000","message":"We should also enable retry_on_disconnect and this should be applied to all changed methods.","commit_id":"0aeb8a8d8671eb63d081f917cceae527f4dd5ce2"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"a99f7b838ef1cf726be4778c7423d58be314d9b7","unresolved":false,"context_lines":[{"line_number":259,"context_line":"        return _paginate_query(models.Node, limit, marker,"},{"line_number":260,"context_line":"                               sort_key, sort_dir, query)"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":263,"context_line":"    def reserve_node(self, tag, node_id):"},{"line_number":264,"context_line":"        with _session_for_write():"},{"line_number":265,"context_line":"            query \u003d _get_node_query_with_tags()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_e8a457a7","line":262,"updated":"2017-01-27 07:27:25.000000000","message":"We have high-level retrying here, looks like this is not needed.","commit_id":"d88dcc3a2df0e94da1a0cc7e1b0fa0063e1003a7"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"8411208666a5b2465f48a55f3effe6c5707f58f8","unresolved":false,"context_lines":[{"line_number":259,"context_line":"        return _paginate_query(models.Node, limit, marker,"},{"line_number":260,"context_line":"                               sort_key, sort_dir, query)"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":263,"context_line":"    def reserve_node(self, tag, node_id):"},{"line_number":264,"context_line":"        with _session_for_write():"},{"line_number":265,"context_line":"            query \u003d _get_node_query_with_tags()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_1122aab9","line":262,"in_reply_to":"3a461143_e8a457a7","updated":"2017-01-27 09:25:50.000000000","message":"Ok, because we do retry only on one exception type.","commit_id":"d88dcc3a2df0e94da1a0cc7e1b0fa0063e1003a7"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"a99f7b838ef1cf726be4778c7423d58be314d9b7","unresolved":false,"context_lines":[{"line_number":428,"context_line":"                raise"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":431,"context_line":"    def _do_update_node(self, node_id, values):"},{"line_number":432,"context_line":"        with _session_for_write():"},{"line_number":433,"context_line":"            query \u003d model_query(models.Node)"},{"line_number":434,"context_line":"            query \u003d add_identity_filter(query, node_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_6bd14157","line":431,"updated":"2017-01-27 07:27:25.000000000","message":"I think all updates and destroy for node, port, portgroup should be also reconnect-safe because they are executed under our exclusive lock and task works in monopoly mode.","commit_id":"d88dcc3a2df0e94da1a0cc7e1b0fa0063e1003a7"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"49e3509e1217794b93a439fc572c44a78a2564fe","unresolved":false,"context_lines":[{"line_number":428,"context_line":"                raise"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":431,"context_line":"    def _do_update_node(self, node_id, values):"},{"line_number":432,"context_line":"        with _session_for_write():"},{"line_number":433,"context_line":"            query \u003d model_query(models.Node)"},{"line_number":434,"context_line":"            query \u003d add_identity_filter(query, node_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_1d7998c8","line":431,"in_reply_to":"3a461143_6bd14157","updated":"2017-01-30 14:41:20.000000000","message":"Ok, I added this also for chassis, volume_connector and volume_target.","commit_id":"d88dcc3a2df0e94da1a0cc7e1b0fa0063e1003a7"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"a99f7b838ef1cf726be4778c7423d58be314d9b7","unresolved":false,"context_lines":[{"line_number":847,"context_line":"                 .filter_by(conductor_id\u003dconductor_id))"},{"line_number":848,"context_line":"        return query.all()"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"    def register_conductor_hardware_interfaces(self, conductor_id,"},{"line_number":851,"context_line":"                                               hardware_type, interface_type,"},{"line_number":852,"context_line":"                                               interfaces, default_interface):"},{"line_number":853,"context_line":"        with _session_for_write() as session:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_68d4e71f","line":850,"updated":"2017-01-27 07:27:25.000000000","message":"Looks like we should also retry here.","commit_id":"d88dcc3a2df0e94da1a0cc7e1b0fa0063e1003a7"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"49e3509e1217794b93a439fc572c44a78a2564fe","unresolved":false,"context_lines":[{"line_number":847,"context_line":"                 .filter_by(conductor_id\u003dconductor_id))"},{"line_number":848,"context_line":"        return query.all()"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"    def register_conductor_hardware_interfaces(self, conductor_id,"},{"line_number":851,"context_line":"                                               hardware_type, interface_type,"},{"line_number":852,"context_line":"                                               interfaces, default_interface):"},{"line_number":853,"context_line":"        with _session_for_write() as session:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_3d6c9434","line":850,"in_reply_to":"3a461143_68d4e71f","updated":"2017-01-30 14:41:20.000000000","message":"Done","commit_id":"d88dcc3a2df0e94da1a0cc7e1b0fa0063e1003a7"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"a99f7b838ef1cf726be4778c7423d58be314d9b7","unresolved":false,"context_lines":[{"line_number":868,"context_line":"                    interface_type\u003dinterface_type,"},{"line_number":869,"context_line":"                    interfaces\u003dinterfaces)"},{"line_number":870,"context_line":""},{"line_number":871,"context_line":"    def unregister_conductor_hardware_interfaces(self, conductor_id):"},{"line_number":872,"context_line":"        with _session_for_write():"},{"line_number":873,"context_line":"            query \u003d (model_query(models.ConductorHardwareInterfaces)"},{"line_number":874,"context_line":"                     .filter_by(conductor_id\u003dconductor_id))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_48c56b59","line":871,"updated":"2017-01-27 07:27:25.000000000","message":"Ditto, also maybe for *volume* methods already.","commit_id":"d88dcc3a2df0e94da1a0cc7e1b0fa0063e1003a7"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"49e3509e1217794b93a439fc572c44a78a2564fe","unresolved":false,"context_lines":[{"line_number":868,"context_line":"                    interface_type\u003dinterface_type,"},{"line_number":869,"context_line":"                    interfaces\u003dinterfaces)"},{"line_number":870,"context_line":""},{"line_number":871,"context_line":"    def unregister_conductor_hardware_interfaces(self, conductor_id):"},{"line_number":872,"context_line":"        with _session_for_write():"},{"line_number":873,"context_line":"            query \u003d (model_query(models.ConductorHardwareInterfaces)"},{"line_number":874,"context_line":"                     .filter_by(conductor_id\u003dconductor_id))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_1d6fd82b","line":871,"in_reply_to":"3a461143_48c56b59","updated":"2017-01-30 14:41:20.000000000","message":"Done","commit_id":"d88dcc3a2df0e94da1a0cc7e1b0fa0063e1003a7"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"a99f7b838ef1cf726be4778c7423d58be314d9b7","unresolved":false,"context_lines":[{"line_number":874,"context_line":"                     .filter_by(conductor_id\u003dconductor_id))"},{"line_number":875,"context_line":"            query.delete()"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":878,"context_line":"    def touch_node_provisioning(self, node_id):"},{"line_number":879,"context_line":"        with _session_for_write():"},{"line_number":880,"context_line":"            query \u003d model_query(models.Node)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_c85ebb75","line":877,"updated":"2017-01-27 07:27:25.000000000","message":"\u0027provision_updated_at\u0027 can be set to something later value as result of retrying, but ok for our use cases.","commit_id":"d88dcc3a2df0e94da1a0cc7e1b0fa0063e1003a7"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"4fd22f0d163f09240db5977079aa3003d477642f","unresolved":false,"context_lines":[{"line_number":636,"context_line":"                    raise"},{"line_number":637,"context_line":"            return ref"},{"line_number":638,"context_line":""},{"line_number":639,"context_line":"    @oslo_db_api.safe_for_db_retry"},{"line_number":640,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":641,"context_line":"    def destroy_portgroup(self, portgroup_id):"},{"line_number":642,"context_line":"        def portgroup_not_empty(session):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_558c97d9","line":639,"updated":"2017-01-31 22:22:00.000000000","message":"Sorry for confusing, but looks like all destroy operation are not safe for DB reconnect, even under an exclusive lock. The problem: there is a small probability than we obtain connection error from our client, but data changed in the DB. Destroy operations are not idempotent, but updates under lock are. There is also small problem with \"instance_uuid\" association in update node, I think this check should be moved from DB api layer in the future.","commit_id":"900fba83677ce1188fab13bead1557101352456c"},{"author":{"_account_id":10342,"name":"Jay Faulkner","display_name":"JayF","email":"jay@jvf.cc","username":"JayF","status":"youtube.com/@oss-gr / podcast.gr-oss.io"},"change_message_id":"d54931c5f5fd9d0e2777b173cca87e92aa5ea62a","unresolved":false,"context_lines":[{"line_number":692,"context_line":"                raise exception.ChassisAlreadyExists(uuid\u003dvalues[\u0027uuid\u0027])"},{"line_number":693,"context_line":"            return chassis"},{"line_number":694,"context_line":""},{"line_number":695,"context_line":"    @oslo_db_api.safe_for_db_retry"},{"line_number":696,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":697,"context_line":"    def update_chassis(self, chassis_id, values):"},{"line_number":698,"context_line":"        # NOTE(dtantsur): this can lead to very strange errors"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_88c9b65b","line":695,"updated":"2017-01-30 22:36:11.000000000","message":"I\u0027m not sure I grok why these are labelled safe_for_db_retry but not the others?","commit_id":"900fba83677ce1188fab13bead1557101352456c"},{"author":{"_account_id":23883,"name":"Joanna Taryma","email":"joanna.taryma@intel.com","username":"jtaryma"},"change_message_id":"7d765c6d604728116c5e4d6ec0b5f8a899f2f31b","unresolved":false,"context_lines":[{"line_number":692,"context_line":"                raise exception.ChassisAlreadyExists(uuid\u003dvalues[\u0027uuid\u0027])"},{"line_number":693,"context_line":"            return chassis"},{"line_number":694,"context_line":""},{"line_number":695,"context_line":"    @oslo_db_api.safe_for_db_retry"},{"line_number":696,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":697,"context_line":"    def update_chassis(self, chassis_id, values):"},{"line_number":698,"context_line":"        # NOTE(dtantsur): this can lead to very strange errors"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_c349dfb8","line":695,"in_reply_to":"3a461143_88c9b65b","updated":"2017-01-30 23:28:40.000000000","message":"I believe this is because of the operation type;\nPerforming update with exactly same values shouldn\u0027t break anything and the result should be the same. \n\nI have some doubts on safe retry for delete - it seems like it could result in not found error.\n\nCreate retry can result in duplicate error, so it\u0027s not safe for retry.\n\nGrzegorz, please correct me if I\u0027m wrong :)","commit_id":"900fba83677ce1188fab13bead1557101352456c"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"be9b4b3ffa0fa9943d25b0ddc4236d7c7d26e53c","unresolved":false,"context_lines":[{"line_number":710,"context_line":"            ref \u003d query.one()"},{"line_number":711,"context_line":"        return ref"},{"line_number":712,"context_line":""},{"line_number":713,"context_line":"    @oslo_db_api.safe_for_db_retry"},{"line_number":714,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":715,"context_line":"    def destroy_chassis(self, chassis_id):"},{"line_number":716,"context_line":"        def chassis_not_empty():"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_14c4fc3d","line":713,"updated":"2017-01-31 00:53:09.000000000","message":"destroy_chassis() is not safe_for_db_retry because exclusive conductor lock not used for this operation","commit_id":"900fba83677ce1188fab13bead1557101352456c"},{"author":{"_account_id":23883,"name":"Joanna Taryma","email":"joanna.taryma@intel.com","username":"jtaryma"},"change_message_id":"7d765c6d604728116c5e4d6ec0b5f8a899f2f31b","unresolved":false,"context_lines":[{"line_number":781,"context_line":"                                  \u0027online\u0027: True})"},{"line_number":782,"context_line":"            if count \u003d\u003d 0:"},{"line_number":783,"context_line":"                raise exception.ConductorNotFound(conductor\u003dhostname)"},{"line_number":784,"context_line":""},{"line_number":785,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":786,"context_line":"    def clear_node_reservations_for_conductor(self, hostname):"},{"line_number":787,"context_line":"        nodes \u003d []"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_43d40fbc","line":784,"updated":"2017-01-30 23:28:40.000000000","message":"seems safe for retry","commit_id":"900fba83677ce1188fab13bead1557101352456c"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"be9b4b3ffa0fa9943d25b0ddc4236d7c7d26e53c","unresolved":false,"context_lines":[{"line_number":781,"context_line":"                                  \u0027online\u0027: True})"},{"line_number":782,"context_line":"            if count \u003d\u003d 0:"},{"line_number":783,"context_line":"                raise exception.ConductorNotFound(conductor\u003dhostname)"},{"line_number":784,"context_line":""},{"line_number":785,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":786,"context_line":"    def clear_node_reservations_for_conductor(self, hostname):"},{"line_number":787,"context_line":"        nodes \u003d []"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_d42994e7","line":784,"in_reply_to":"3a461143_43d40fbc","updated":"2017-01-31 00:53:09.000000000","message":"This operation executed in init_host() when conductor is started. I\u0027m not sure that we should do retry on disconnect on start.","commit_id":"900fba83677ce1188fab13bead1557101352456c"},{"author":{"_account_id":23883,"name":"Joanna Taryma","email":"joanna.taryma@intel.com","username":"jtaryma"},"change_message_id":"7d765c6d604728116c5e4d6ec0b5f8a899f2f31b","unresolved":false,"context_lines":[{"line_number":797,"context_line":"                _LW(\u0027Cleared reservations held by %(hostname)s: \u0027"},{"line_number":798,"context_line":"                    \u0027%(nodes)s\u0027), {\u0027hostname\u0027: hostname, \u0027nodes\u0027: nodes})"},{"line_number":799,"context_line":""},{"line_number":800,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":801,"context_line":"    def clear_node_target_power_state(self, hostname):"},{"line_number":802,"context_line":"        nodes \u003d []"},{"line_number":803,"context_line":"        with _session_for_write():"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_63dd8bdf","line":800,"updated":"2017-01-30 23:28:40.000000000","message":"seems safe for retry","commit_id":"900fba83677ce1188fab13bead1557101352456c"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"be9b4b3ffa0fa9943d25b0ddc4236d7c7d26e53c","unresolved":false,"context_lines":[{"line_number":797,"context_line":"                _LW(\u0027Cleared reservations held by %(hostname)s: \u0027"},{"line_number":798,"context_line":"                    \u0027%(nodes)s\u0027), {\u0027hostname\u0027: hostname, \u0027nodes\u0027: nodes})"},{"line_number":799,"context_line":""},{"line_number":800,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":801,"context_line":"    def clear_node_target_power_state(self, hostname):"},{"line_number":802,"context_line":"        nodes \u003d []"},{"line_number":803,"context_line":"        with _session_for_write():"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_f424d00d","line":800,"in_reply_to":"3a461143_63dd8bdf","updated":"2017-01-31 00:53:09.000000000","message":"ditto","commit_id":"900fba83677ce1188fab13bead1557101352456c"},{"author":{"_account_id":23883,"name":"Joanna Taryma","email":"joanna.taryma@intel.com","username":"jtaryma"},"change_message_id":"7d765c6d604728116c5e4d6ec0b5f8a899f2f31b","unresolved":false,"context_lines":[{"line_number":877,"context_line":"                    interface_type\u003dinterface_type,"},{"line_number":878,"context_line":"                    interfaces\u003dinterfaces)"},{"line_number":879,"context_line":""},{"line_number":880,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":881,"context_line":"    def unregister_conductor_hardware_interfaces(self, conductor_id):"},{"line_number":882,"context_line":"        with _session_for_write():"},{"line_number":883,"context_line":"            query \u003d (model_query(models.ConductorHardwareInterfaces)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_a3e3f3a2","line":880,"updated":"2017-01-30 23:28:40.000000000","message":"seems safe for retry","commit_id":"900fba83677ce1188fab13bead1557101352456c"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"04bc9e0604c3b6333ba27e6eba5c2ae6375e015c","unresolved":false,"context_lines":[{"line_number":259,"context_line":"        return _paginate_query(models.Node, limit, marker,"},{"line_number":260,"context_line":"                               sort_key, sort_dir, query)"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":263,"context_line":"    def reserve_node(self, tag, node_id):"},{"line_number":264,"context_line":"        with _session_for_write():"},{"line_number":265,"context_line":"            query \u003d _get_node_query_with_tags()"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_3a11c15d","line":262,"updated":"2017-02-08 22:38:33.000000000","message":"i know there are comments in this patch about when/where to use this. and you have that test. Was thinking it might be worth documenting, eg at top of this page, where we apply it and why. Cuz I\u0027m sure people are going to wonder. (And yeah, I don\u0027t know if folks read the comments in these files but it seems better to put it here than in our dev docs). Just a thought.","commit_id":"794a647e1514418eb6de82801813147ea09cf1b3"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"41903111e85cbacf9ae206be7c103dc4f6470933","unresolved":false,"context_lines":[{"line_number":259,"context_line":"        return _paginate_query(models.Node, limit, marker,"},{"line_number":260,"context_line":"                               sort_key, sort_dir, query)"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"    @oslo_db_api.retry_on_deadlock"},{"line_number":263,"context_line":"    def reserve_node(self, tag, node_id):"},{"line_number":264,"context_line":"        with _session_for_write():"},{"line_number":265,"context_line":"            query \u003d _get_node_query_with_tags()"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_4175abc8","line":262,"in_reply_to":"1a430d35_3a11c15d","updated":"2017-02-09 13:43:53.000000000","message":"Done","commit_id":"794a647e1514418eb6de82801813147ea09cf1b3"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bd2661711900e629da82d270ed68549c737171db","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"# Please add @oslo_db_api.retry_on_deadlock decorator to all methods using"},{"line_number":60,"context_line":"# _session_for_write, so that oslo_db is able to retry in case of deadlocks."},{"line_number":61,"context_line":"def _session_for_write():"},{"line_number":62,"context_line":"    return enginefacade.writer.using(_CONTEXT)"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a430d35_8eb89bea","line":60,"updated":"2017-02-09 14:45:39.000000000","message":"why only for the methods using _session_for_write?","commit_id":"a004c03d93b4e80d41d44c2e0a733614a8a79307"}],"ironic/tests/unit/db/sqlalchemy/test_api.py":[{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"72494e3da07395415ebf106c3be551b2ffd1e94a","unresolved":false,"context_lines":[{"line_number":26,"context_line":"                # retry_on_deadlock decorator adds enable_retry_on_deadlock"},{"line_number":27,"context_line":"                # attribute to the method\u0027s __dict__"},{"line_number":28,"context_line":"                self.assertTrue("},{"line_number":29,"context_line":"                    getattr(method, \u0027enable_retry_on_deadlock\u0027, None),"},{"line_number":30,"context_line":"                    \u0027oslo_db\\\u0027s retry_on_deadlock decorator not \u0027"},{"line_number":31,"context_line":"                    \u0027applied to method %s in doing database write\u0027 % method)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_a8f2e703","line":29,"updated":"2017-02-08 13:08:05.000000000","message":"Looks like this is oslo db internal thing. Better to collect decorated methods like in test_expose.py (in api tests).","commit_id":"976d948d95d697e7db8494ddcf28487e79837a7a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"2b30bf78d4b19238d499c7a09e6b405f287689e0","unresolved":false,"context_lines":[{"line_number":26,"context_line":"                # retry_on_deadlock decorator adds enable_retry_on_deadlock"},{"line_number":27,"context_line":"                # attribute to the method\u0027s __dict__"},{"line_number":28,"context_line":"                self.assertTrue("},{"line_number":29,"context_line":"                    getattr(method, \u0027enable_retry_on_deadlock\u0027, None),"},{"line_number":30,"context_line":"                    \u0027oslo_db\\\u0027s retry_on_deadlock decorator not \u0027"},{"line_number":31,"context_line":"                    \u0027applied to method %s in doing database write\u0027 % method)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_f528439c","line":29,"in_reply_to":"1a430d35_a8f2e703","updated":"2017-02-08 14:25:14.000000000","message":"Done","commit_id":"976d948d95d697e7db8494ddcf28487e79837a7a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"04bc9e0604c3b6333ba27e6eba5c2ae6375e015c","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class TestDBWriteMethodsRetryOnDeadlock(test_base.TestCase):"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def test_retry_on_deadlock(self):"},{"line_number":27,"context_line":"        original_method \u003d sys.modules[\u0027oslo_db.api\u0027].retry_on_deadlock"},{"line_number":28,"context_line":"        retrying_methods \u003d set()"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_fa4c999f","line":26,"updated":"2017-02-08 22:38:33.000000000","message":"i think it would be good to have a comment on what this is testing. i thought you were testing the functionality, not the presence of the decorator if \u0027with _session_for_write()\u0027 is invoked.","commit_id":"794a647e1514418eb6de82801813147ea09cf1b3"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"41903111e85cbacf9ae206be7c103dc4f6470933","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class TestDBWriteMethodsRetryOnDeadlock(test_base.TestCase):"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def test_retry_on_deadlock(self):"},{"line_number":27,"context_line":"        original_method \u003d sys.modules[\u0027oslo_db.api\u0027].retry_on_deadlock"},{"line_number":28,"context_line":"        retrying_methods \u003d set()"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_e110575b","line":26,"in_reply_to":"1a430d35_fa4c999f","updated":"2017-02-09 13:43:53.000000000","message":"Yeah, it tests that the decorator is present, as adding the test for all the methods is kind of a daunting task :) There was one \"real\" unittest ensuring that retry happens, everywhere else it\u0027s just testing the decorator presence.","commit_id":"794a647e1514418eb6de82801813147ea09cf1b3"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"04bc9e0604c3b6333ba27e6eba5c2ae6375e015c","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            return wrap"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        module_path \u003d os.path.abspath("},{"line_number":40,"context_line":"            sys.modules[\u0027ironic.db.sqlalchemy.api\u0027].__file__)"},{"line_number":41,"context_line":"        # NOTE(vdrok): coverage runs on compiled .pyc files, which breaks"},{"line_number":42,"context_line":"        # load_source. Strip c and o letters from the end of the module path,"},{"line_number":43,"context_line":"        # just in case someone tries to use .pyo or .pyc for whatever reason"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_3af2a106","line":40,"updated":"2017-02-08 22:38:33.000000000","message":"why not just .rstrip(\u0027co\u0027) here? (not a big deal since there isn\u0027t a performance issue)","commit_id":"794a647e1514418eb6de82801813147ea09cf1b3"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"41903111e85cbacf9ae206be7c103dc4f6470933","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            return wrap"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        module_path \u003d os.path.abspath("},{"line_number":40,"context_line":"            sys.modules[\u0027ironic.db.sqlalchemy.api\u0027].__file__)"},{"line_number":41,"context_line":"        # NOTE(vdrok): coverage runs on compiled .pyc files, which breaks"},{"line_number":42,"context_line":"        # load_source. Strip c and o letters from the end of the module path,"},{"line_number":43,"context_line":"        # just in case someone tries to use .pyo or .pyc for whatever reason"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_410a0b27","line":40,"in_reply_to":"1a430d35_3af2a106","updated":"2017-02-09 13:43:53.000000000","message":"Done","commit_id":"794a647e1514418eb6de82801813147ea09cf1b3"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"04bc9e0604c3b6333ba27e6eba5c2ae6375e015c","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        for name, method in inspect.getmembers(m.Connection,"},{"line_number":49,"context_line":"                                               predicate\u003dinspect.ismethod):"},{"line_number":50,"context_line":"            src \u003d inspect.getsource(method)"},{"line_number":51,"context_line":"            if \u0027with _session_for_write()\u0027 in src:"},{"line_number":52,"context_line":"                self.assertTrue("},{"line_number":53,"context_line":"                    method in retrying_methods,"},{"line_number":54,"context_line":"                    \u0027oslo_db\\\u0027s retry_on_deadlock decorator not \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_bafbf145","line":51,"updated":"2017-02-08 22:38:33.000000000","message":"I don\u0027t think this works. I mean, this string won\u0027t be in src. (Unless I am wrong). i don\u0027t think anything gets assert\u0027d.\n\nOtherwise, this is a cool test :)","commit_id":"794a647e1514418eb6de82801813147ea09cf1b3"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"64873db3c45b258b9ad84ababc0c0a1521adb5b0","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        for name, method in inspect.getmembers(m.Connection,"},{"line_number":49,"context_line":"                                               predicate\u003dinspect.ismethod):"},{"line_number":50,"context_line":"            src \u003d inspect.getsource(method)"},{"line_number":51,"context_line":"            if \u0027with _session_for_write()\u0027 in src:"},{"line_number":52,"context_line":"                self.assertTrue("},{"line_number":53,"context_line":"                    method in retrying_methods,"},{"line_number":54,"context_line":"                    \u0027oslo_db\\\u0027s retry_on_deadlock decorator not \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_4e1cf36a","line":51,"in_reply_to":"1a430d35_1c3dc6c3","updated":"2017-02-09 14:45:52.000000000","message":"It didn\u0027t work locally for me. this \u0027if\u0027 was never true so the code below never got executed.\n\nI agree with you though; if you remove the decorator, your mock.patch at L44 will have no effect, and this if will be True. Since there will be nothing in retrying_methods, the assert will Fail.","commit_id":"794a647e1514418eb6de82801813147ea09cf1b3"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"41903111e85cbacf9ae206be7c103dc4f6470933","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        for name, method in inspect.getmembers(m.Connection,"},{"line_number":49,"context_line":"                                               predicate\u003dinspect.ismethod):"},{"line_number":50,"context_line":"            src \u003d inspect.getsource(method)"},{"line_number":51,"context_line":"            if \u0027with _session_for_write()\u0027 in src:"},{"line_number":52,"context_line":"                self.assertTrue("},{"line_number":53,"context_line":"                    method in retrying_methods,"},{"line_number":54,"context_line":"                    \u0027oslo_db\\\u0027s retry_on_deadlock decorator not \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a430d35_1c3dc6c3","line":51,"in_reply_to":"1a430d35_bafbf145","updated":"2017-02-09 13:43:53.000000000","message":"Why do you think so? I mean, locally, this test works perfectly fine... You can try removing the decorator from any of the methods having this substring and this test will fail properly.","commit_id":"794a647e1514418eb6de82801813147ea09cf1b3"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bd2661711900e629da82d270ed68549c737171db","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class TestDBWriteMethodsRetryOnDeadlock(test_base.TestCase):"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def test_retry_on_deadlock(self):"},{"line_number":27,"context_line":"        original_method \u003d sys.modules[\u0027oslo_db.api\u0027].retry_on_deadlock"},{"line_number":28,"context_line":"        retrying_methods \u003d set()"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a430d35_ae61d7aa","line":26,"updated":"2017-02-09 14:45:39.000000000","message":"please add a comment indicating what this is testing.","commit_id":"a004c03d93b4e80d41d44c2e0a733614a8a79307"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bd2661711900e629da82d270ed68549c737171db","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        # NOTE(vdrok): coverage runs on compiled .pyc files, which breaks"},{"line_number":42,"context_line":"        # load_source. Strip c and o letters from the end of the module path,"},{"line_number":43,"context_line":"        # just in case someone tries to use .pyo or .pyc for whatever reason"},{"line_number":44,"context_line":"        with mock.patch(\u0027oslo_db.api.retry_on_deadlock\u0027, track):"},{"line_number":45,"context_line":"            m \u003d imp.load_source(uuidutils.generate_uuid(), module_path)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        for name, method in inspect.getmembers(m.Connection,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a430d35_6ee36f34","line":44,"updated":"2017-02-09 14:45:39.000000000","message":"Maybe you should document what this mock.patch is doing.","commit_id":"a004c03d93b4e80d41d44c2e0a733614a8a79307"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bd2661711900e629da82d270ed68549c737171db","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        # just in case someone tries to use .pyo or .pyc for whatever reason"},{"line_number":44,"context_line":"        with mock.patch(\u0027oslo_db.api.retry_on_deadlock\u0027, track):"},{"line_number":45,"context_line":"            m \u003d imp.load_source(uuidutils.generate_uuid(), module_path)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        for name, method in inspect.getmembers(m.Connection,"},{"line_number":48,"context_line":"                                               predicate\u003dinspect.ismethod):"},{"line_number":49,"context_line":"            src \u003d inspect.getsource(method)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a430d35_8ed17b32","line":46,"updated":"2017-02-09 14:45:39.000000000","message":"fwiw, trying this locally, retrying_methods has nothing in it (an empty set).","commit_id":"a004c03d93b4e80d41d44c2e0a733614a8a79307"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bd2661711900e629da82d270ed68549c737171db","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        for name, method in inspect.getmembers(m.Connection,"},{"line_number":48,"context_line":"                                               predicate\u003dinspect.ismethod):"},{"line_number":49,"context_line":"            src \u003d inspect.getsource(method)"},{"line_number":50,"context_line":"            if \u0027with _session_for_write()\u0027 in src:"},{"line_number":51,"context_line":"                self.assertIn("},{"line_number":52,"context_line":"                    method, retrying_methods,"},{"line_number":53,"context_line":"                    \u0027oslo_db\\\u0027s retry_on_deadlock decorator not \u0027"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a430d35_ce0d43ea","line":50,"updated":"2017-02-09 14:45:39.000000000","message":"i think if you didn\u0027t do the mock at L44 and just changed this to check for both the above and the presence of \u0027oslo_db.api.retry_on_deadlock\u0027 in src, it would work...","commit_id":"a004c03d93b4e80d41d44c2e0a733614a8a79307"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"11404a444212e959693e44ee17827ad9c5e67500","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class TestDBWriteMethodsRetryOnDeadlock(test_base.TestCase):"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"    def test_retry_on_deadlock(self):"},{"line_number":22,"context_line":"        # This test ensures that every dbapi method doing database write is"},{"line_number":23,"context_line":"        # wrapped with retry_on_deadlock decorator"},{"line_number":24,"context_line":"        for name, method in inspect.getmembers(sqlalchemy_api.Connection,"}],"source_content_type":"text/x-python","patch_set":15,"id":"da36d5c6_91026eb3","line":21,"updated":"2017-02-27 22:20:27.000000000","message":"Cool :)","commit_id":"3428cb74f0a6fe05c23cf00dc66da4c1d9766409"}],"ironic/tests/unit/db/test_conductor.py":[{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"8aa1ced47a75efbed6a7f4dbe52cb04f314f0160","unresolved":false,"context_lines":[{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    @mock.patch.object(sqlalchemy.orm.Query, \u0027update\u0027, autospec\u003dTrue)"},{"line_number":83,"context_line":"    def test_touch_conductor_deadlock(self, mock_update):"},{"line_number":84,"context_line":"        def raise_first(*args, **kwargs):"},{"line_number":85,"context_line":"            if mock_update.call_count \u003d\u003d 1:"},{"line_number":86,"context_line":"                raise db_exc.DBDeadlock()"},{"line_number":87,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a629dbe_eec49493","line":84,"updated":"2016-11-08 10:08:47.000000000","message":"You can use\n\n mock_update.side_effect \u003d [db_exc.DBDeadlock(), None]","commit_id":"0aeb8a8d8671eb63d081f917cceae527f4dd5ce2"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"5af63cd27ce049f8d10ada60ebb096fa42daea1b","unresolved":false,"context_lines":[{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    @mock.patch.object(sqlalchemy.orm.Query, \u0027update\u0027, autospec\u003dTrue)"},{"line_number":83,"context_line":"    def test_touch_conductor_deadlock(self, mock_update):"},{"line_number":84,"context_line":"        def raise_first(*args, **kwargs):"},{"line_number":85,"context_line":"            if mock_update.call_count \u003d\u003d 1:"},{"line_number":86,"context_line":"                raise db_exc.DBDeadlock()"},{"line_number":87,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_be20fb9c","line":84,"in_reply_to":"9a629dbe_eec49493","updated":"2017-01-02 14:08:34.000000000","message":"Done","commit_id":"0aeb8a8d8671eb63d081f917cceae527f4dd5ce2"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"cceebc11cd43a9c4924358dc823cb2d18327dc83","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        c \u003d self.dbapi.get_conductor(c.hostname)"},{"line_number":132,"context_line":"        self.assertEqual(test_time, timeutils.normalize_time(c.updated_at))"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    @mock.patch.object(sqlalchemy.orm.Query, \u0027update\u0027, autospec\u003dTrue)"},{"line_number":135,"context_line":"    def test_touch_conductor_deadlock(self, mock_update):"},{"line_number":136,"context_line":"        mock_update.side_effect \u003d [db_exc.DBDeadlock(), None]"},{"line_number":137,"context_line":"        c \u003d self._create_test_cdr()"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a430d35_fdde7c0f","line":134,"updated":"2017-02-08 09:16:03.000000000","message":"This needs a unittest that will check if method calls _session_for_write() and fail if it is not wrapped by @oslo_db_api.retry_on_deadlock\nwithout this check bug may be easily reintroduced when new method that write/update DB is added without decorators.","commit_id":"6444c11894d5978b31dd54bb198545120f1ef138"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"3965e75111d24cae3fdd472eecfe69886f655bc9","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        c \u003d self.dbapi.get_conductor(c.hostname)"},{"line_number":132,"context_line":"        self.assertEqual(test_time, timeutils.normalize_time(c.updated_at))"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    @mock.patch.object(sqlalchemy.orm.Query, \u0027update\u0027, autospec\u003dTrue)"},{"line_number":135,"context_line":"    def test_touch_conductor_deadlock(self, mock_update):"},{"line_number":136,"context_line":"        mock_update.side_effect \u003d [db_exc.DBDeadlock(), None]"},{"line_number":137,"context_line":"        c \u003d self._create_test_cdr()"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a430d35_49aef298","line":134,"in_reply_to":"1a430d35_fdde7c0f","updated":"2017-02-08 10:25:08.000000000","message":"Will try to come up with some test.","commit_id":"6444c11894d5978b31dd54bb198545120f1ef138"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8216f179d918f5e9497be2cac48421a96c6e5803","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        c \u003d self._create_test_cdr()"},{"line_number":138,"context_line":"        self.dbapi.touch_conductor(c.hostname)"},{"line_number":139,"context_line":"        self.assertEqual(2, mock_update.call_count)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def test_touch_conductor_not_found(self):"},{"line_number":142,"context_line":"        # A conductor\u0027s heartbeat will not create a new record,"},{"line_number":143,"context_line":"        # it will only update existing ones"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba2be162_9de8cf18","line":140,"updated":"2017-02-28 15:33:30.000000000","message":"There\u0027s no test to show what happens when db_max_retries has been exceeded. Do we assume that it works cuz it is in oslo and it is tested there? (I\u0027m assuming the answer here is yes.)","commit_id":"3428cb74f0a6fe05c23cf00dc66da4c1d9766409"}],"releasenotes/notes/add-db-deadlock-handling-6bc10076537f3727.yaml":[{"author":{"_account_id":10453,"name":"octopuszhang","email":"zhangyf@rc.inesa.com","username":"1"},"change_message_id":"6a2676f339a5afad5776d08c57e262ee2e7ed1a3","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - Fixes an issue which caused conductor\u0027s periodic tasks to stop executing."},{"line_number":4,"context_line":"    See https://bugs.launchpad.net/ironic/+bug/1637210"},{"line_number":5,"context_line":"    "},{"line_number":6,"context_line":"other:"},{"line_number":7,"context_line":"  - Adds DBDeadlock handling which may improve stability when using Galera."}],"source_content_type":"text/x-yaml","patch_set":2,"id":"ba5201f7_53faa043","line":4,"range":{"start_line":4,"start_character":0,"end_line":4,"end_character":4},"updated":"2017-01-03 02:18:05.000000000","message":"nit in L5","commit_id":"dfe148e314203e6bb37ed66bd3d7280d5442f495"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"abae406de5b7bed71f810569af450de14dd0d152","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - Fixes an issue which caused conductor\u0027s periodic tasks to stop executing."},{"line_number":4,"context_line":"    See https://bugs.launchpad.net/ironic/+bug/1637210"},{"line_number":5,"context_line":"    "},{"line_number":6,"context_line":"other:"},{"line_number":7,"context_line":"  - Adds DBDeadlock handling which may improve stability when using Galera."}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3a461143_10ee5d8b","line":4,"range":{"start_line":4,"start_character":0,"end_line":4,"end_character":4},"in_reply_to":"ba5201f7_53faa043","updated":"2017-01-26 08:21:39.000000000","message":"Done","commit_id":"dfe148e314203e6bb37ed66bd3d7280d5442f495"},{"author":{"_account_id":23883,"name":"Joanna Taryma","email":"joanna.taryma@intel.com","username":"jtaryma"},"change_message_id":"7d765c6d604728116c5e4d6ec0b5f8a899f2f31b","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - Fixes an issue which caused conductor\u0027s periodic tasks to stop executing."},{"line_number":4,"context_line":"    See https://bugs.launchpad.net/ironic/+bug/1637210"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"other:"},{"line_number":7,"context_line":"  - Adds DBDeadlock handling which may improve stability when using Galera."},{"line_number":8,"context_line":"    See https://bugs.launchpad.net/ironic/+bug/1639338"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"3a461143_e3efbb84","line":6,"updated":"2017-01-30 23:28:40.000000000","message":"shouldn\u0027t it fall under \u0027upgrade\u0027?","commit_id":"900fba83677ce1188fab13bead1557101352456c"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"04bc9e0604c3b6333ba27e6eba5c2ae6375e015c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"1a430d35_9711b054","line":8,"updated":"2017-02-08 22:38:33.000000000","message":"I have a few concerns. The original version had the max retries hard-coded to 5. Now the max retries is based on the db_max_retries config which is set to 20. That seems too high to me. If galera is failing under load, do you really want to increase the load by pinging it 20 times before it stops pinging?\n\nCan we change the default to be 5, and mention that it is configurable in the reno?","commit_id":"794a647e1514418eb6de82801813147ea09cf1b3"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"0b115c26b8a3e4eda101f261e4f04364ac1ce934","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"1a430d35_4d08702e","line":8,"in_reply_to":"1a430d35_9711b054","updated":"2017-02-09 18:11:23.000000000","message":"Done","commit_id":"794a647e1514418eb6de82801813147ea09cf1b3"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bd2661711900e629da82d270ed68549c737171db","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"1a430d35_0ea2eb9a","line":8,"updated":"2017-02-09 14:45:39.000000000","message":"I had some comments in patch set 11 that weren\u0027t addressed?","commit_id":"a004c03d93b4e80d41d44c2e0a733614a8a79307"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"2a406a57c019669c8de19692cf0da703b4f8dc6f","unresolved":false,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - Fixes an issue which caused conductor\u0027s periodic tasks to stop executing."},{"line_number":4,"context_line":"    See https://bugs.launchpad.net/ironic/+bug/1637210"},{"line_number":5,"context_line":"other:"},{"line_number":6,"context_line":"  - Adds DBDeadlock handling which may improve stability when using Galera."},{"line_number":7,"context_line":"    See https://bugs.launchpad.net/ironic/+bug/1639338"},{"line_number":8,"context_line":"upgrade:"}],"source_content_type":"text/x-yaml","patch_set":13,"id":"fa31d9ce_056e41c9","line":5,"updated":"2017-02-10 03:26:16.000000000","message":"i wonder if this is a \u0027feature\u0027 but not sure.","commit_id":"768fdc220d0688cb6d4187b7f10e78165e6cb4b6"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8216f179d918f5e9497be2cac48421a96c6e5803","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - Fixes an issue which caused conductor\u0027s periodic tasks to stop executing."},{"line_number":4,"context_line":"    See https://bugs.launchpad.net/ironic/+bug/1637210"},{"line_number":5,"context_line":"features:"},{"line_number":6,"context_line":"  - Adds DBDeadlock handling which may improve stability when using Galera."},{"line_number":7,"context_line":"    See https://bugs.launchpad.net/ironic/+bug/1639338"}],"source_content_type":"text/x-yaml","patch_set":15,"id":"ba2be162_a262d214","line":4,"updated":"2017-02-28 15:33:30.000000000","message":"nit: missing period at end.","commit_id":"3428cb74f0a6fe05c23cf00dc66da4c1d9766409"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8216f179d918f5e9497be2cac48421a96c6e5803","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    See https://bugs.launchpad.net/ironic/+bug/1637210"},{"line_number":5,"context_line":"features:"},{"line_number":6,"context_line":"  - Adds DBDeadlock handling which may improve stability when using Galera."},{"line_number":7,"context_line":"    See https://bugs.launchpad.net/ironic/+bug/1639338"},{"line_number":8,"context_line":"upgrade:"},{"line_number":9,"context_line":"  - All DB API methods doing database writes now retry on deadlock. The"},{"line_number":10,"context_line":"    ``[database]db_max_retries`` configuration option specifies the maximum"}],"source_content_type":"text/x-yaml","patch_set":15,"id":"ba2be162_c24ee695","line":7,"updated":"2017-02-28 15:33:30.000000000","message":"nit: missing period at end.\n\nAs part of the feature description, we should mention the configuration option since it is new. (I know, it is also mentioned in upgrade but ought to be mentioned here too.)","commit_id":"3428cb74f0a6fe05c23cf00dc66da4c1d9766409"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"11404a444212e959693e44ee17827ad9c5e67500","unresolved":false,"context_lines":[{"line_number":8,"context_line":"upgrade:"},{"line_number":9,"context_line":"  - All DB API methods doing database writes now retry on deadlock. The"},{"line_number":10,"context_line":"    ``[database]db_max_retries`` configuration option specifies the maximum"},{"line_number":11,"context_line":"    number of times to retry, and can be customised if necessary. It is 5 by"},{"line_number":12,"context_line":"    default."}],"source_content_type":"text/x-yaml","patch_set":15,"id":"da36d5c6_b15e9210","line":11,"range":{"start_line":11,"start_character":41,"end_line":11,"end_character":51},"updated":"2017-02-27 22:20:27.000000000","message":"nit:\n\ncustomized\n\nhttps://www.merriam-webster.com/dictionary/customize","commit_id":"3428cb74f0a6fe05c23cf00dc66da4c1d9766409"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"2b626a44c3231b1f8127de1f31432e76f7abd945","unresolved":false,"context_lines":[{"line_number":8,"context_line":"upgrade:"},{"line_number":9,"context_line":"  - All DB API methods doing database writes now retry on deadlock. The"},{"line_number":10,"context_line":"    ``[database]db_max_retries`` configuration option specifies the maximum"},{"line_number":11,"context_line":"    number of times to retry, and can be customised if necessary. It is 5 by"},{"line_number":12,"context_line":"    default."}],"source_content_type":"text/x-yaml","patch_set":15,"id":"ba2be162_5d581757","line":11,"range":{"start_line":11,"start_character":41,"end_line":11,"end_character":51},"in_reply_to":"ba2be162_c2c0a6e3","updated":"2017-02-28 15:46:11.000000000","message":"jroll and dtantsur (and I) don\u0027t care if it is British or American.\n\n[1] http://eavesdrop.openstack.org/irclogs/%23openstack-ironic/%23openstack-ironic.2017-02-28.log.html#t2017-02-28T15:37:48","commit_id":"3428cb74f0a6fe05c23cf00dc66da4c1d9766409"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8216f179d918f5e9497be2cac48421a96c6e5803","unresolved":false,"context_lines":[{"line_number":8,"context_line":"upgrade:"},{"line_number":9,"context_line":"  - All DB API methods doing database writes now retry on deadlock. The"},{"line_number":10,"context_line":"    ``[database]db_max_retries`` configuration option specifies the maximum"},{"line_number":11,"context_line":"    number of times to retry, and can be customised if necessary. It is 5 by"},{"line_number":12,"context_line":"    default."}],"source_content_type":"text/x-yaml","patch_set":15,"id":"ba2be162_c2c0a6e3","line":11,"range":{"start_line":11,"start_character":41,"end_line":11,"end_character":51},"in_reply_to":"da36d5c6_b15e9210","updated":"2017-02-28 15:33:30.000000000","message":"\u0027customise\u0027 is British spelling. Do the release notes have to be American?","commit_id":"3428cb74f0a6fe05c23cf00dc66da4c1d9766409"}]}
