)]}'
{"nova/compute/api.py":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"53ab185779a8e3f0003cabf6af492a5df452f3e2","unresolved":false,"context_lines":[{"line_number":1201,"context_line":""},{"line_number":1202,"context_line":"        self.db.instance_test_and_set("},{"line_number":1203,"context_line":"                context, instance_uuid, \u0027task_state\u0027, [None], task_state)"},{"line_number":1204,"context_line":"        instance[\u0027task_state\u0027] \u003d task_state"},{"line_number":1205,"context_line":""},{"line_number":1206,"context_line":"        notifications.send_update_with_states(context, instance, old_vm_state,"},{"line_number":1207,"context_line":"                instance[\"vm_state\"], old_task_state, instance[\"task_state\"],"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FJrk%3D","line":1204,"updated":"2012-10-10 21:50:39.000000000","message":"It would be better to have instance_test_and_set() return the updated \u0027instance\u0027... and just \u0027instance \u003d\u0027 here.  Then we\u0027ll grab anything else that could have possibly changed with the instance as well before sending via rpc.  (We do this when calling db.instance_update(), etc in other parts of the code).","commit_id":"2a8c1f605c5b83b281f5b7c151b14f346fe467a0"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"638ae06e249a77b5e1202987ca29bc24e013fea6","unresolved":false,"context_lines":[{"line_number":1201,"context_line":""},{"line_number":1202,"context_line":"        self.db.instance_test_and_set("},{"line_number":1203,"context_line":"                context, instance_uuid, \u0027task_state\u0027, [None], task_state)"},{"line_number":1204,"context_line":"        instance[\u0027task_state\u0027] \u003d task_state"},{"line_number":1205,"context_line":""},{"line_number":1206,"context_line":"        notifications.send_update_with_states(context, instance, old_vm_state,"},{"line_number":1207,"context_line":"                instance[\"vm_state\"], old_task_state, instance[\"task_state\"],"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FJqw%3D","line":1204,"in_reply_to":"AAAALH%2F%2FJrk%3D","updated":"2012-10-10 22:05:47.000000000","message":"My first attempt did it this way.\n\nThe problem is that the test_and_set call, when it loads the instance, doesn\u0027t eager load all of the relationships (importantly \u0027metadata\u0027).\n\nIn the interest of keeping the select-statement with \u0027locking update\u0027 as simple as possible, I opted to have continue to just hit one table and instead just modify the original instance in the caller-code.\n\nLong term we should rework the DB API so that we can mutate instances rather than having to re-fetch and return them anew on each call.","commit_id":"2a8c1f605c5b83b281f5b7c151b14f346fe467a0"}]}
