)]}'
{"neutron/tests/unit/db/test_db_base_plugin_v2.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"b7502ed774a15b792a8889f5ac29632ca87fe0f0","unresolved":true,"context_lines":[{"line_number":6766,"context_line":""},{"line_number":6767,"context_line":"        with testtools.ExpectedException(orm.exc.NoResultFound):"},{"line_number":6768,"context_line":"            with testtools.ExpectedException(orm.exc.StaleDataError) as e:"},{"line_number":6769,"context_line":"                coro.wait()"},{"line_number":6770,"context_line":"        if e and \"confirm_deleted_rows\" in e:"},{"line_number":6771,"context_line":"            self.fail(\"Meets bug 1916889\")"},{"line_number":6772,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9ef31a5e_bb736cb9","line":6769,"updated":"2021-03-02 08:29:49.000000000","message":"I think that what you want to test is the following execution flow:\n- coro: read query\n- main thread: read and delete\n- coro: delete query\n\nBecause you are creating green threads, the coroutine will be executed once the main thread deletion is done. In order to simulate this, you\u0027ll need to:\n- Add a sleep, in the coro, between the read and the deletion.\n- Before starting the context in the main thread, start executing the coro (using sleep to pass the GIL).\n- Wait for the coro, to finish the coro execution.\n--\u003e that should throw a StaleDataError\n\nYou also have another problem: the context is the same in both threads. If you close the session in one of them, the session of this context in the other one will be closed too (new engine facade, no nested transactions). You need to create two contexts.","commit_id":"f9b7ec25932e9f73febd7f1f5cea57b4bb30a169"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"ef0081a960e53aed8cb457c5cb775593f9e54431","unresolved":true,"context_lines":[{"line_number":6766,"context_line":""},{"line_number":6767,"context_line":"        with testtools.ExpectedException(orm.exc.NoResultFound):"},{"line_number":6768,"context_line":"            with testtools.ExpectedException(orm.exc.StaleDataError) as e:"},{"line_number":6769,"context_line":"                coro.wait()"},{"line_number":6770,"context_line":"        if e and \"confirm_deleted_rows\" in e:"},{"line_number":6771,"context_line":"            self.fail(\"Meets bug 1916889\")"},{"line_number":6772,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"461e0821_8422def8","line":6769,"in_reply_to":"9ef31a5e_bb736cb9","updated":"2021-03-08 01:01:30.000000000","message":"\u003e I think that what you want to test is the following execution flow:\n\u003e - coro: read query\n\u003e - main thread: read and delete\n\u003e - coro: delete query\n\u003e \n\u003e Because you are creating green threads, the coroutine will be executed once the main thread deletion is done. In order to simulate this, you\u0027ll need to:\n\u003e - Add a sleep, in the coro, between the read and the deletion.\n\u003e - Before starting the context in the main thread, start executing the coro (using sleep to pass the GIL).\n\u003e - Wait for the coro, to finish the coro execution.\n\u003e --\u003e that should throw a StaleDataError\n\u003e \n\nYep, I will try it.\n\n\u003e You also have another problem: the context is the same in both threads. If you close the session in one of them, the session of this context in the other one will be closed too (new engine facade, no nested transactions). You need to create two contexts.\n\nThere are 3 contexts at Line 6748, 6755, 6762. Is that engouth?","commit_id":"f9b7ec25932e9f73febd7f1f5cea57b4bb30a169"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"af4dbf65aef77f025694344abce0011afe6b6244","unresolved":true,"context_lines":[{"line_number":6803,"context_line":"                    ctx.session.delete(thing)"},{"line_number":6804,"context_line":"            except orm.exc.StaleDataError as e:"},{"line_number":6805,"context_line":"                if e and \"confirm_deleted_rows\" in str(e):"},{"line_number":6806,"context_line":"                    self.fail(\"Meets bug 1916889\")"},{"line_number":6807,"context_line":""},{"line_number":6808,"context_line":"        with lock():"},{"line_number":6809,"context_line":"            coro \u003d eventlet.spawn(_lock_blocked_object_delete)"}],"source_content_type":"text/x-python","patch_set":6,"id":"49bea52f_ab40c19d","line":6806,"updated":"2021-04-21 15:33:15.000000000","message":"nit: could be fine to catch any other exception raise in this thread and log if any","commit_id":"45a6afb8224c2ee78af153430f3396a47f7861d8"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"af4dbf65aef77f025694344abce0011afe6b6244","unresolved":true,"context_lines":[{"line_number":6807,"context_line":""},{"line_number":6808,"context_line":"        with lock():"},{"line_number":6809,"context_line":"            coro \u003d eventlet.spawn(_lock_blocked_object_delete)"},{"line_number":6810,"context_line":"            ctx \u003d context.get_admin_context()"},{"line_number":6811,"context_line":"            with db_api.CONTEXT_WRITER.using(ctx):"},{"line_number":6812,"context_line":"                thing \u003d ctx.session.query(model).filter_by(id\u003ddbid).one()"},{"line_number":6813,"context_line":"                eventlet.sleep(0)"}],"source_content_type":"text/x-python","patch_set":6,"id":"43aa6745_1b235d40","line":6810,"updated":"2021-04-21 15:33:15.000000000","message":"nit: redundant, L6791","commit_id":"45a6afb8224c2ee78af153430f3396a47f7861d8"}]}
