)]}'
{"neutron/db/ipam_non_pluggable_backend.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"0176fb3819ea27558e6671a247de7066c8db0aa2","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    @staticmethod"},{"line_number":48,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":49,"context_line":"                               retry_on_deadlock\u003dTrue)"},{"line_number":50,"context_line":"    def _try_generate_ip(context, subnets):"},{"line_number":51,"context_line":"        \"\"\"Generate an IP address."},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        The IP address will be generated from one of the subnets defined on"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_761daa65","line":50,"updated":"2015-06-14 02:59:56.000000000","message":"this function is called in a transaction.\ni don\u0027t think it make sense to retry inside a transaction.","commit_id":"1b6b8055c7acb9d9ee94fe05b567155f04b92234"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"047ea393ed37a84a90144f77d282349a5ffeda27","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    @staticmethod"},{"line_number":48,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":49,"context_line":"                               retry_on_deadlock\u003dTrue)"},{"line_number":50,"context_line":"    def _try_generate_ip(context, subnets):"},{"line_number":51,"context_line":"        \"\"\"Generate an IP address."},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        The IP address will be generated from one of the subnets defined on"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_9a764c3d","line":50,"in_reply_to":"fa32b979_761daa65","updated":"2015-06-14 21:47:44.000000000","message":"good point. this will trigger internals to cancel the transaction","commit_id":"1b6b8055c7acb9d9ee94fe05b567155f04b92234"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"26fd0fe8524de4f0c469b6baeefc7e2502deca22","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        range_qry \u003d context.session.query("},{"line_number":53,"context_line":"            models_v2.IPAvailabilityRange).join("},{"line_number":54,"context_line":"                models_v2.IPAllocationPool).with_lockmode(\u0027update\u0027)"},{"line_number":55,"context_line":"        # NOTE(kevinbenton): this with_lockmode update can result in deadlocks"},{"line_number":56,"context_line":"        # so the wrap_db_retry decorator was added to ML2\u0027s methods that change"},{"line_number":57,"context_line":"        # the allocations (subnet and port CRUD). If this is replaced with a"},{"line_number":58,"context_line":"        # lockless algorithm, those retries can probably be removed."}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_2fa56a03","line":55,"updated":"2015-06-15 12:17:37.000000000","message":"should it be placed above #52?","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"751b956fd30a492b84f73d0915d5188e818c72b9","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # NOTE(kevinbenton): this with_lockmode update can result in deadlocks"},{"line_number":56,"context_line":"        # so the wrap_db_retry decorator was added to ML2\u0027s methods that change"},{"line_number":57,"context_line":"        # the allocations (subnet and port CRUD). If this is replaced with a"},{"line_number":58,"context_line":"        # lockless algorithm, those retries can probably be removed."},{"line_number":59,"context_line":"        for subnet in subnets:"},{"line_number":60,"context_line":"            ip_range \u003d range_qry.filter_by(subnet_id\u003dsubnet[\u0027id\u0027]).first()"},{"line_number":61,"context_line":"            if not ip_range:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_19ac2dec","line":58,"updated":"2015-06-16 18:02:44.000000000","message":"Lockless algorithms can result in deadlock too (on Galera) if I\u0027m not mistaken.","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"aa8dede9cb755a93a0b711f2d3d51b944a4ad6c7","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # NOTE(kevinbenton): this with_lockmode update can result in deadlocks"},{"line_number":56,"context_line":"        # so the wrap_db_retry decorator was added to ML2\u0027s methods that change"},{"line_number":57,"context_line":"        # the allocations (subnet and port CRUD). If this is replaced with a"},{"line_number":58,"context_line":"        # lockless algorithm, those retries can probably be removed."},{"line_number":59,"context_line":"        for subnet in subnets:"},{"line_number":60,"context_line":"            ip_range \u003d range_qry.filter_by(subnet_id\u003dsubnet[\u0027id\u0027]).first()"},{"line_number":61,"context_line":"            if not ip_range:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_606b20f2","line":58,"in_reply_to":"fa32b979_00b5742f","updated":"2015-06-17 07:39:01.000000000","message":"I know the first is supposed to be related to eventlet. But are you sure that results in a deadlock? I\u0027ve never observed one that doesn\u0027t use with_lockmode resulting in a deadlock in a non-galera setup.","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"fb2e3743405c57db1934447eb22821443c6b1621","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # NOTE(kevinbenton): this with_lockmode update can result in deadlocks"},{"line_number":56,"context_line":"        # so the wrap_db_retry decorator was added to ML2\u0027s methods that change"},{"line_number":57,"context_line":"        # the allocations (subnet and port CRUD). If this is replaced with a"},{"line_number":58,"context_line":"        # lockless algorithm, those retries can probably be removed."},{"line_number":59,"context_line":"        for subnet in subnets:"},{"line_number":60,"context_line":"            ip_range \u003d range_qry.filter_by(subnet_id\u003dsubnet[\u0027id\u0027]).first()"},{"line_number":61,"context_line":"            if not ip_range:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_8e08ee92","line":58,"in_reply_to":"fa32b979_19ac2dec","updated":"2015-06-16 18:22:56.000000000","message":"The main source of deadlock is eventlet (even without Galera)\n\n  # greenthread1:\n  session1 \u003d get_session()\n  session1.begin()\n  session1.query(model).filter_by(id\u003did0).update(...)\n\n  # switch to greenthread2:  \n  session2 \u003d get_session()\n  session2.begin()\n  # deadlock:  session2 update waits for session1 commit/rolllback :s\n  session2.query(model).filter_by(id\u003did0).update(...)","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c529afe2fc172558fe921e68a908c7634724a2e1","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # NOTE(kevinbenton): this with_lockmode update can result in deadlocks"},{"line_number":56,"context_line":"        # so the wrap_db_retry decorator was added to ML2\u0027s methods that change"},{"line_number":57,"context_line":"        # the allocations (subnet and port CRUD). If this is replaced with a"},{"line_number":58,"context_line":"        # lockless algorithm, those retries can probably be removed."},{"line_number":59,"context_line":"        for subnet in subnets:"},{"line_number":60,"context_line":"            ip_range \u003d range_qry.filter_by(subnet_id\u003dsubnet[\u0027id\u0027]).first()"},{"line_number":61,"context_line":"            if not ip_range:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_dbfb0fc0","line":58,"in_reply_to":"fa32b979_6e61ea38","updated":"2015-06-16 22:11:53.000000000","message":"That article says that \u0027with_lockmode update\u0027 is the issue, which doesn\u0027t correspond the code sample you put above. Are you sure your code results in a deadlock?\n\nI do remember hearing that lockless algorithms can cause issues too, but I haven\u0027t been able to find the conditions they deadlocks occur under.","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"de53f8a15e014265824633785cb1f915d4df3938","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # NOTE(kevinbenton): this with_lockmode update can result in deadlocks"},{"line_number":56,"context_line":"        # so the wrap_db_retry decorator was added to ML2\u0027s methods that change"},{"line_number":57,"context_line":"        # the allocations (subnet and port CRUD). If this is replaced with a"},{"line_number":58,"context_line":"        # lockless algorithm, those retries can probably be removed."},{"line_number":59,"context_line":"        for subnet in subnets:"},{"line_number":60,"context_line":"            ip_range \u003d range_qry.filter_by(subnet_id\u003dsubnet[\u0027id\u0027]).first()"},{"line_number":61,"context_line":"            if not ip_range:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_6e61ea38","line":58,"in_reply_to":"fa32b979_8e08ee92","updated":"2015-06-16 18:25:31.000000000","message":"Galera deadlock: https://www.percona.com/blog/2014/09/11/openstack-users-shed-light-on-percona-xtradb-cluster-deadlock-issues/","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"3781d9fcedaa33017d733e939e90388b01840a31","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # NOTE(kevinbenton): this with_lockmode update can result in deadlocks"},{"line_number":56,"context_line":"        # so the wrap_db_retry decorator was added to ML2\u0027s methods that change"},{"line_number":57,"context_line":"        # the allocations (subnet and port CRUD). If this is replaced with a"},{"line_number":58,"context_line":"        # lockless algorithm, those retries can probably be removed."},{"line_number":59,"context_line":"        for subnet in subnets:"},{"line_number":60,"context_line":"            ip_range \u003d range_qry.filter_by(subnet_id\u003dsubnet[\u0027id\u0027]).first()"},{"line_number":61,"context_line":"            if not ip_range:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_00b5742f","line":58,"in_reply_to":"fa32b979_dbfb0fc0","updated":"2015-06-17 07:10:38.000000000","message":"@Kevin: my 2 comments describe 2 different types of deadlock: \n\n* the 1st is related to eventlet, \n* the 2nd is related to Galera.","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"d253b75282ceda55486cb904b21c332a06b465e8","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # NOTE(kevinbenton): this with_lockmode update can result in deadlocks"},{"line_number":56,"context_line":"        # so the wrap_db_retry decorator was added to ML2\u0027s methods that change"},{"line_number":57,"context_line":"        # the allocations (subnet and port CRUD). If this is replaced with a"},{"line_number":58,"context_line":"        # lockless algorithm, those retries can probably be removed."},{"line_number":59,"context_line":"        for subnet in subnets:"},{"line_number":60,"context_line":"            ip_range \u003d range_qry.filter_by(subnet_id\u003dsubnet[\u0027id\u0027]).first()"},{"line_number":61,"context_line":"            if not ip_range:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_c65012d7","line":58,"in_reply_to":"fa32b979_dbfb0fc0","updated":"2015-06-16 22:38:27.000000000","message":"A write \"certification failure manifests itself as a MySQL deadlock error, specifically error 1213\" [1].\n\n [1] http://www.joinfu.com/2015/01/understanding-reservations-concurrency-locking-in-nova/","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4440d518cfae1c05e84794085cee6c45a2551205","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # NOTE(kevinbenton): this with_lockmode update can result in deadlocks"},{"line_number":53,"context_line":"        # so the wrap_db_retry decorator was added to ML2\u0027s methods that change"},{"line_number":54,"context_line":"        # the allocations (subnet and port CRUD). If this is replaced with a"},{"line_number":55,"context_line":"        # lockless algorithm, those retries can probably be removed."},{"line_number":56,"context_line":"        range_qry \u003d context.session.query("},{"line_number":57,"context_line":"            models_v2.IPAvailabilityRange).join("},{"line_number":58,"context_line":"                models_v2.IPAllocationPool).with_lockmode(\u0027update\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_668a661d","line":55,"updated":"2015-06-16 22:47:11.000000000","message":"I don\u0027t think they can necessarily be removed if a lockless algorithm is used because of the way that galera manifests a conflict [1].  That is what I should have said before.\n\n [1] http://www.joinfu.com/2015/01/understanding-reservations-concurrency-locking-in-nova/","commit_id":"89fadbff9d49f6469df9926cd45b5ec861d947c0"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a5464f2b5be2ae00e0e66e85a0540d71c1c3531b","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # NOTE(kevinbenton): this with_lockmode update can result in deadlocks"},{"line_number":53,"context_line":"        # so the wrap_db_retry decorator was added to ML2\u0027s methods that change"},{"line_number":54,"context_line":"        # the allocations (subnet and port CRUD). If this is replaced with a"},{"line_number":55,"context_line":"        # lockless algorithm, those retries can probably be removed."},{"line_number":56,"context_line":"        range_qry \u003d context.session.query("},{"line_number":57,"context_line":"            models_v2.IPAvailabilityRange).join("},{"line_number":58,"context_line":"                models_v2.IPAllocationPool).with_lockmode(\u0027update\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_91ad239d","line":55,"in_reply_to":"fa32b979_1fd93822","updated":"2015-06-18 07:18:39.000000000","message":"Is it an immediate deadlock or a lockwait timeout? (I can\u0027t figure out how to invoke oslo_db opportunistic tests to try it)","commit_id":"89fadbff9d49f6469df9926cd45b5ec861d947c0"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ca335c8304b27c352a97758c5e3658874545f161","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # NOTE(kevinbenton): this with_lockmode update can result in deadlocks"},{"line_number":53,"context_line":"        # so the wrap_db_retry decorator was added to ML2\u0027s methods that change"},{"line_number":54,"context_line":"        # the allocations (subnet and port CRUD). If this is replaced with a"},{"line_number":55,"context_line":"        # lockless algorithm, those retries can probably be removed."},{"line_number":56,"context_line":"        range_qry \u003d context.session.query("},{"line_number":57,"context_line":"            models_v2.IPAvailabilityRange).join("},{"line_number":58,"context_line":"                models_v2.IPAllocationPool).with_lockmode(\u0027update\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_cbbb16e4","line":55,"in_reply_to":"fa32b979_6665861c","updated":"2015-06-17 16:00:39.000000000","message":"Based on the mailing list, it seems eliminating with_lockmode(\u0027update\u0027) would get rid of deadlocks in non-Galera deployments but not multi-master because any update can fail on them.","commit_id":"89fadbff9d49f6469df9926cd45b5ec861d947c0"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"93372e226860eb2bb09863f61c2dbc1c1ca9b2fd","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # NOTE(kevinbenton): this with_lockmode update can result in deadlocks"},{"line_number":53,"context_line":"        # so the wrap_db_retry decorator was added to ML2\u0027s methods that change"},{"line_number":54,"context_line":"        # the allocations (subnet and port CRUD). If this is replaced with a"},{"line_number":55,"context_line":"        # lockless algorithm, those retries can probably be removed."},{"line_number":56,"context_line":"        range_qry \u003d context.session.query("},{"line_number":57,"context_line":"            models_v2.IPAvailabilityRange).join("},{"line_number":58,"context_line":"                models_v2.IPAllocationPool).with_lockmode(\u0027update\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_6665861c","line":55,"in_reply_to":"fa32b979_668a661d","updated":"2015-06-16 23:05:13.000000000","message":"deadlock error 1213 is when you are using the \"with_lockmode(\u0027update\u0027)\".","commit_id":"89fadbff9d49f6469df9926cd45b5ec861d947c0"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"d091837bd5bc3a24af005db3a91b27214c8808d6","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # NOTE(kevinbenton): this with_lockmode update can result in deadlocks"},{"line_number":53,"context_line":"        # so the wrap_db_retry decorator was added to ML2\u0027s methods that change"},{"line_number":54,"context_line":"        # the allocations (subnet and port CRUD). If this is replaced with a"},{"line_number":55,"context_line":"        # lockless algorithm, those retries can probably be removed."},{"line_number":56,"context_line":"        range_qry \u003d context.session.query("},{"line_number":57,"context_line":"            models_v2.IPAvailabilityRange).join("},{"line_number":58,"context_line":"                models_v2.IPAllocationPool).with_lockmode(\u0027update\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_1fd93822","line":55,"in_reply_to":"fa32b979_cbbb16e4","updated":"2015-06-17 18:13:40.000000000","message":"Perhaps i miss something but this test[1] ends with a timeout caused by a deadlock\n\n[1] http://paste.openstack.org/show/299019/","commit_id":"89fadbff9d49f6469df9926cd45b5ec861d947c0"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"2ab06fadc1e89bea0ff619cc78fc93a4dfff483b","unresolved":false,"context_lines":[{"line_number":842,"context_line":""},{"line_number":843,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":844,"context_line":"                               retry_on_request\u003dTrue,"},{"line_number":845,"context_line":"                               retry_on_deadlock\u003dTrue)"},{"line_number":846,"context_line":"    def delete_subnet(self, context, id):"},{"line_number":847,"context_line":"        # REVISIT(rkukura) The super(Ml2Plugin, self).delete_subnet()"},{"line_number":848,"context_line":"        # function is not used because it deallocates the subnet\u0027s addresses"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_145bc42f","line":845,"updated":"2015-06-15 20:13:37.000000000","message":"I don\u0027t think retry_on_deadlock is needed here since this operation doesn\u0027t use any with_lockmode(update)","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"dbc7775d01b5114d4079cc92516480961a0fde83","unresolved":false,"context_lines":[{"line_number":842,"context_line":""},{"line_number":843,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":844,"context_line":"                               retry_on_request\u003dTrue,"},{"line_number":845,"context_line":"                               retry_on_deadlock\u003dTrue)"},{"line_number":846,"context_line":"    def delete_subnet(self, context, id):"},{"line_number":847,"context_line":"        # REVISIT(rkukura) The super(Ml2Plugin, self).delete_subnet()"},{"line_number":848,"context_line":"        # function is not used because it deallocates the subnet\u0027s addresses"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_57786b8f","line":845,"in_reply_to":"fa32b979_145bc42f","updated":"2015-06-15 22:10:11.000000000","message":"This was actually one of the major sources of it. The issue seems to be that it tries to delete allocations while a lock is held by the allocation code.","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c529afe2fc172558fe921e68a908c7634724a2e1","unresolved":false,"context_lines":[{"line_number":842,"context_line":""},{"line_number":843,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":844,"context_line":"                               retry_on_request\u003dTrue,"},{"line_number":845,"context_line":"                               retry_on_deadlock\u003dTrue)"},{"line_number":846,"context_line":"    def delete_subnet(self, context, id):"},{"line_number":847,"context_line":"        # REVISIT(rkukura) The super(Ml2Plugin, self).delete_subnet()"},{"line_number":848,"context_line":"        # function is not used because it deallocates the subnet\u0027s addresses"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_5bd5bf19","line":845,"in_reply_to":"fa32b979_2cdd38e0","updated":"2015-06-16 22:11:53.000000000","message":"but that\u0027s the problem. IIUC pymysql will now yield during database calls since it\u0027s a native python driver and that is recognized as IO.","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"2e5ade26126cf83ec9e955ea17d62884b2b415cf","unresolved":false,"context_lines":[{"line_number":842,"context_line":""},{"line_number":843,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":844,"context_line":"                               retry_on_request\u003dTrue,"},{"line_number":845,"context_line":"                               retry_on_deadlock\u003dTrue)"},{"line_number":846,"context_line":"    def delete_subnet(self, context, id):"},{"line_number":847,"context_line":"        # REVISIT(rkukura) The super(Ml2Plugin, self).delete_subnet()"},{"line_number":848,"context_line":"        # function is not used because it deallocates the subnet\u0027s addresses"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_acef0886","line":845,"in_reply_to":"fa32b979_57786b8f","updated":"2015-06-16 14:30:26.000000000","message":"Makes sense.","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"56acfa6fa64cd7270c7f4ba221e3128474c0ab4b","unresolved":false,"context_lines":[{"line_number":842,"context_line":""},{"line_number":843,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":844,"context_line":"                               retry_on_request\u003dTrue,"},{"line_number":845,"context_line":"                               retry_on_deadlock\u003dTrue)"},{"line_number":846,"context_line":"    def delete_subnet(self, context, id):"},{"line_number":847,"context_line":"        # REVISIT(rkukura) The super(Ml2Plugin, self).delete_subnet()"},{"line_number":848,"context_line":"        # function is not used because it deallocates the subnet\u0027s addresses"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_2cdd38e0","line":845,"in_reply_to":"fa32b979_57786b8f","updated":"2015-06-16 14:28:44.000000000","message":"This kind of suggests that while you\u0027re definetely fixing the problem here you might try and remove the source... which could be an untimely yield from the \"other\" transaction that acquires a lock.","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"}],"neutron/tests/unit/plugins/ml2/test_plugin.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"751b956fd30a492b84f73d0915d5188e818c72b9","unresolved":false,"context_lines":[{"line_number":350,"context_line":"        attempt \u003d [0]"},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"        def deadlock_once(*args):"},{"line_number":353,"context_line":"            from oslo_db import exception as oslo_exc"},{"line_number":354,"context_line":"            if not attempt[0]:"},{"line_number":355,"context_line":"                attempt[0] \u003d 1"},{"line_number":356,"context_line":"                raise oslo_exc.DBDeadlock()"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_abbfe4f9","line":353,"updated":"2015-06-16 18:02:44.000000000","message":"I don\u0027t get this.  Is there a reason for this that I\u0027m too dense to see (and will be embarrassed when I find out)?","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"751b956fd30a492b84f73d0915d5188e818c72b9","unresolved":false,"context_lines":[{"line_number":352,"context_line":"        def deadlock_once(*args):"},{"line_number":353,"context_line":"            from oslo_db import exception as oslo_exc"},{"line_number":354,"context_line":"            if not attempt[0]:"},{"line_number":355,"context_line":"                attempt[0] \u003d 1"},{"line_number":356,"context_line":"                raise oslo_exc.DBDeadlock()"},{"line_number":357,"context_line":"            return orig(*args)"},{"line_number":358,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_59487587","line":355,"updated":"2015-06-16 18:02:44.000000000","message":"Ah, the joys of closures.\n\nattempt[0] isn\u0027t really intuitive to me because \"attempts\" is what\u0027s contained in the list, not the list itself.  What about this as an alternative:\n\n  closure_data \u003d {\u0027attempts\u0027: 0}\n\n  def ...\n      if closure_data{\u0027attempts\u0027} \u003d\u003d 0:\n          closure_data[\u0027attempts\u0027} \u003d 1\n      ...\n\nIt makes it clear that we\u0027re creating this extra container just to hold the value because we can\u0027t mutate variable references inside of a closure.  At least, that is what it says to me.","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c529afe2fc172558fe921e68a908c7634724a2e1","unresolved":false,"context_lines":[{"line_number":352,"context_line":"        def deadlock_once(*args):"},{"line_number":353,"context_line":"            from oslo_db import exception as oslo_exc"},{"line_number":354,"context_line":"            if not attempt[0]:"},{"line_number":355,"context_line":"                attempt[0] \u003d 1"},{"line_number":356,"context_line":"                raise oslo_exc.DBDeadlock()"},{"line_number":357,"context_line":"            return orig(*args)"},{"line_number":358,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_fbd053f8","line":355,"in_reply_to":"fa32b979_59487587","updated":"2015-06-16 22:11:53.000000000","message":"I\u0027ll just stash it on self so we don\u0027t have an extra data structure to read through.","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"1b2ad65f2bbdf21ecf3958e73658009738519a9a","unresolved":false,"context_lines":[{"line_number":352,"context_line":"        def deadlock_once(*args):"},{"line_number":353,"context_line":"            from oslo_db import exception as oslo_exc"},{"line_number":354,"context_line":"            if not attempt[0]:"},{"line_number":355,"context_line":"                attempt[0] \u003d 1"},{"line_number":356,"context_line":"                raise oslo_exc.DBDeadlock()"},{"line_number":357,"context_line":"            return orig(*args)"},{"line_number":358,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_db6f8f29","line":355,"in_reply_to":"fa32b979_fbd053f8","updated":"2015-06-16 22:14:40.000000000","message":"I was following the style of the test below, but I do agree that it\u0027s not intuitive.","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"2e5ade26126cf83ec9e955ea17d62884b2b415cf","unresolved":false,"context_lines":[{"line_number":354,"context_line":"            if not attempt[0]:"},{"line_number":355,"context_line":"                attempt[0] \u003d 1"},{"line_number":356,"context_line":"                raise oslo_exc.DBDeadlock()"},{"line_number":357,"context_line":"            return orig(*args)"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        with mock.patch.object("},{"line_number":360,"context_line":"            plugin, \u0027_get_subnet\u0027, side_effect\u003ddeadlock_once"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_6ca02044","line":357,"updated":"2015-06-16 14:30:26.000000000","message":"It looks to me like if we were testing the retry decorator, isn\u0027t that tested in it\u0027s own unit tests?\n\nCan\u0027t we just assume that works?","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"751b956fd30a492b84f73d0915d5188e818c72b9","unresolved":false,"context_lines":[{"line_number":354,"context_line":"            if not attempt[0]:"},{"line_number":355,"context_line":"                attempt[0] \u003d 1"},{"line_number":356,"context_line":"                raise oslo_exc.DBDeadlock()"},{"line_number":357,"context_line":"            return orig(*args)"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        with mock.patch.object("},{"line_number":360,"context_line":"            plugin, \u0027_get_subnet\u0027, side_effect\u003ddeadlock_once"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_b95661d0","line":357,"in_reply_to":"fa32b979_6ca02044","updated":"2015-06-16 18:02:44.000000000","message":"We can assume that it works but not necessarily that it was applied.  This tests that it was applied (and that it works).\n\nIt is a bit \"double-entry\" but, honestly, I don\u0027t have an aversion to some kinds of double-entry tests.  I\u0027m actually a big fan of double-entry accounting (in financial terms).  Is it so bad?  I don\u0027t consider a replacement for higher-level tests but it isn\u0027t clear how to achieve a higher-level test in this case.","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c529afe2fc172558fe921e68a908c7634724a2e1","unresolved":false,"context_lines":[{"line_number":354,"context_line":"            if not attempt[0]:"},{"line_number":355,"context_line":"                attempt[0] \u003d 1"},{"line_number":356,"context_line":"                raise oslo_exc.DBDeadlock()"},{"line_number":357,"context_line":"            return orig(*args)"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        with mock.patch.object("},{"line_number":360,"context_line":"            plugin, \u0027_get_subnet\u0027, side_effect\u003ddeadlock_once"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_7b968340","line":357,"in_reply_to":"fa32b979_b95661d0","updated":"2015-06-16 22:11:53.000000000","message":"This isn\u0027t double-entry testing. This just ensures that when a deadlock is raised that everything continues to work. This just tests that it was integrated correctly (i.e. a retry at this level works as expected).\n\nDouble-entry would be testing a bunch of internals (e.g. that it calls isinstance on the exception, etc.).","commit_id":"885fc7ee304b59a4bf5e2738cd7751e35a3f555f"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"3f99ca9d607a73fbeea21cdb30a9439f7d3f679e","unresolved":false,"context_lines":[{"line_number":347,"context_line":"    def test_delete_subnet_deadlock_retry(self):"},{"line_number":348,"context_line":"        plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":349,"context_line":"        orig \u003d plugin._get_subnet"},{"line_number":350,"context_line":"        self.attempt \u003d 0"},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"        def deadlock_once(*args):"},{"line_number":353,"context_line":"            from oslo_db import exception as oslo_exc"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_8c96ab3d","line":350,"updated":"2015-06-17 00:25:46.000000000","message":"attempt[0] was easier to read for me.  but probably it\u0027s just me. :-)","commit_id":"89fadbff9d49f6469df9926cd45b5ec861d947c0"}]}
