)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8858ef117535da15f4dfac4e9ef56631cca3c33a","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix metadata update in race condition"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"In the current implementation, when multiple"},{"line_number":10,"context_line":"update server\u0027s metadata API take place"},{"line_number":11,"context_line":"concurrently, problem will occour, details"},{"line_number":12,"context_line":"can be found in bug discription."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I0b559554ffde3a93c68e0aee9fc6bc73614150b6"},{"line_number":15,"context_line":"Closes-bug: #1650188"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"da4df55a_a41d6fbf","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":32},"updated":"2016-12-22 03:18:30.000000000","message":"Generally we\u0027d like the commit message to explain the bug a bit and then explain how this patch is going to fix it.\n\nI\u0027d also like to see a test for this, which might be non-trivial but we could probably do something with a functional API test where we run 2 requests at the same time, or one right after another, but maybe put some kind of mock sleep in the code to make the first request just slow enough such that the 2nd request hits the lock.","commit_id":"75d8c4e84f9393f11c672589b72c726506dd93b0"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"40d6e63561f6af85c57c4c892e882b11780c6097","unresolved":false,"context_lines":[{"line_number":9,"context_line":"In the current implementation, when multiple"},{"line_number":10,"context_line":"update server\u0027s metadata API take place"},{"line_number":11,"context_line":"concurrently, problem will occour, details"},{"line_number":12,"context_line":"can be found in bug discription."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I0b559554ffde3a93c68e0aee9fc6bc73614150b6"},{"line_number":15,"context_line":"Closes-bug: #1650188"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"da4df55a_3df5d1ca","line":12,"updated":"2016-12-23 12:21:29.000000000","message":"nit: s/discription/description/ when you get the chance","commit_id":"75d8c4e84f9393f11c672589b72c726506dd93b0"}],"nova/api/openstack/compute/server_metadata.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8858ef117535da15f4dfac4e9ef56631cca3c33a","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def _update_instance_metadata(self, context, server_id, metadata,"},{"line_number":108,"context_line":"                                  delete\u003dFalse):"},{"line_number":109,"context_line":"        @utils.synchronized(server_id)"},{"line_number":110,"context_line":"        def do_update():"},{"line_number":111,"context_line":"            server \u003d common.get_instance(self.compute_api, context, server_id)"},{"line_number":112,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"da4df55a_04fe3b6b","line":109,"updated":"2016-12-22 03:18:30.000000000","message":"Generally I don\u0027t think we lock on anything in the REST API, it seems if we do this it\u0027d be better to be something that we lock in the actual compute API class.","commit_id":"75d8c4e84f9393f11c672589b72c726506dd93b0"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"c2513f5aec7e2c45ca6ddc1d6582060ca75f6620","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def _update_instance_metadata(self, context, server_id, metadata,"},{"line_number":108,"context_line":"                                  delete\u003dFalse):"},{"line_number":109,"context_line":"        @utils.synchronized(server_id)"},{"line_number":110,"context_line":"        def do_update():"},{"line_number":111,"context_line":"            server \u003d common.get_instance(self.compute_api, context, server_id)"},{"line_number":112,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"da4df55a_c4ed1390","line":109,"in_reply_to":"da4df55a_04fe3b6b","updated":"2016-12-22 03:22:03.000000000","message":"Thanks alot for the comment, I\u0027m acutally looking for good advises, as I listed in https://bugs.launchpad.net/nova/+bug/1650188 the whole process is actually a bit mess, so if it doesn\u0027t lock here, the bug still exists.","commit_id":"75d8c4e84f9393f11c672589b72c726506dd93b0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79b86e72ba38f9894c6a50ccd9c49810105c59d4","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def _update_instance_metadata(self, context, server_id, metadata,"},{"line_number":108,"context_line":"                                  delete\u003dFalse):"},{"line_number":109,"context_line":"        @utils.synchronized(server_id)"},{"line_number":110,"context_line":"        def do_update():"},{"line_number":111,"context_line":"            server \u003d common.get_instance(self.compute_api, context, server_id)"},{"line_number":112,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"da4df55a_e4c057e3","line":109,"in_reply_to":"da4df55a_c4ed1390","updated":"2016-12-22 03:24:43.000000000","message":"Roman mentioned etags:\n\nhttps://en.wikipedia.org/wiki/HTTP_ETag\n\nI\u0027m not very familiar with them either and haven\u0027t used them in practice, but I know Chris Dent (cdent) and Jay Pipes (jaypipes) are more familiar with those so we should ask them for some ideas there. Jay might also have ideas on how we might possibly move the atomic lock into the database API rather than the REST API.","commit_id":"75d8c4e84f9393f11c672589b72c726506dd93b0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e954880203d10502d7a369d1f5d3a6ccfcf93ba7","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def _update_instance_metadata(self, context, server_id, metadata,"},{"line_number":108,"context_line":"                                  delete\u003dFalse):"},{"line_number":109,"context_line":"        @utils.synchronized(server_id)"},{"line_number":110,"context_line":"        def do_update():"},{"line_number":111,"context_line":"            server \u003d common.get_instance(self.compute_api, context, server_id)"},{"line_number":112,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"da4df55a_ff08e22a","line":109,"in_reply_to":"da4df55a_e4c057e3","updated":"2016-12-22 03:29:45.000000000","message":"This is how it\u0027s handled for the resource provider resource updates in the placement API:\n\nhttps://github.com/openstack/nova/blob/0fb7cbdc8072085c261e3546845786eff0c65cf1/nova/objects/resource_provider.py#L197\n\nIt\u0027s really more of a database API layer check, similar to the concept of etags which from my understanding means the client passes in the etag/generation id with the request and if when the DB API processes the request, the etag/generation id isn\u0027t the latest version, it means something updated the data concurrently and we return a 409 from the placement API which forces the client to fetch the latest version of the data they are trying to update, and resubmit the request with that latest version plus whatever update they are trying to make.\n\nThat\u0027s all built into the resource provider model though, so I\u0027m not sure how easy that would be to do in this existing model and API.","commit_id":"75d8c4e84f9393f11c672589b72c726506dd93b0"}]}
