)]}'
{"neutron/pecan_wsgi/hooks/quota_enforcement.py":[{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"a5737d60c00bb7b54d9f702a1cf2a19f9ad17657","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        # retrieved in the \u0027after\u0027 hook"},{"line_number":62,"context_line":"        state.request.context[\u0027reservations\u0027] \u003d reservations"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @db_api.retry_db_errors"},{"line_number":65,"context_line":"    def after(self, state):"},{"line_number":66,"context_line":"        neutron_context \u003d state.request.context.get(\u0027neutron_context\u0027)"},{"line_number":67,"context_line":"        if not neutron_context:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_26df590d","line":64,"updated":"2019-11-11 18:31:06.000000000","message":"A little further down the stacktrace [1] set_quota_usage_dirty gets called and it has a retry decorator [2]. So I\u0027m not sure how adding one here helps - what am I missing?\n[1] http://paste.openstack.org/show/723982/\n[2] https://github.com/openstack/neutron/blob/stable/pike/neutron/db/quota/api.py#L108-L110","commit_id":"ab286bcdaccb788ab9df3186e0605e93a9b10bbc"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"b58d7696034680b5683f147ca74c93d5c192235d","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        # retrieved in the \u0027after\u0027 hook"},{"line_number":62,"context_line":"        state.request.context[\u0027reservations\u0027] \u003d reservations"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @db_api.retry_db_errors"},{"line_number":65,"context_line":"    def after(self, state):"},{"line_number":66,"context_line":"        neutron_context \u003d state.request.context.get(\u0027neutron_context\u0027)"},{"line_number":67,"context_line":"        if not neutron_context:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_4ca2b7fe","line":64,"in_reply_to":"3fa7e38b_26df590d","updated":"2019-11-11 19:51:35.000000000","message":"That decorator does retry only \"_if_session_inactive\", so it does nothing there, as the transaction starts here in after()","commit_id":"ab286bcdaccb788ab9df3186e0605e93a9b10bbc"}],"neutron/quota/resource_registry.py":[{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"6691fc76f4ced68af550b266bb5ee8b0f0cedec2","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    dirty status is True, sets the dirty bit to True in the database"},{"line_number":61,"context_line":"    for the appropriate tenants."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    Please note that this routine begins a nested transaction, and it"},{"line_number":64,"context_line":"    is not recommended that this transaction begins within another"},{"line_number":65,"context_line":"    transaction. For this reason the function will raise a SqlAlchemy"},{"line_number":66,"context_line":"    exception if such an attempt is made."}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_3a3d5e8e","line":63,"updated":"2019-11-06 10:19:59.000000000","message":"Is this comment still correct?","commit_id":"12f4e28e4ebc3369a87d658e3d6419fa808b5a1f"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"50fd4a7aa7910aae2884caae19d605a141192b7d","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    dirty status is True, sets the dirty bit to True in the database"},{"line_number":61,"context_line":"    for the appropriate tenants."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    Please note that this routine begins a nested transaction, and it"},{"line_number":64,"context_line":"    is not recommended that this transaction begins within another"},{"line_number":65,"context_line":"    transaction. For this reason the function will raise a SqlAlchemy"},{"line_number":66,"context_line":"    exception if such an attempt is made."}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_bac14e32","line":63,"in_reply_to":"3fa7e38b_3a3d5e8e","updated":"2019-11-06 10:44:17.000000000","message":"no it\u0027s not, good catch","commit_id":"12f4e28e4ebc3369a87d658e3d6419fa808b5a1f"},{"author":{"_account_id":11816,"name":"mike_mp@zzzcomputing.com","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"40936d275b37a24d67b03ec4c12e97b96b9af04b","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    dirty status is True, sets the dirty bit to True in the database"},{"line_number":62,"context_line":"    for the appropriate tenants."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    Please note that this routine begins a nested transaction, and it"},{"line_number":65,"context_line":"    is not recommended that this transaction begins within another"},{"line_number":66,"context_line":"    transaction. For this reason the function will raise a SqlAlchemy"},{"line_number":67,"context_line":"    exception if such an attempt is made."}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_02bfc9aa","side":"PARENT","line":64,"updated":"2019-11-07 15:11:41.000000000","message":"the CONTEXT_WRITER.using() statement below does not begin a nested transaction, it only affirms that a transaction is in progress if one was not already.   is it possible this comment was left over from before neutron was converted to enginefacade?","commit_id":"843b5ffd9a8ee3f4d9d8830f43aa3d517cc11e07"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"6bda835e927dbd96c96b3fa62b39950ec48ccd5d","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    dirty status is True, sets the dirty bit to True in the database"},{"line_number":62,"context_line":"    for the appropriate tenants."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    Please note that this routine begins a nested transaction, and it"},{"line_number":65,"context_line":"    is not recommended that this transaction begins within another"},{"line_number":66,"context_line":"    transaction. For this reason the function will raise a SqlAlchemy"},{"line_number":67,"context_line":"    exception if such an attempt is made."}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_e88b641b","side":"PARENT","line":64,"in_reply_to":"3fa7e38b_02bfc9aa","updated":"2019-11-08 09:24:26.000000000","message":"agree","commit_id":"843b5ffd9a8ee3f4d9d8830f43aa3d517cc11e07"},{"author":{"_account_id":11816,"name":"mike_mp@zzzcomputing.com","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"40936d275b37a24d67b03ec4c12e97b96b9af04b","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        return"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    for res in get_all_resources().values():"},{"line_number":75,"context_line":"        with db_api.CONTEXT_WRITER.using(context):"},{"line_number":76,"context_line":"            if is_tracked(res.name) and res.dirty:"},{"line_number":77,"context_line":"                res.mark_dirty(context)"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_02d4a9e8","side":"PARENT","line":75,"updated":"2019-11-07 15:11:41.000000000","message":"I\u0027m not sure this should be removed.   if set_resources_dirty is called directly from a function that did not establish a transaction, then this will fail.   The db_api.CONTEXT_WRITER.using(context) acts as only an assertion that a transaction is in play, assuming one is in progress already.\n\nOTOH if you would like this function to actively fail if it is called from outside of an existing DB transaction then this can be left off.\n\nbut in either case enginefacade doesn\u0027t do \"nested\" transactions unless you tell it to do so explicitly.","commit_id":"843b5ffd9a8ee3f4d9d8830f43aa3d517cc11e07"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"781daf5e14bac777b71a8962450dbe9a35771959","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        return"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    for res in get_all_resources().values():"},{"line_number":75,"context_line":"        with db_api.CONTEXT_WRITER.using(context):"},{"line_number":76,"context_line":"            if is_tracked(res.name) and res.dirty:"},{"line_number":77,"context_line":"                res.mark_dirty(context)"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_e515cd9c","side":"PARENT","line":75,"in_reply_to":"3fa7e38b_02d4a9e8","updated":"2019-11-08 08:07:42.000000000","message":"Hmm, I thought db_api.CONTEXT_WRITER.using(context) will start a transaction is one is not active. mark_dirty() below is decorated with retry_if_session_inactive - which will fail if transaction is in progress.\n\nAlso why would one start a transaction inside a for loop?","commit_id":"843b5ffd9a8ee3f4d9d8830f43aa3d517cc11e07"},{"author":{"_account_id":11816,"name":"mike_mp@zzzcomputing.com","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"55fe1da95ee0b0e9467fafc6048f93d373281f24","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        return"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    for res in get_all_resources().values():"},{"line_number":75,"context_line":"        with db_api.CONTEXT_WRITER.using(context):"},{"line_number":76,"context_line":"            if is_tracked(res.name) and res.dirty:"},{"line_number":77,"context_line":"                res.mark_dirty(context)"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_b97ffc64","side":"PARENT","line":75,"in_reply_to":"3fa7e38b_c8b8e8e9","updated":"2019-11-08 14:10:41.000000000","message":"I think I wasn\u0027t clear and my use of the word \"assert\" is inaccurate.    the \"db_api.CONTEXT_WRITER.using(context)\" does this:\n\n1. if there is no DB transaction started, it starts one.\n\n2. if there *is* a DB transaction started, it passes silently.\n\nthat\u0027s all it does.   there\u0027s no \"nested\" transaction, which is something that used to be the case before the enginefacade was used.","commit_id":"843b5ffd9a8ee3f4d9d8830f43aa3d517cc11e07"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2278f748c7fa1808c67069eb1e24695895f69a0e","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        return"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    for res in get_all_resources().values():"},{"line_number":75,"context_line":"        with db_api.CONTEXT_WRITER.using(context):"},{"line_number":76,"context_line":"            if is_tracked(res.name) and res.dirty:"},{"line_number":77,"context_line":"                res.mark_dirty(context)"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_c8b8e8e9","side":"PARENT","line":75,"in_reply_to":"3fa7e38b_e515cd9c","updated":"2019-11-08 09:21:13.000000000","message":"Indeed, set_resources_dirty is always called from inside a transaction, I missed that somehow. So the patch is wrong in its current state. I\u0027ll redo. Thanks Michael.","commit_id":"843b5ffd9a8ee3f4d9d8830f43aa3d517cc11e07"},{"author":{"_account_id":11816,"name":"mike_mp@zzzcomputing.com","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"a1197b875d2a1533b87e6bd5c0a9715f2cd83ef7","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        return"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    for res in get_all_resources().values():"},{"line_number":70,"context_line":"        with db_api.CONTEXT_WRITER.using(context):"},{"line_number":71,"context_line":"            if is_tracked(res.name) and res.dirty:"},{"line_number":72,"context_line":"                res.mark_dirty(context)"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_79d66456","line":70,"updated":"2019-11-08 14:13:01.000000000","message":"I think this is fine.    If there is already a DB transaction in play, then this just passes without doing anything.  if there is not a DB transaction in play, it starts one.  I\u0027m assuming the res.mark_dirty() call requires a DB transaction.  I don\u0027t think it would interfere with a retry decorator outside.","commit_id":"ab286bcdaccb788ab9df3186e0605e93a9b10bbc"}]}
