)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d6fb5ec43e2958897d2dfdf32eec594d7394fd39","unresolved":true,"context_lines":[{"line_number":10,"context_line":"only and took the first row. A rescheduled build records one"},{"line_number":11,"context_line":"compute__do_build_and_run_instance event per attempt under the same"},{"line_number":12,"context_line":"action, so every finish was written to the oldest row and later"},{"line_number":13,"context_line":"attempts kept no result or finish time."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Finish the oldest unfinished event with that name instead, falling"},{"line_number":16,"context_line":"back to the previous lookup when all are finished."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"20aa8e2d_757f0ad4","line":13,"updated":"2026-10-27 17:48:59.000000000","message":"so that sounds ligit but for this type of race ideally you would create a functional reproducer first where the first time it would rasise a build failure and on the subsecite atempt it woudl pass.\n\nour standard practice for any non trivial bug is to first start with a functionl requestion test for the repoted bug that demondtrate the broken behvior by in this case asserting the wrong event is updated.\n\nhttps://github.com/openstack/nova/tree/master/nova/tests/functional/regressions\n\n\nthis is an example fo a functional tsts tha reties on build failure\n\nhttps://github.com/openstack/nova/blob/9d4d29d940edde88dd27ce725ef80a7cee55ce10/nova/tests/functional/regressions/test_bug_1671648.py\n\nyou can see it injects a failure on teh first execution and passes on the second\n\nhttps://github.com/openstack/nova/blob/9d4d29d940edde88dd27ce725ef80a7cee55ce10/nova/tests/functional/regressions/test_bug_1671648.py#L80-L99\n\nand this show how to get the instance action evetns\n\nhttps://github.com/openstack/nova/blob/9d4d29d940edde88dd27ce725ef80a7cee55ce10/nova/tests/functional/regressions/test_bug_1852458.py#L65-L77\n\nso ideally you would use those as a refence to create a regression test to demostarte teh bug\n\nthen rebase this fix on top.\n\nwe preseve both comits (teh regression test and the fix) in the final git history merging both commtis into master without squashing.\n\nthat allwo you to dembondary that your fix is correct becase to have the ci pass you will need to update the regresion test to assert the expecte bevhiro.\n\nlike this\nhttps://github.com/openstack/nova/commit/72e1506101b131b51fbe77acc0af19f36899c28d\nhttps://github.com/openstack/nova/commit/cb4ce72f5f092644aa9b84fa58bcb9fd89b6bedc","commit_id":"6bbf3a34d81cb948d850b089d7f09bf11cc0d055"}],"nova/db/main/api.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d6fb5ec43e2958897d2dfdf32eec594d7394fd39","unresolved":true,"context_lines":[{"line_number":4014,"context_line":"                                    request_id\u003dvalues[\u0027request_id\u0027],"},{"line_number":4015,"context_line":"                                    instance_uuid\u003dvalues[\u0027instance_uuid\u0027])"},{"line_number":4016,"context_line":""},{"line_number":4017,"context_line":"    # A rescheduled build records one event per attempt with the same name"},{"line_number":4018,"context_line":"    # under the same action. Finish the oldest unfinished one so that each"},{"line_number":4019,"context_line":"    # attempt keeps its own finish_time and result."},{"line_number":4020,"context_line":"    query \u003d model_query(context, models.InstanceActionEvent).\\"},{"line_number":4021,"context_line":"        filter_by(action_id\u003daction[\u0027id\u0027]).\\"},{"line_number":4022,"context_line":"        filter_by(event\u003dvalues[\u0027event\u0027])"},{"line_number":4023,"context_line":"    event_ref \u003d query.filter_by(finish_time\u003dNone).\\"},{"line_number":4024,"context_line":"        order_by(expression.asc(\u0027id\u0027)).\\"},{"line_number":4025,"context_line":"        first()"},{"line_number":4026,"context_line":"    if not event_ref:"},{"line_number":4027,"context_line":"        # Every matching event is already finished: keep the old behaviour."},{"line_number":4028,"context_line":"        event_ref \u003d query.first()"}],"source_content_type":"text/x-python","patch_set":1,"id":"d5aaff67_6ef6ab5c","line":4025,"range":{"start_line":4017,"start_character":1,"end_line":4025,"end_character":15},"updated":"2026-10-27 17:48:59.000000000","message":"while the primary keys do typiclly go up you shoudl not rely on that.\nit woul be better to order by `start_time`\nhttps://github.com/openstack/nova/blob/master/nova/db/main/models.py#L1091C5-L1091C15","commit_id":"6bbf3a34d81cb948d850b089d7f09bf11cc0d055"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d6fb5ec43e2958897d2dfdf32eec594d7394fd39","unresolved":true,"context_lines":[{"line_number":4023,"context_line":"    event_ref \u003d query.filter_by(finish_time\u003dNone).\\"},{"line_number":4024,"context_line":"        order_by(expression.asc(\u0027id\u0027)).\\"},{"line_number":4025,"context_line":"        first()"},{"line_number":4026,"context_line":"    if not event_ref:"},{"line_number":4027,"context_line":"        # Every matching event is already finished: keep the old behaviour."},{"line_number":4028,"context_line":"        event_ref \u003d query.first()"},{"line_number":4029,"context_line":""},{"line_number":4030,"context_line":"    if not event_ref:"},{"line_number":4031,"context_line":"        raise exception.InstanceActionEventNotFound(action_id\u003daction[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"af819620_ad078ad1","line":4028,"range":{"start_line":4026,"start_character":4,"end_line":4028,"end_character":33},"updated":"2026-10-27 17:48:59.000000000","message":"im not sure we want to do that.\ni woudl be inclided to raise exception.InstanceActionEventNotFound or just delete this if entirly.","commit_id":"6bbf3a34d81cb948d850b089d7f09bf11cc0d055"}]}
