)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"1b64990fb527059fa5b8c6a3ab24109b512709d7","unresolved":false,"context_lines":[{"line_number":22,"context_line":"moves them down to the plugins."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Change-Id: I7b8a4a105aabfa1b5f5dd7a638099007b0933e66"},{"line_number":25,"context_line":"Closes-Bug: #1617298"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3ac371cc_731583e3","line":25,"range":{"start_line":25,"start_character":0,"end_line":25,"end_character":20},"updated":"2016-08-17 15:38:04.000000000","message":"This bug doesn\u0027t exist. 404","commit_id":"281a668f89fb997527de98f3a60aae631b62935d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"afd98920c419119638fba763b13e4138bc1aca09","unresolved":false,"context_lines":[{"line_number":18,"context_line":"fatal exceptions on failures of core plugin calls."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"This patch removes them from the API layer except for on"},{"line_number":21,"context_line":"show and index since they are idempotent operations and"},{"line_number":22,"context_line":"moves them down to the plugins under a new decorator called"},{"line_number":23,"context_line":"\u0027retry_idempotent\u0027 which ensures two things. First, operations"},{"line_number":24,"context_line":"are only retried if they are not in an active transaction."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"1ac06dbe_4e67deb6","line":21,"updated":"2016-08-23 17:38:57.000000000","message":"I don\u0027t think we can do that, otherwise getter operations on plugins are unprotected if called directly, which might be a source of errors for plugin users like other service plugins.","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d01f20bd9a0320539d69d6456d75cf41bcc1877e","unresolved":false,"context_lines":[{"line_number":20,"context_line":"This patch removes them from the API layer except for on"},{"line_number":21,"context_line":"show and index since they are idempotent operations and"},{"line_number":22,"context_line":"moves them down to the plugins under a new decorator called"},{"line_number":23,"context_line":"\u0027retry_idempotent\u0027 which ensures two things. First, operations"},{"line_number":24,"context_line":"are only retried if they are not in an active transaction."},{"line_number":25,"context_line":"Second, the args and kwargs of the method are automatically"},{"line_number":26,"context_line":"deep copied to ensure that any mangling the method does to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"1ac06dbe_7d31b259","line":23,"updated":"2016-08-23 17:24:07.000000000","message":"we should document this in our devref, before we forget what we did and have to fish through git log.","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"afd98920c419119638fba763b13e4138bc1aca09","unresolved":false,"context_lines":[{"line_number":20,"context_line":"This patch removes them from the API layer except for on"},{"line_number":21,"context_line":"show and index since they are idempotent operations and"},{"line_number":22,"context_line":"moves them down to the plugins under a new decorator called"},{"line_number":23,"context_line":"\u0027retry_idempotent\u0027 which ensures two things. First, operations"},{"line_number":24,"context_line":"are only retried if they are not in an active transaction."},{"line_number":25,"context_line":"Second, the args and kwargs of the method are automatically"},{"line_number":26,"context_line":"deep copied to ensure that any mangling the method does to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"1ac06dbe_8ea716bc","line":23,"in_reply_to":"1ac06dbe_7d31b259","updated":"2016-08-23 17:38:57.000000000","message":"Ultimately we should mandate that every method that does datastore operations be protected by a retry decorator. The decorator must be applied to the outermost method that does DB operations (e.g. if the method call results into further calls into private methods, those should not be protected).","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"82bbbc61ecdcf0b9c0dbd4fbdfe25066d5845ddf","unresolved":false,"context_lines":[{"line_number":18,"context_line":"fatal exceptions on failures of core plugin calls."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"This patch removes them from the API layer except for on"},{"line_number":21,"context_line":"show and index since they are idempotent operations and"},{"line_number":22,"context_line":"moves them down to the plugins under a new decorator called"},{"line_number":23,"context_line":"\u0027retry_idempotent\u0027 which ensures two things. First, operations"},{"line_number":24,"context_line":"are only retried if they are not in an active transaction."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"fa7ab95a_2fd580b8","line":21,"updated":"2016-08-27 06:37:06.000000000","message":"I think a todo with a bugref should be enough.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":18,"context_line":"fatal exceptions on failures of core plugin calls."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"This patch removes them from the API layer except for on"},{"line_number":21,"context_line":"show and index since they are idempotent operations and"},{"line_number":22,"context_line":"moves them down to the plugins under a new decorator called"},{"line_number":23,"context_line":"\u0027retry_idempotent\u0027 which ensures two things. First, operations"},{"line_number":24,"context_line":"are only retried if they are not in an active transaction."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"1ac06dbe_3ad23c35","line":21,"updated":"2016-08-25 00:54:28.000000000","message":"you should expand why you left them behind in a devref.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"82bbbc61ecdcf0b9c0dbd4fbdfe25066d5845ddf","unresolved":false,"context_lines":[{"line_number":20,"context_line":"This patch removes them from the API layer except for on"},{"line_number":21,"context_line":"show and index since they are idempotent operations and"},{"line_number":22,"context_line":"moves them down to the plugins under a new decorator called"},{"line_number":23,"context_line":"\u0027retry_idempotent\u0027 which ensures two things. First, operations"},{"line_number":24,"context_line":"are only retried if they are not in an active transaction."},{"line_number":25,"context_line":"Second, the args and kwargs of the method are automatically"},{"line_number":26,"context_line":"deep copied to ensure that any mangling the method does to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"fa7ab95a_4fdc84e4","line":23,"updated":"2016-08-27 06:37:06.000000000","message":"We can\u0027t be sure. We could go around and apply them to everything that talks to the DB, but that would be excessive because many DB things are only called from inside of other DB things.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":20,"context_line":"This patch removes them from the API layer except for on"},{"line_number":21,"context_line":"show and index since they are idempotent operations and"},{"line_number":22,"context_line":"moves them down to the plugins under a new decorator called"},{"line_number":23,"context_line":"\u0027retry_idempotent\u0027 which ensures two things. First, operations"},{"line_number":24,"context_line":"are only retried if they are not in an active transaction."},{"line_number":25,"context_line":"Second, the args and kwargs of the method are automatically"},{"line_number":26,"context_line":"deep copied to ensure that any mangling the method does to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"1ac06dbe_ba1f4c08","line":23,"updated":"2016-08-25 00:54:28.000000000","message":"changed the decorator name.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2fe38b2a637b776146a6c5dddf4d7132d7029364","unresolved":false,"context_lines":[{"line_number":20,"context_line":"This patch removes them from the API layer except for on"},{"line_number":21,"context_line":"show and index since they are idempotent operations and"},{"line_number":22,"context_line":"moves them down to the plugins under a new decorator called"},{"line_number":23,"context_line":"\u0027retry_idempotent\u0027 which ensures two things. First, operations"},{"line_number":24,"context_line":"are only retried if they are not in an active transaction."},{"line_number":25,"context_line":"Second, the args and kwargs of the method are automatically"},{"line_number":26,"context_line":"deep copied to ensure that any mangling the method does to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"1ac06dbe_0ad39639","line":23,"in_reply_to":"1ac06dbe_ba1f4c08","updated":"2016-08-25 10:04:55.000000000","message":"Are we sure we have decorated all the methods that need decorating? How can we determine this? Can it be determined with a tool?","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":24,"context_line":"are only retried if they are not in an active transaction."},{"line_number":25,"context_line":"Second, the args and kwargs of the method are automatically"},{"line_number":26,"context_line":"deep copied to ensure that any mangling the method does to"},{"line_number":27,"context_line":"its arguments don\u0027t impact its retriability."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Closes-Bug: #1612798"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"1ac06dbe_19c4ad90","line":27,"updated":"2016-08-25 00:54:28.000000000","message":"I think we should document the following:\n\na) using the decorators in RPC handlers\nb) using decorators on already decorated methods\nc) choosing retry_db_errors over retry_if_inactive\nd) use of retry_db_errors over oslo\u0027s version\n\nAnything else comes to mind?","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"8a38a0791f9b048f671bda076f5cd019953169fb","unresolved":false,"context_lines":[{"line_number":24,"context_line":"are only retried if they are not in an active transaction."},{"line_number":25,"context_line":"Second, the args and kwargs of the method are automatically"},{"line_number":26,"context_line":"deep copied to ensure that any mangling the method does to"},{"line_number":27,"context_line":"its arguments don\u0027t impact its retriability."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Closes-Bug: #1612798"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"fa7ab95a_cf95f4e4","line":27,"updated":"2016-08-27 06:41:10.000000000","message":"That sounds exhausting. Perhaps I should just abandon this and we can limp along the current approach...","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2fe38b2a637b776146a6c5dddf4d7132d7029364","unresolved":false,"context_lines":[{"line_number":24,"context_line":"are only retried if they are not in an active transaction."},{"line_number":25,"context_line":"Second, the args and kwargs of the method are automatically"},{"line_number":26,"context_line":"deep copied to ensure that any mangling the method does to"},{"line_number":27,"context_line":"its arguments don\u0027t impact its retriability."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Closes-Bug: #1612798"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"1ac06dbe_8ace6681","line":27,"in_reply_to":"1ac06dbe_19c4ad90","updated":"2016-08-25 10:04:55.000000000","message":"How to determine if a method needs decorating.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"46fb69821f7b9692db229f6bff23131dd6d7f7dd","unresolved":false,"context_lines":[{"line_number":24,"context_line":"are only retried if they are not in an active transaction."},{"line_number":25,"context_line":"Second, the args and kwargs of the method are automatically"},{"line_number":26,"context_line":"deep copied to ensure that any mangling the method does to"},{"line_number":27,"context_line":"its arguments don\u0027t impact its retriability."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Closes-Bug: #1612798"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"fa7ab95a_b80a6a88","line":27,"in_reply_to":"1ac06dbe_19c4ad90","updated":"2016-08-29 20:02:16.000000000","message":"e) decorators to callbacks.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d3617b20a72f96d03830573e90b7dbe3059411b6","unresolved":false,"context_lines":[{"line_number":24,"context_line":"are only retried if they are not in an active transaction."},{"line_number":25,"context_line":"Second, the args and kwargs of the method are automatically"},{"line_number":26,"context_line":"deep copied to ensure that any mangling the method does to"},{"line_number":27,"context_line":"its arguments don\u0027t impact its retriability."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Closes-Bug: #1612798"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"fa7ab95a_d8572e58","line":27,"in_reply_to":"fa7ab95a_b80a6a88","updated":"2016-08-29 20:04:47.000000000","message":"The existing approach is not viable, we have sprinkled the decorators over time so it\u0027s not a greal deal of difference from what we\u0027re doing here.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"a4b57fecd026fdfc14c62c9f47cfde11f47c999a","unresolved":false,"context_lines":[{"line_number":24,"context_line":"are only retried if they are not in an active transaction."},{"line_number":25,"context_line":"Second, the args and kwargs of the method are automatically"},{"line_number":26,"context_line":"deep copied to ensure that any mangling the method does to"},{"line_number":27,"context_line":"its arguments don\u0027t impact its retriability."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Closes-Bug: #1612798"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"fa7ab95a_65ab27d7","line":27,"in_reply_to":"fa7ab95a_cf95f4e4","updated":"2016-08-27 08:56:43.000000000","message":"I just don\u0027t want to get point where you are the only one who understands this. It doesn\u0027t have to land with this patch, and I am willing to write most of it. I think that would be a good way for me to get familiar with the details, but I will need to pester you for information.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3c72403b7707eed19c8bde9ef7aafbb523bb8110","unresolved":false,"context_lines":[{"line_number":27,"context_line":"deep copied in retries to ensure that any mangling the methods"},{"line_number":28,"context_line":"do to their arguments don\u0027t impact their retriability."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"Finally, since we are leaving the API decorators in place for now,"},{"line_number":31,"context_line":"the retry logic will not be triggered by another decorator if an"},{"line_number":32,"context_line":"exception has already been retried. This prevents an exponential"},{"line_number":33,"context_line":"explosion of retries on nested retry decorators."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"9a89bdaa_b840cd35","line":30,"updated":"2016-09-06 22:43:14.000000000","message":"what about the DB operations that are part of the RPC mixins, why did you choose not to protect them?","commit_id":"5cfd07c7b37ea7502bbd987c076fb1d72f1a2ffd"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e9d547dcddaff58dd5800f63855c9936a9c2d530","unresolved":false,"context_lines":[{"line_number":27,"context_line":"deep copied in retries to ensure that any mangling the methods"},{"line_number":28,"context_line":"do to their arguments don\u0027t impact their retriability."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"Finally, since we are leaving the API decorators in place for now,"},{"line_number":31,"context_line":"the retry logic will not be triggered by another decorator if an"},{"line_number":32,"context_line":"exception has already been retried. This prevents an exponential"},{"line_number":33,"context_line":"explosion of retries on nested retry decorators."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"9a89bdaa_e1b29893","line":30,"in_reply_to":"9a89bdaa_b840cd35","updated":"2016-09-07 07:32:42.000000000","message":"I forgot them. Let me try to get them on the next respin.","commit_id":"5cfd07c7b37ea7502bbd987c076fb1d72f1a2ffd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"90a9b5be8a779a590e5eb0599741aca595aaa0fc","unresolved":false,"context_lines":[{"line_number":35,"context_line":"The ultimate goal will be to get rid of the API decorators entirely"},{"line_number":36,"context_line":"so retries are up to each individual plugin."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"Closes-Bug: #1596075"},{"line_number":39,"context_line":"Closes-Bug: #1612798"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"(second commit squashed into this one for gate relief)"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"9a89bdaa_382d9d95","line":38,"updated":"2016-09-06 22:42:18.000000000","message":"I suppose we need to follow up with the removal of the decorators from the API layer, at which point each plugin, service plugins included, will have to follow up.\n\nI\u0027d be a lot happier if we added a devref associated with this patch, but since you seem to be deaf to this request of mine, I\u0027ll be posting a follow up. I would like to block this one until doc is in place.","commit_id":"5cfd07c7b37ea7502bbd987c076fb1d72f1a2ffd"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e9d547dcddaff58dd5800f63855c9936a9c2d530","unresolved":false,"context_lines":[{"line_number":35,"context_line":"The ultimate goal will be to get rid of the API decorators entirely"},{"line_number":36,"context_line":"so retries are up to each individual plugin."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"Closes-Bug: #1596075"},{"line_number":39,"context_line":"Closes-Bug: #1612798"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"(second commit squashed into this one for gate relief)"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"9a89bdaa_418fc4cb","line":38,"in_reply_to":"9a89bdaa_382d9d95","updated":"2016-09-07 07:32:42.000000000","message":"Removal I think will have to wait until next cycle since we are so close to the end with out of tree service plugins and core plugins.","commit_id":"5cfd07c7b37ea7502bbd987c076fb1d72f1a2ffd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b5b8488f2497f82a11162df1c982e229ca83c9d8","unresolved":false,"context_lines":[{"line_number":18,"context_line":"fatal exceptions on failures of core plugin calls."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"This patch begins the process of moving them down to the"},{"line_number":21,"context_line":"core operations with a new decorator called"},{"line_number":22,"context_line":"\u0027retry_if_session_inactive\u0027, which ensures that the"},{"line_number":23,"context_line":"retry logic isn\u0027t triggered if there is an ongoing transaction"},{"line_number":24,"context_line":"since retrying inside of a transaction is normally ineffective."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"9a89bdaa_597bf97a","line":21,"updated":"2016-09-08 06:36:00.000000000","message":"my suggestion would be to make this about ML2 and L3 and the mixins associated with them. We can look at addressing the service plugins individually.","commit_id":"5a18f774d7043e256b4b95bd6118c42f25ee16bd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b5b8488f2497f82a11162df1c982e229ca83c9d8","unresolved":false,"context_lines":[{"line_number":21,"context_line":"core operations with a new decorator called"},{"line_number":22,"context_line":"\u0027retry_if_session_inactive\u0027, which ensures that the"},{"line_number":23,"context_line":"retry logic isn\u0027t triggered if there is an ongoing transaction"},{"line_number":24,"context_line":"since retrying inside of a transaction is normally ineffective."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Additionally, the args and kwargs of the method are automatically"},{"line_number":27,"context_line":"deep copied in retries to ensure that any mangling the methods"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"9a89bdaa_f945ad42","line":24,"updated":"2016-09-08 06:36:00.000000000","message":"weren\u0027t you going to get rid of the deepcopies that were no longer necessary?","commit_id":"5a18f774d7043e256b4b95bd6118c42f25ee16bd"}],"doc/source/devref/retries.rst":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b5b8488f2497f82a11162df1c982e229ca83c9d8","unresolved":false,"context_lines":[{"line_number":45,"context_line":"it encounters an exception so its safe to retry the operation. So if a"},{"line_number":46,"context_line":"function creates a DB object, commits, then creates another, the function"},{"line_number":47,"context_line":"must have a cleanup handler to remove the first DB object in the case that"},{"line_number":48,"context_line":"the second one fails. Assume any DB operation can throw a retriable error."},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"You may see some retry decorators at the API layers in Neutron; however,"},{"line_number":51,"context_line":"we are trying to eliminate them because each API operation has many"}],"source_content_type":"text/x-rst","patch_set":19,"id":"9a89bdaa_950aa788","line":48,"updated":"2016-09-08 06:36:00.000000000","message":"That is required unless the method being decorated itself performs DB operations in a single transaction block, in which case a rollback is automatically performed.","commit_id":"5a18f774d7043e256b4b95bd6118c42f25ee16bd"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"973d0b298bea8852b33750ecfb21874dabc4d8db","unresolved":false,"context_lines":[{"line_number":45,"context_line":"it encounters an exception so its safe to retry the operation. So if a"},{"line_number":46,"context_line":"function creates a DB object, commits, then creates another, the function"},{"line_number":47,"context_line":"must have a cleanup handler to remove the first DB object in the case that"},{"line_number":48,"context_line":"the second one fails. Assume any DB operation can throw a retriable error."},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"You may see some retry decorators at the API layers in Neutron; however,"},{"line_number":51,"context_line":"we are trying to eliminate them because each API operation has many"}],"source_content_type":"text/x-rst","patch_set":19,"id":"9a89bdaa_1cbddfd7","line":48,"in_reply_to":"9a89bdaa_950aa788","updated":"2016-09-08 07:04:05.000000000","message":"well then it wouldn\u0027t be committing after the first one!","commit_id":"5a18f774d7043e256b4b95bd6118c42f25ee16bd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b5b8488f2497f82a11162df1c982e229ca83c9d8","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":"  # sample usage when session is attached to a var other than \u0027context\u0027"},{"line_number":169,"context_line":"  @db_api.retry_if_session_inactive(context_var_name\u003d\u0027ctx\u0027)"},{"line_number":170,"context_line":"  def some_function(ctx):"},{"line_number":171,"context_line":"      ..."}],"source_content_type":"text/x-rst","patch_set":19,"id":"9a89bdaa_39539518","line":170,"updated":"2016-09-08 06:36:00.000000000","message":"Can we spell some words of wisdom here by advising people to design methods in such a way that the ones being decorated are just the ones that implemented a DB transactional block? This way, there\u0027s no need to implement a rollback during business logic.","commit_id":"5a18f774d7043e256b4b95bd6118c42f25ee16bd"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"973d0b298bea8852b33750ecfb21874dabc4d8db","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":"  # sample usage when session is attached to a var other than \u0027context\u0027"},{"line_number":169,"context_line":"  @db_api.retry_if_session_inactive(context_var_name\u003d\u0027ctx\u0027)"},{"line_number":170,"context_line":"  def some_function(ctx):"},{"line_number":171,"context_line":"      ..."}],"source_content_type":"text/x-rst","patch_set":19,"id":"9a89bdaa_9c980f7a","line":170,"in_reply_to":"9a89bdaa_39539518","updated":"2016-09-08 07:04:05.000000000","message":"No, because I think you should always try to rollback if you\u0027ve done something :)","commit_id":"5a18f774d7043e256b4b95bd6118c42f25ee16bd"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"b74164340ab8ab1a06d1ba133fe739f19c430e06","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Retrying Operations"},{"line_number":25,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Inside of the neutron.db.api module there is a decorator called"},{"line_number":28,"context_line":"\u0027retry_if_session_inactive\u0027. This should be used to protect any"}],"source_content_type":"text/x-rst","patch_set":20,"id":"9a89bdaa_8c461479","line":25,"updated":"2016-09-08 11:12:51.000000000","message":"Can you add some words on when/how/why to use @retry_db_errors?","commit_id":"aac250ed40d43d6edc29da1555a9e6b21de5c376"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ba904003676feafac81d135b4d68167a909dc01a","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Retrying Operations"},{"line_number":25,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Inside of the neutron.db.api module there is a decorator called"},{"line_number":28,"context_line":"\u0027retry_if_session_inactive\u0027. This should be used to protect any"}],"source_content_type":"text/x-rst","patch_set":20,"id":"9a89bdaa_d7a7c0a4","line":25,"in_reply_to":"9a89bdaa_8c461479","updated":"2016-09-08 12:34:09.000000000","message":"Done","commit_id":"aac250ed40d43d6edc29da1555a9e6b21de5c376"}],"neutron/api/rpc/handlers/dhcp_rpc.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b14d415fc0e1411edd1462ae686f409de13fa382","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        host \u003d kwargs.get(\u0027host\u0027)"},{"line_number":241,"context_line":"        # Note(pbondar): Create deep copy of port to prevent operating"},{"line_number":242,"context_line":"        # on changed dict if RetryRequest is raised"},{"line_number":243,"context_line":"        port \u003d copy.deepcopy(kwargs.get(\u0027port\u0027))"},{"line_number":244,"context_line":"        LOG.debug(\u0027Create dhcp port %(port)s \u0027"},{"line_number":245,"context_line":"                  \u0027from %(host)s.\u0027,"},{"line_number":246,"context_line":"                  {\u0027port\u0027: port,"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_d14dee9a","side":"PARENT","line":243,"updated":"2016-08-31 02:05:52.000000000","message":"these deepcopy are no longer needed.","commit_id":"11849b7279c5e7afe686fab6f4b21ce6f7366c14"}],"neutron/api/v2/base.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                except oslo_policy.PolicyNotAuthorized:"},{"line_number":204,"context_line":"                    msg \u003d _(\u0027The resource could not be found.\u0027)"},{"line_number":205,"context_line":"                    raise webob.exc.HTTPNotFound(msg)"},{"line_number":206,"context_line":"                body \u003d copy.deepcopy(kwargs.pop(\u0027body\u0027, None))"},{"line_number":207,"context_line":"                # Explicit comparison with None to distinguish from {}"},{"line_number":208,"context_line":"                if body is not None:"},{"line_number":209,"context_line":"                    arg_list.append(body)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_2549d3d0","line":206,"updated":"2016-08-23 22:08:21.000000000","message":"Done","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d01f20bd9a0320539d69d6456d75cf41bcc1877e","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                except oslo_policy.PolicyNotAuthorized:"},{"line_number":204,"context_line":"                    msg \u003d _(\u0027The resource could not be found.\u0027)"},{"line_number":205,"context_line":"                    raise webob.exc.HTTPNotFound(msg)"},{"line_number":206,"context_line":"                body \u003d copy.deepcopy(kwargs.pop(\u0027body\u0027, None))"},{"line_number":207,"context_line":"                # Explicit comparison with None to distinguish from {}"},{"line_number":208,"context_line":"                if body is not None:"},{"line_number":209,"context_line":"                    arg_list.append(body)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_5d81568e","line":206,"updated":"2016-08-23 17:24:07.000000000","message":"can we get rid of this deepcopy now?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":399,"context_line":"        \"\"\"Creates a new instance of the requested entity.\"\"\""},{"line_number":400,"context_line":"        parent_id \u003d kwargs.get(self._parent_id_name)"},{"line_number":401,"context_line":"        body \u003d Controller.prepare_request_body(request.context,"},{"line_number":402,"context_line":"                                               copy.deepcopy(body), True,"},{"line_number":403,"context_line":"                                               self._resource, self._attr_info,"},{"line_number":404,"context_line":"                                               allow_bulk\u003dself._allow_bulk)"},{"line_number":405,"context_line":"        action \u003d self._plugin_handlers[self.CREATE]"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_054497b4","line":402,"updated":"2016-08-23 22:08:21.000000000","message":"Done","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d01f20bd9a0320539d69d6456d75cf41bcc1877e","unresolved":false,"context_lines":[{"line_number":399,"context_line":"        \"\"\"Creates a new instance of the requested entity.\"\"\""},{"line_number":400,"context_line":"        parent_id \u003d kwargs.get(self._parent_id_name)"},{"line_number":401,"context_line":"        body \u003d Controller.prepare_request_body(request.context,"},{"line_number":402,"context_line":"                                               copy.deepcopy(body), True,"},{"line_number":403,"context_line":"                                               self._resource, self._attr_info,"},{"line_number":404,"context_line":"                                               allow_bulk\u003dself._allow_bulk)"},{"line_number":405,"context_line":"        action \u003d self._plugin_handlers[self.CREATE]"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_1d587e87","line":402,"updated":"2016-08-23 17:24:07.000000000","message":"we can get rid of this deepcopy now can\u0027t we?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":569,"context_line":""},{"line_number":570,"context_line":"    def _update(self, request, id, body, **kwargs):"},{"line_number":571,"context_line":"        body \u003d Controller.prepare_request_body(request.context,"},{"line_number":572,"context_line":"                                               copy.deepcopy(body), False,"},{"line_number":573,"context_line":"                                               self._resource, self._attr_info,"},{"line_number":574,"context_line":"                                               allow_bulk\u003dself._allow_bulk)"},{"line_number":575,"context_line":"        action \u003d self._plugin_handlers[self.UPDATE]"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_65158b9a","line":572,"updated":"2016-08-23 22:08:21.000000000","message":"Done","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d01f20bd9a0320539d69d6456d75cf41bcc1877e","unresolved":false,"context_lines":[{"line_number":569,"context_line":""},{"line_number":570,"context_line":"    def _update(self, request, id, body, **kwargs):"},{"line_number":571,"context_line":"        body \u003d Controller.prepare_request_body(request.context,"},{"line_number":572,"context_line":"                                               copy.deepcopy(body), False,"},{"line_number":573,"context_line":"                                               self._resource, self._attr_info,"},{"line_number":574,"context_line":"                                               allow_bulk\u003dself._allow_bulk)"},{"line_number":575,"context_line":"        action \u003d self._plugin_handlers[self.UPDATE]"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_9dcaae19","line":572,"updated":"2016-08-23 17:24:07.000000000","message":"ditto","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"}],"neutron/db/api.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    def wrapped(*args, **kwargs):"},{"line_number":82,"context_line":"        try:"},{"line_number":83,"context_line":"            # copy mutable args and kwargs to make retries safe. this doesn\u0027t"},{"line_number":84,"context_line":"            # prevent mutations of complex objects like the context"},{"line_number":85,"context_line":"            dup_args \u003d [_copy_if_ld(a) for a in args]"},{"line_number":86,"context_line":"            dup_kwargs \u003d {k: _copy_if_ld(v) for k, v in kwargs.items()}"},{"line_number":87,"context_line":"            return f(*dup_args, **dup_kwargs)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_a582e3c5","line":84,"updated":"2016-08-23 22:08:21.000000000","message":"Done","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d01f20bd9a0320539d69d6456d75cf41bcc1877e","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    def wrapped(*args, **kwargs):"},{"line_number":82,"context_line":"        try:"},{"line_number":83,"context_line":"            # copy mutable args and kwargs to make retries safe. this doesn\u0027t"},{"line_number":84,"context_line":"            # prevent mutations of complex objects like the context"},{"line_number":85,"context_line":"            dup_args \u003d [_copy_if_ld(a) for a in args]"},{"line_number":86,"context_line":"            dup_kwargs \u003d {k: _copy_if_ld(v) for k, v in kwargs.items()}"},{"line_number":87,"context_line":"            return f(*dup_args, **dup_kwargs)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_9853dc16","line":84,"updated":"2016-08-23 17:24:07.000000000","message":"or self (being the plugin)","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    return wrapped"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def retry_idempotent(f):"},{"line_number":97,"context_line":"    \"\"\"Retries if context is inactive.\"\"\""},{"line_number":98,"context_line":"    @six.wraps(f)"},{"line_number":99,"context_line":"    def wrapped(self, context, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_858527d0","line":96,"updated":"2016-08-23 22:08:21.000000000","message":"Done","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d01f20bd9a0320539d69d6456d75cf41bcc1877e","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    return wrapped"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def retry_idempotent(f):"},{"line_number":97,"context_line":"    \"\"\"Retries if context is inactive.\"\"\""},{"line_number":98,"context_line":"    @six.wraps(f)"},{"line_number":99,"context_line":"    def wrapped(self, context, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_d8cc34bd","line":96,"updated":"2016-08-23 17:24:07.000000000","message":"I wonder if retry_if_inactive_session is more appropriate.","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def retry_idempotent(f):"},{"line_number":97,"context_line":"    \"\"\"Retries if context is inactive.\"\"\""},{"line_number":98,"context_line":"    @six.wraps(f)"},{"line_number":99,"context_line":"    def wrapped(self, context, *args, **kwargs):"},{"line_number":100,"context_line":"        # only use retry wrapper if we aren\u0027t nested in an active"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_e5705b0d","line":97,"updated":"2016-08-23 22:08:21.000000000","message":"Done","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d01f20bd9a0320539d69d6456d75cf41bcc1877e","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def retry_idempotent(f):"},{"line_number":97,"context_line":"    \"\"\"Retries if context is inactive.\"\"\""},{"line_number":98,"context_line":"    @six.wraps(f)"},{"line_number":99,"context_line":"    def wrapped(self, context, *args, **kwargs):"},{"line_number":100,"context_line":"        # only use retry wrapper if we aren\u0027t nested in an active"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_98a11cfb","line":97,"updated":"2016-08-23 17:24:07.000000000","message":"should we add that this decorator applies cleanly only for methods that do have the form:\n\n def foo(self, context, ...)?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2fe38b2a637b776146a6c5dddf4d7132d7029364","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"def _copy_if_ld(item):"},{"line_number":72,"context_line":"    \"\"\"Deepcopy lists and dicts, leave everything else alone.\"\"\""},{"line_number":73,"context_line":"    return copy.deepcopy(item) if isinstance(item, (list, dict)) else item"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_6a0e8a33","line":72,"updated":"2016-08-25 10:04:55.000000000","message":"Do we need to include sets?","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"82bbbc61ecdcf0b9c0dbd4fbdfe25066d5845ddf","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"def _copy_if_ld(item):"},{"line_number":72,"context_line":"    \"\"\"Deepcopy lists and dicts, leave everything else alone.\"\"\""},{"line_number":73,"context_line":"    return copy.deepcopy(item) if isinstance(item, (list, dict)) else item"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_6fd788bf","line":72,"updated":"2016-08-27 06:37:06.000000000","message":"Probably a good idea.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":96,"context_line":"def retry_if_session_inactive(f):"},{"line_number":97,"context_line":"    \"\"\"Retries if context.session is inactive."},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    This decorator is only mean to be applied to bound methods that have the"},{"line_number":100,"context_line":"    signature \u0027function(self, context, ...)\u0027."},{"line_number":101,"context_line":"    \"\"\""},{"line_number":102,"context_line":"    @six.wraps(f)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_7aaf947d","line":99,"updated":"2016-08-25 00:54:28.000000000","message":"meant","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"90a9b5be8a779a590e5eb0599741aca595aaa0fc","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def is_retriable(e):"},{"line_number":54,"context_line":"    if getattr(e, \u0027_no_retry\u0027, False):"},{"line_number":55,"context_line":"        return False"},{"line_number":56,"context_line":"    if _is_nested_instance(e, (db_exc.DBDeadlock, exc.StaleDataError,"},{"line_number":57,"context_line":"                               db_exc.DBConnectionError,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_b5d0d8f7","line":54,"updated":"2016-09-06 22:42:18.000000000","message":"should be more aptly named \u0027can_be_retried\u0027 or \u0027already_retried\u0027?","commit_id":"5cfd07c7b37ea7502bbd987c076fb1d72f1a2ffd"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e9d547dcddaff58dd5800f63855c9936a9c2d530","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def is_retriable(e):"},{"line_number":54,"context_line":"    if getattr(e, \u0027_no_retry\u0027, False):"},{"line_number":55,"context_line":"        return False"},{"line_number":56,"context_line":"    if _is_nested_instance(e, (db_exc.DBDeadlock, exc.StaleDataError,"},{"line_number":57,"context_line":"                               db_exc.DBConnectionError,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_41a6e453","line":54,"in_reply_to":"9a89bdaa_b5d0d8f7","updated":"2016-09-07 07:32:42.000000000","message":"Done","commit_id":"5cfd07c7b37ea7502bbd987c076fb1d72f1a2ffd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"90a9b5be8a779a590e5eb0599741aca595aaa0fc","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"def retry_if_session_inactive(context_var_name\u003d\u0027context\u0027):"},{"line_number":118,"context_line":"    \"\"\"Retries if context.session is inactive."},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    Calls a retry_db_errors wrapped version of the function if the context\u0027s"},{"line_number":121,"context_line":"    session passed in is inactive, otherwise it just calls the function"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_152d04fe","line":118,"updated":"2016-09-06 22:42:18.000000000","message":"nit: Retry only if the session is inactive.","commit_id":"5cfd07c7b37ea7502bbd987c076fb1d72f1a2ffd"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e9d547dcddaff58dd5800f63855c9936a9c2d530","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"def retry_if_session_inactive(context_var_name\u003d\u0027context\u0027):"},{"line_number":118,"context_line":"    \"\"\"Retries if context.session is inactive."},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    Calls a retry_db_errors wrapped version of the function if the context\u0027s"},{"line_number":121,"context_line":"    session passed in is inactive, otherwise it just calls the function"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_8151cc38","line":118,"in_reply_to":"9a89bdaa_152d04fe","updated":"2016-09-07 07:32:42.000000000","message":"Done","commit_id":"5cfd07c7b37ea7502bbd987c076fb1d72f1a2ffd"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"b74164340ab8ab1a06d1ba133fe739f19c430e06","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def retry_db_errors(f):"},{"line_number":97,"context_line":"    \"\"\"Log retriable exceptions before retry to help debugging.\"\"\""},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @_tag_retriables_as_unretriable"},{"line_number":100,"context_line":"    @_retry_db_errors"}],"source_content_type":"text/x-python","patch_set":20,"id":"9a89bdaa_4ccdec2f","line":97,"updated":"2016-09-08 11:12:51.000000000","message":"It does just a little more than this. :)","commit_id":"aac250ed40d43d6edc29da1555a9e6b21de5c376"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ba904003676feafac81d135b4d68167a909dc01a","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def retry_db_errors(f):"},{"line_number":97,"context_line":"    \"\"\"Log retriable exceptions before retry to help debugging.\"\"\""},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @_tag_retriables_as_unretriable"},{"line_number":100,"context_line":"    @_retry_db_errors"}],"source_content_type":"text/x-python","patch_set":20,"id":"9a89bdaa_f733e411","line":97,"in_reply_to":"9a89bdaa_4ccdec2f","updated":"2016-09-08 12:34:09.000000000","message":"Done","commit_id":"aac250ed40d43d6edc29da1555a9e6b21de5c376"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"284e1912aac5c7408700b409cb99a9876bb90f7c","unresolved":false,"context_lines":[{"line_number":124,"context_line":"    return wrapped"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"def retry_if_session_inactive(context_var_name\u003d\u0027context\u0027):"},{"line_number":128,"context_line":"    \"\"\"Retries only if the session in the context is inactive."},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    Calls a retry_db_errors wrapped version of the function if the context\u0027s"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_78c33738","line":127,"updated":"2016-09-08 15:24:27.000000000","message":"at this point I wonder: does it make sense to keep this decorator? What if we fold this into retry_db_errors instead?","commit_id":"f03f2463bbb8dc0ce8895695a675fc9a77c63106"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d1663df16459775c9dfe3b5bc975eedbfba8e803","unresolved":false,"context_lines":[{"line_number":124,"context_line":"    return wrapped"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"def retry_if_session_inactive(context_var_name\u003d\u0027context\u0027):"},{"line_number":128,"context_line":"    \"\"\"Retries only if the session in the context is inactive."},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    Calls a retry_db_errors wrapped version of the function if the context\u0027s"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_a85c7ff1","line":127,"in_reply_to":"9a89bdaa_65daa219","updated":"2016-09-08 21:18:55.000000000","message":"Ah, I did not notice the added text in the devref, kudos to you.","commit_id":"f03f2463bbb8dc0ce8895695a675fc9a77c63106"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"29c0765d446f11e5858346b51541680c2ba4fbb3","unresolved":false,"context_lines":[{"line_number":124,"context_line":"    return wrapped"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"def retry_if_session_inactive(context_var_name\u003d\u0027context\u0027):"},{"line_number":128,"context_line":"    \"\"\"Retries only if the session in the context is inactive."},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    Calls a retry_db_errors wrapped version of the function if the context\u0027s"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_65daa219","line":127,"in_reply_to":"9a89bdaa_78c33738","updated":"2016-09-08 21:02:10.000000000","message":"Yes, this decorator does all of the session detection stuff and nothing else. So if a function doesn\u0027t have a context, then it uses the one above.","commit_id":"f03f2463bbb8dc0ce8895695a675fc9a77c63106"}],"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"82bbbc61ecdcf0b9c0dbd4fbdfe25066d5845ddf","unresolved":false,"context_lines":[{"line_number":125,"context_line":"    __native_sorting_support \u003d True"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def __init__(self):"},{"line_number":128,"context_line":"        self.set_ipam_backend()"},{"line_number":129,"context_line":"        if cfg.CONF.notify_nova_on_port_status_changes:"},{"line_number":130,"context_line":"            # Import nova conditionally to support the use case of Neutron"},{"line_number":131,"context_line":"            # being used outside of an OpenStack context."}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_4f55644e","line":128,"updated":"2016-08-27 06:37:06.000000000","message":"IPAM is just called in a giant transaction from what I can tell. It can\u0027t retry anything.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":125,"context_line":"    __native_sorting_support \u003d True"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def __init__(self):"},{"line_number":128,"context_line":"        self.set_ipam_backend()"},{"line_number":129,"context_line":"        if cfg.CONF.notify_nova_on_port_status_changes:"},{"line_number":130,"context_line":"            # Import nova conditionally to support the use case of Neutron"},{"line_number":131,"context_line":"            # being used outside of an OpenStack context."}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_d908552b","line":128,"updated":"2016-08-25 00:54:28.000000000","message":"do we need to decorate IPAM\u0027s methods [1]?\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/db/ipam_backend_mixin.py","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"82bbbc61ecdcf0b9c0dbd4fbdfe25066d5845ddf","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            registry.subscribe(self.validate_network_rbac_policy_change,"},{"line_number":145,"context_line":"                               rbac_mixin.RBAC_POLICY, e)"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def validate_network_rbac_policy_change(self, resource, event, trigger,"},{"line_number":148,"context_line":"                                            context, object_type, policy,"},{"line_number":149,"context_line":"                                            **kwargs):"},{"line_number":150,"context_line":"        \"\"\"Validates network RBAC policy changes."}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_6f50685f","line":147,"updated":"2016-08-27 06:37:06.000000000","message":"No. The callbacks can\u0027t be decorated when they are in a precommit phase because the entire thing is happening in an active transaction. We still want the manager to bubble up retriables for the notify caller to capture and retry.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            registry.subscribe(self.validate_network_rbac_policy_change,"},{"line_number":145,"context_line":"                               rbac_mixin.RBAC_POLICY, e)"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def validate_network_rbac_policy_change(self, resource, event, trigger,"},{"line_number":148,"context_line":"                                            context, object_type, policy,"},{"line_number":149,"context_line":"                                            **kwargs):"},{"line_number":150,"context_line":"        \"\"\"Validates network RBAC policy changes."}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_555b8b2e","line":147,"updated":"2016-08-25 00:54:28.000000000","message":"what do we do for callbacks now? The manager had a decorator that made the exception bubble up assuming that the API layer was going to handle the retriable exception, but if that\u0027s no longer the case (as it should) perhaps we need to decorate callbacks too and get rid of [1]\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/callbacks/manager.py#L110","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"82bbbc61ecdcf0b9c0dbd4fbdfe25066d5845ddf","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1227,"context_line":"            self.ipam.delete_port(context, id)"},{"line_number":1228,"context_line":""},{"line_number":1229,"context_line":"    def delete_ports_by_device_id(self, context, device_id, network_id\u003dNone):"},{"line_number":1230,"context_line":"        query \u003d (context.session.query(models_v2.Port.id)"},{"line_number":1231,"context_line":"                 .enable_eagerloads(False)"},{"line_number":1232,"context_line":"                 .filter(models_v2.Port.device_id \u003d\u003d device_id))"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_8f4f6cbc","line":1229,"updated":"2016-08-27 06:37:06.000000000","message":"delete_port itself is protected and this emits a single query outside of a transaction so I think it\u0027s safe from deadlocks.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1227,"context_line":"            self.ipam.delete_port(context, id)"},{"line_number":1228,"context_line":""},{"line_number":1229,"context_line":"    def delete_ports_by_device_id(self, context, device_id, network_id\u003dNone):"},{"line_number":1230,"context_line":"        query \u003d (context.session.query(models_v2.Port.id)"},{"line_number":1231,"context_line":"                 .enable_eagerloads(False)"},{"line_number":1232,"context_line":"                 .filter(models_v2.Port.device_id \u003d\u003d device_id))"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_d58c9b81","line":1229,"updated":"2016-08-25 00:54:28.000000000","message":"this one is invoked by dhcp rpc, that is no longer protected, should this be protected?","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"}],"neutron/db/l3_agentschedulers_db.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                reschedule_resource\u003dself.reschedule_router,"},{"line_number":112,"context_line":"                rescheduling_failed\u003dl3agentscheduler.RouterReschedulingFailed)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def get_down_router_bindings(self, context, agent_dead_limit):"},{"line_number":115,"context_line":"            cutoff \u003d self.get_cutoff_time(agent_dead_limit)"},{"line_number":116,"context_line":"            return (context.session.query(RouterL3AgentBinding)."},{"line_number":117,"context_line":"                    join(agents_db.Agent)."}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_d5513bda","line":114,"updated":"2016-08-25 00:54:28.000000000","message":"what about this one? I suppose if this fails it\u0027s gonna get retried during the next round.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                raise l3agentscheduler.RouterSchedulingFailed("},{"line_number":204,"context_line":"                    router_id\u003drouter_id, agent_id\u003dagent_id)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    def add_router_to_l3_agent(self, context, agent_id, router_id):"},{"line_number":207,"context_line":"        \"\"\"Add a l3 agent to host a router.\"\"\""},{"line_number":208,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":209,"context_line":"            router \u003d self.get_router(context, router_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_35d24f35","line":206,"updated":"2016-08-25 00:54:28.000000000","message":"this is called directly from [1], must ops in [1] be protected now? I suppose they never were and that\u0027s ok because they were never super contentious? What about methods in neutron/scheduler, such as neutron/scheduler/l3_agent_scheduler?\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/extensions/l3agentscheduler.py#L64","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            l3_notifier.router_added_to_agent("},{"line_number":220,"context_line":"                context, [router_id], agent.host)"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    def remove_router_from_l3_agent(self, context, agent_id, router_id):"},{"line_number":223,"context_line":"        \"\"\"Remove the router from l3 agent."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        After removal, the router will be non-hosted until there is update"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_15d75324","line":222,"updated":"2016-08-25 00:54:28.000000000","message":"ditto","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"}],"neutron/db/l3_db.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":210,"context_line":"            self._apply_dict_extend_functions(l3.ROUTERS, res, router)"},{"line_number":211,"context_line":"        return self._fields(res, fields)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def filter_allocating_and_missing_routers(self, context, routers):"},{"line_number":214,"context_line":"        \"\"\"Filter out routers that shouldn\u0027t go to the agent."},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"        Any routers in the ALLOCATING state will be excluded by"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_8537e74b","line":213,"updated":"2016-08-23 22:08:21.000000000","message":"sync_routers already has a decorator on it so this is already covered for now","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"afd98920c419119638fba763b13e4138bc1aca09","unresolved":false,"context_lines":[{"line_number":210,"context_line":"            self._apply_dict_extend_functions(l3.ROUTERS, res, router)"},{"line_number":211,"context_line":"        return self._fields(res, fields)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def filter_allocating_and_missing_routers(self, context, routers):"},{"line_number":214,"context_line":"        \"\"\"Filter out routers that shouldn\u0027t go to the agent."},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"        Any routers in the ALLOCATING state will be excluded by"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_f31f9358","line":213,"range":{"start_line":213,"start_character":8,"end_line":213,"end_character":45},"updated":"2016-08-23 17:38:57.000000000","message":"this one needs a decorator?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"afd98920c419119638fba763b13e4138bc1aca09","unresolved":false,"context_lines":[{"line_number":813,"context_line":"                # Update owner after actual process again in order to"},{"line_number":814,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":815,"context_line":"                # table are consistent."},{"line_number":816,"context_line":"                self._core_plugin.update_port("},{"line_number":817,"context_line":"                    context, port[\u0027id\u0027], {\u0027port\u0027: {"},{"line_number":818,"context_line":"                                         \u0027device_id\u0027: router.id,"},{"line_number":819,"context_line":"                                         \u0027device_owner\u0027: device_owner}})"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_ceeaae73","line":816,"updated":"2016-08-23 17:38:57.000000000","message":"what happens if we decorate a method that uses a decorate method?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"54e23de40953ce6a640f78eecfcc2cf64e96c6e6","unresolved":false,"context_lines":[{"line_number":813,"context_line":"                # Update owner after actual process again in order to"},{"line_number":814,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":815,"context_line":"                # table are consistent."},{"line_number":816,"context_line":"                self._core_plugin.update_port("},{"line_number":817,"context_line":"                    context, port[\u0027id\u0027], {\u0027port\u0027: {"},{"line_number":818,"context_line":"                                         \u0027device_id\u0027: router.id,"},{"line_number":819,"context_line":"                                         \u0027device_owner\u0027: device_owner}})"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_6e2f3aa1","line":816,"in_reply_to":"1ac06dbe_ceeaae73","updated":"2016-08-23 17:50:23.000000000","message":"we should document the expected outcome.","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":1356,"context_line":"                                    marker_obj\u003dmarker_obj,"},{"line_number":1357,"context_line":"                                    page_reverse\u003dpage_reverse)"},{"line_number":1358,"context_line":""},{"line_number":1359,"context_line":"    def delete_disassociated_floatingips(self, context, network_id):"},{"line_number":1360,"context_line":"        query \u003d self._model_query(context, FloatingIP)"},{"line_number":1361,"context_line":"        query \u003d query.filter_by(floating_network_id\u003dnetwork_id,"},{"line_number":1362,"context_line":"                                fixed_port_id\u003dNone,"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_e5421bad","line":1359,"updated":"2016-08-23 22:08:21.000000000","message":"Done","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d01f20bd9a0320539d69d6456d75cf41bcc1877e","unresolved":false,"context_lines":[{"line_number":1356,"context_line":"                                    marker_obj\u003dmarker_obj,"},{"line_number":1357,"context_line":"                                    page_reverse\u003dpage_reverse)"},{"line_number":1358,"context_line":""},{"line_number":1359,"context_line":"    def delete_disassociated_floatingips(self, context, network_id):"},{"line_number":1360,"context_line":"        query \u003d self._model_query(context, FloatingIP)"},{"line_number":1361,"context_line":"        query \u003d query.filter_by(floating_network_id\u003dnetwork_id,"},{"line_number":1362,"context_line":"                                fixed_port_id\u003dNone,"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_d85c347f","line":1359,"updated":"2016-08-23 17:24:07.000000000","message":"what about here?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":1429,"context_line":"        raise n_exc.ServicePortInUse(port_id\u003dport[\u0027id\u0027],"},{"line_number":1430,"context_line":"                                     reason\u003dreason)"},{"line_number":1431,"context_line":""},{"line_number":1432,"context_line":"    def disassociate_floatingips(self, context, port_id, do_notify\u003dTrue):"},{"line_number":1433,"context_line":"        \"\"\"Disassociate all floating IPs linked to specific port."},{"line_number":1434,"context_line":""},{"line_number":1435,"context_line":"        @param port_id: ID of the port to disassociate floating IPs."}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_c53d5f2c","line":1432,"updated":"2016-08-23 22:08:21.000000000","message":"Done","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d01f20bd9a0320539d69d6456d75cf41bcc1877e","unresolved":false,"context_lines":[{"line_number":1429,"context_line":"        raise n_exc.ServicePortInUse(port_id\u003dport[\u0027id\u0027],"},{"line_number":1430,"context_line":"                                     reason\u003dreason)"},{"line_number":1431,"context_line":""},{"line_number":1432,"context_line":"    def disassociate_floatingips(self, context, port_id, do_notify\u003dTrue):"},{"line_number":1433,"context_line":"        \"\"\"Disassociate all floating IPs linked to specific port."},{"line_number":1434,"context_line":""},{"line_number":1435,"context_line":"        @param port_id: ID of the port to disassociate floating IPs."}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_d8a1d447","line":1432,"updated":"2016-08-23 17:24:07.000000000","message":"here?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":426,"context_line":""},{"line_number":427,"context_line":"    # NOTE(yamamoto): This method is an override point for plugins"},{"line_number":428,"context_line":"    # inheriting this class.  Do not optimize this out."},{"line_number":429,"context_line":"    def router_gw_port_has_floating_ips(self, context, router_id):"},{"line_number":430,"context_line":"        \"\"\"Return True if the router\u0027s gateway port is serving floating IPs.\"\"\""},{"line_number":431,"context_line":"        return bool(self.get_floatingips_count(context,"},{"line_number":432,"context_line":"                                               {\u0027router_id\u0027: [router_id]}))"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_b5c91f5d","line":429,"updated":"2016-08-25 00:54:28.000000000","message":"what about this one? The method where it\u0027s used is not protected.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":1004,"context_line":""},{"line_number":1005,"context_line":"    # NOTE(yamamoto): This method is an override point for plugins"},{"line_number":1006,"context_line":"    # inheriting this class.  Do not optimize this out."},{"line_number":1007,"context_line":"    def get_router_for_floatingip(self, context, internal_port,"},{"line_number":1008,"context_line":"                                  internal_subnet, external_network_id):"},{"line_number":1009,"context_line":"        \"\"\"Find a router to handle the floating-ip association."},{"line_number":1010,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_95f4e387","line":1007,"updated":"2016-08-25 00:54:28.000000000","message":"and this one?","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":1685,"context_line":"            floating_ips \u003d self._get_sync_floating_ips(context, router_ids)"},{"line_number":1686,"context_line":"            return (routers, interfaces, floating_ips)"},{"line_number":1687,"context_line":""},{"line_number":1688,"context_line":"    def get_sync_data(self, context, router_ids\u003dNone, active\u003dNone):"},{"line_number":1689,"context_line":"        routers, interfaces, floating_ips \u003d self._get_router_info_list("},{"line_number":1690,"context_line":"            context, router_ids\u003drouter_ids, active\u003dactive)"},{"line_number":1691,"context_line":"        ports_to_populate \u003d [router[\u0027gw_port\u0027] for router in routers"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_f51f17b5","line":1688,"updated":"2016-08-25 00:54:28.000000000","message":"I find it confusing not to have the decorator here but on the L3 RPC module.  We did get rid of them from the DHCP RPC, so what\u0027s the rule?","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"}],"neutron/db/l3_dvr_db.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":305,"context_line":"        floating_ip \u003d fip_qry.filter_by(fixed_port_id\u003dport_id)"},{"line_number":306,"context_line":"        return floating_ip.first()"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    def add_router_interface(self, context, router_id, interface_info):"},{"line_number":309,"context_line":"        add_by_port, add_by_sub \u003d self._validate_interface_info(interface_info)"},{"line_number":310,"context_line":"        router \u003d self._get_router(context, router_id)"},{"line_number":311,"context_line":"        device_owner \u003d self._get_device_owner(context, router)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_e5297be7","line":308,"updated":"2016-08-23 22:08:21.000000000","message":"Done","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"afd98920c419119638fba763b13e4138bc1aca09","unresolved":false,"context_lines":[{"line_number":305,"context_line":"        floating_ip \u003d fip_qry.filter_by(fixed_port_id\u003dport_id)"},{"line_number":306,"context_line":"        return floating_ip.first()"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    def add_router_interface(self, context, router_id, interface_info):"},{"line_number":309,"context_line":"        add_by_port, add_by_sub \u003d self._validate_interface_info(interface_info)"},{"line_number":310,"context_line":"        router \u003d self._get_router(context, router_id)"},{"line_number":311,"context_line":"        device_owner \u003d self._get_device_owner(context, router)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_2ed542e7","line":308,"updated":"2016-08-23 17:38:57.000000000","message":"this needs a decorator?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":473,"context_line":"                    return True"},{"line_number":474,"context_line":"        return False"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    def remove_router_interface(self, context, router_id, interface_info):"},{"line_number":477,"context_line":"        router \u003d self._get_router(context, router_id)"},{"line_number":478,"context_line":"        if not router.extra_attributes.distributed:"},{"line_number":479,"context_line":"            return super("}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_c5243f0e","line":476,"updated":"2016-08-23 22:08:21.000000000","message":"Yeah, we should have it since it\u0027s dealing with DB objects (_get_router response)","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"afd98920c419119638fba763b13e4138bc1aca09","unresolved":false,"context_lines":[{"line_number":473,"context_line":"                    return True"},{"line_number":474,"context_line":"        return False"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    def remove_router_interface(self, context, router_id, interface_info):"},{"line_number":477,"context_line":"        router \u003d self._get_router(context, router_id)"},{"line_number":478,"context_line":"        if not router.extra_attributes.distributed:"},{"line_number":479,"context_line":"            return super("}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_2e4382b3","line":476,"updated":"2016-08-23 17:38:57.000000000","message":"what\u0027s the deal here, I am a bit on the fence.","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"82bbbc61ecdcf0b9c0dbd4fbdfe25066d5845ddf","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                            # with the csnat port."},{"line_number":378,"context_line":"                            # TODO(kevinbenton): switch to taskflow to manage"},{"line_number":379,"context_line":"                            # these rollbacks."},{"line_number":380,"context_line":"                            @db_api.retry_db_errors"},{"line_number":381,"context_line":"                            def revert():"},{"line_number":382,"context_line":"                                # TODO(kevinbenton): even though we get the"},{"line_number":383,"context_line":"                                # port each time, there is a potential race"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_0fd27cd2","line":380,"updated":"2016-08-27 06:37:06.000000000","message":"Yes","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                            # with the csnat port."},{"line_number":378,"context_line":"                            # TODO(kevinbenton): switch to taskflow to manage"},{"line_number":379,"context_line":"                            # these rollbacks."},{"line_number":380,"context_line":"                            @db_api.retry_db_errors"},{"line_number":381,"context_line":"                            def revert():"},{"line_number":382,"context_line":"                                # TODO(kevinbenton): even though we get the"},{"line_number":383,"context_line":"                                # port each time, there is a potential race"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_15647347","line":380,"updated":"2016-08-25 00:54:28.000000000","message":"do we remove this from here?","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                    return True"},{"line_number":475,"context_line":"        return False"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    @db_api.retry_if_session_inactive"},{"line_number":478,"context_line":"    def remove_router_interface(self, context, router_id, interface_info):"},{"line_number":479,"context_line":"        router \u003d self._get_router(context, router_id)"},{"line_number":480,"context_line":"        if not router.extra_attributes.distributed:"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_f5e437ad","line":477,"range":{"start_line":477,"start_character":12,"end_line":477,"end_character":37},"updated":"2016-08-25 00:54:28.000000000","message":"is it okay to decorate a method whose super is already decorated?","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d80dd63e88eeacbdb2c417598dde1d33e889ddd4","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                    return True"},{"line_number":475,"context_line":"        return False"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    @db_api.retry_if_session_inactive"},{"line_number":478,"context_line":"    def remove_router_interface(self, context, router_id, interface_info):"},{"line_number":479,"context_line":"        router \u003d self._get_router(context, router_id)"},{"line_number":480,"context_line":"        if not router.extra_attributes.distributed:"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_6074e79b","line":477,"range":{"start_line":477,"start_character":12,"end_line":477,"end_character":37},"in_reply_to":"1ac06dbe_f5e437ad","updated":"2016-09-01 11:10:09.000000000","message":"it is in follow-up patch. i added protection against nested retries.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"44c374f856e7f52172168d098d63370a66a382be","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                    return True"},{"line_number":475,"context_line":"        return False"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    @db_api.retry_if_session_inactive"},{"line_number":478,"context_line":"    def remove_router_interface(self, context, router_id, interface_info):"},{"line_number":479,"context_line":"        router \u003d self._get_router(context, router_id)"},{"line_number":480,"context_line":"        if not router.extra_attributes.distributed:"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_53ddff12","line":477,"range":{"start_line":477,"start_character":12,"end_line":477,"end_character":37},"in_reply_to":"fa7ab95a_53889f22","updated":"2016-09-01 11:30:32.000000000","message":"oh you mean the next patch set.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2c07468c4a08a169ef62d72b95583be45302434c","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                    return True"},{"line_number":475,"context_line":"        return False"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    @db_api.retry_if_session_inactive"},{"line_number":478,"context_line":"    def remove_router_interface(self, context, router_id, interface_info):"},{"line_number":479,"context_line":"        router \u003d self._get_router(context, router_id)"},{"line_number":480,"context_line":"        if not router.extra_attributes.distributed:"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_53889f22","line":477,"range":{"start_line":477,"start_character":12,"end_line":477,"end_character":37},"in_reply_to":"fa7ab95a_6074e79b","updated":"2016-09-01 11:29:15.000000000","message":"what follow-up patch?","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"}],"neutron/db/l3_hamode_db.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        return ha_network"},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"    def get_number_of_agents_for_scheduling(self, context):"},{"line_number":314,"context_line":"        \"\"\"Return the number of agents on which the router will be scheduled."},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"        Raises an exception if there are not enough agents available to honor"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_2520b3f6","line":313,"updated":"2016-08-23 22:08:21.000000000","message":"i\u0027ll protect get_l3_agents","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"54e23de40953ce6a640f78eecfcc2cf64e96c6e6","unresolved":false,"context_lines":[{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        return ha_network"},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"    def get_number_of_agents_for_scheduling(self, context):"},{"line_number":314,"context_line":"        \"\"\"Return the number of agents on which the router will be scheduled."},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"        Raises an exception if there are not enough agents available to honor"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_693454dd","line":313,"updated":"2016-08-23 17:50:23.000000000","message":"is this needing protection? or we protect the underlying get_l3_agents?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"54e23de40953ce6a640f78eecfcc2cf64e96c6e6","unresolved":false,"context_lines":[{"line_number":494,"context_line":"                    self.delete_router(context, router_dict[\u0027id\u0027])"},{"line_number":495,"context_line":"        return router_dict"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    def _update_router_db(self, context, router_id, data):"},{"line_number":498,"context_line":"        router_db \u003d self._get_router(context, router_id)"},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"        original_distributed_state \u003d router_db.extra_attributes.distributed"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_49b4f833","line":497,"updated":"2016-08-23 17:50:23.000000000","message":"does this need protection now?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":494,"context_line":"                    self.delete_router(context, router_dict[\u0027id\u0027])"},{"line_number":495,"context_line":"        return router_dict"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    def _update_router_db(self, context, router_id, data):"},{"line_number":498,"context_line":"        router_db \u003d self._get_router(context, router_id)"},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"        original_distributed_state \u003d router_db.extra_attributes.distributed"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_051bf7ca","line":497,"updated":"2016-08-23 22:08:21.000000000","message":"no, it\u0027s already called inside of another transaction","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":591,"context_line":"                orm.exc.ObjectDeletedError):"},{"line_number":592,"context_line":"            LOG.debug("},{"line_number":593,"context_line":"                \"HA network for tenant %s was already deleted.\", tenant_id)"},{"line_number":594,"context_line":"        except sa.exc.InvalidRequestError:"},{"line_number":595,"context_line":"            LOG.info(_LI(\"HA network %s can not be deleted.\"),"},{"line_number":596,"context_line":"                     ha_network.network_id)"},{"line_number":597,"context_line":"        except n_exc.NetworkInUse:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_657c6bec","line":594,"updated":"2016-08-23 22:08:21.000000000","message":"Why?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"54e23de40953ce6a640f78eecfcc2cf64e96c6e6","unresolved":false,"context_lines":[{"line_number":591,"context_line":"                orm.exc.ObjectDeletedError):"},{"line_number":592,"context_line":"            LOG.debug("},{"line_number":593,"context_line":"                \"HA network for tenant %s was already deleted.\", tenant_id)"},{"line_number":594,"context_line":"        except sa.exc.InvalidRequestError:"},{"line_number":595,"context_line":"            LOG.info(_LI(\"HA network %s can not be deleted.\"),"},{"line_number":596,"context_line":"                     ha_network.network_id)"},{"line_number":597,"context_line":"        except n_exc.NetworkInUse:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_a99e4cb6","line":594,"updated":"2016-08-23 17:50:23.000000000","message":"would this need revision now?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":625,"context_line":"        for agent in self.get_l3_agents_hosting_routers(context, [router_id]):"},{"line_number":626,"context_line":"            self.remove_router_from_l3_agent(context, agent[\u0027id\u0027], router_id)"},{"line_number":627,"context_line":""},{"line_number":628,"context_line":"    def get_ha_router_port_bindings(self, context, router_ids, host\u003dNone):"},{"line_number":629,"context_line":"        if not router_ids:"},{"line_number":630,"context_line":"            return []"},{"line_number":631,"context_line":"        query \u003d context.session.query(L3HARouterAgentPortBinding)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_457fafdf","line":628,"updated":"2016-08-23 22:08:21.000000000","message":"I think all of the callers of this already are protected (e.g. sync_routers and update_routers_states).","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"54e23de40953ce6a640f78eecfcc2cf64e96c6e6","unresolved":false,"context_lines":[{"line_number":625,"context_line":"        for agent in self.get_l3_agents_hosting_routers(context, [router_id]):"},{"line_number":626,"context_line":"            self.remove_router_from_l3_agent(context, agent[\u0027id\u0027], router_id)"},{"line_number":627,"context_line":""},{"line_number":628,"context_line":"    def get_ha_router_port_bindings(self, context, router_ids, host\u003dNone):"},{"line_number":629,"context_line":"        if not router_ids:"},{"line_number":630,"context_line":"            return []"},{"line_number":631,"context_line":"        query \u003d context.session.query(L3HARouterAgentPortBinding)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_a93acc96","line":628,"updated":"2016-08-23 17:50:23.000000000","message":"what about this one?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2fe38b2a637b776146a6c5dddf4d7132d7029364","unresolved":false,"context_lines":[{"line_number":752,"context_line":"        \"\"\"Receive dict of router ID to state and update them all.\"\"\""},{"line_number":753,"context_line":""},{"line_number":754,"context_line":"        bindings \u003d self.get_ha_router_port_bindings("},{"line_number":755,"context_line":"            context, router_ids\u003dlist(states.keys()), host\u003dhost)"},{"line_number":756,"context_line":"        self._set_router_states(context, bindings, states)"},{"line_number":757,"context_line":"        self._update_router_port_bindings(context, states, host)"},{"line_number":758,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_17829f52","line":755,"range":{"start_line":755,"start_character":32,"end_line":755,"end_character":37},"updated":"2016-08-25 10:04:55.000000000","message":"We should probably note this requirement (can\u0027t pass generators) in the devref.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"}],"neutron/db/provisioning_blocks.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return False"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"@db_api.retry_db_errors"},{"line_number":118,"context_line":"def provisioning_complete(context, object_id, object_type, entity):"},{"line_number":119,"context_line":"    \"\"\"Mark that the provisioning for object_id has been completed by entity."},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_45184fd3","line":117,"updated":"2016-08-23 22:08:21.000000000","message":"I only used this one since the signature didn\u0027t contain \u0027self\u0027.","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"54e23de40953ce6a640f78eecfcc2cf64e96c6e6","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return False"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"@db_api.retry_db_errors"},{"line_number":118,"context_line":"def provisioning_complete(context, object_id, object_type, entity):"},{"line_number":119,"context_line":"    \"\"\"Mark that the provisioning for object_id has been completed by entity."},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_a9a48cb9","line":117,"range":{"start_line":117,"start_character":8,"end_line":117,"end_character":23},"updated":"2016-08-23 17:50:23.000000000","message":"how would one choose between this one and the other decorator? Only if the method implementation is sure to avoid calling into nested transactions? What if the implementation is modified over time and someone forgets?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"82bbbc61ecdcf0b9c0dbd4fbdfe25066d5845ddf","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return False"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"@db_api.retry_db_errors"},{"line_number":118,"context_line":"def provisioning_complete(context, object_id, object_type, entity):"},{"line_number":119,"context_line":"    \"\"\"Mark that the provisioning for object_id has been completed by entity."},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_af4a70aa","line":117,"updated":"2016-08-27 06:37:06.000000000","message":"I only used it because the first argument to this method isn\u0027t \u0027self\u0027","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return False"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"@db_api.retry_db_errors"},{"line_number":118,"context_line":"def provisioning_complete(context, object_id, object_type, entity):"},{"line_number":119,"context_line":"    \"\"\"Mark that the provisioning for object_id has been completed by entity."},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_39b6c93d","line":117,"updated":"2016-08-25 00:54:28.000000000","message":"I suppose this method is designed so that it cannot be called within a transaction and then the use of retry_db_errors rather than retry_if_session_inactive makes sense, shall we make a note of that?","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":153,"context_line":"                        context\u003dcontext, object_id\u003dobject_id)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"def is_object_blocked(context, object_id, object_type):"},{"line_number":157,"context_line":"    \"\"\"Return boolean indicating if object has a provisioning block."},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    :param context: neutron api request context"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_b980f947","line":156,"updated":"2016-08-25 00:54:28.000000000","message":"this is not decorated because it\u0027s within a decorated method already?","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"82bbbc61ecdcf0b9c0dbd4fbdfe25066d5845ddf","unresolved":false,"context_lines":[{"line_number":153,"context_line":"                        context\u003dcontext, object_id\u003dobject_id)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"def is_object_blocked(context, object_id, object_type):"},{"line_number":157,"context_line":"    \"\"\"Return boolean indicating if object has a provisioning block."},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    :param context: neutron api request context"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_cfc7b410","line":156,"updated":"2016-08-27 06:37:06.000000000","message":"yeah","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"}],"neutron/db/quota/driver.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                raise n_exc.TenantQuotaNotFound(tenant_id\u003dtenant_id)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    @staticmethod"},{"line_number":92,"context_line":"    def get_all_quotas(context, resources):"},{"line_number":93,"context_line":"        \"\"\"Given a list of resources, retrieve the quotas for the all tenants."},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        :param context: The request context, for access checks."}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_a50b037c","line":92,"updated":"2016-08-23 22:08:21.000000000","message":"Wasn\u0027t doing non-mutating ops before.","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"54e23de40953ce6a640f78eecfcc2cf64e96c6e6","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                raise n_exc.TenantQuotaNotFound(tenant_id\u003dtenant_id)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    @staticmethod"},{"line_number":92,"context_line":"    def get_all_quotas(context, resources):"},{"line_number":93,"context_line":"        \"\"\"Given a list of resources, retrieve the quotas for the all tenants."},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        :param context: The request context, for access checks."}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_2999bc7c","line":92,"updated":"2016-08-23 17:50:23.000000000","message":"why not here?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"7344e028946ff194d3c095b004ef7857ba5c671a","unresolved":false,"context_lines":[{"line_number":1238,"context_line":"        return result, mech_context"},{"line_number":1239,"context_line":""},{"line_number":1240,"context_line":"    @utils.transaction_guard"},{"line_number":1241,"context_line":"    @db_api.retry_db_errors"},{"line_number":1242,"context_line":"    def create_port(self, context, port):"},{"line_number":1243,"context_line":"        # TODO(kevinbenton): remove when bug/1543094 is fixed."},{"line_number":1244,"context_line":"        with lockutils.lock(port[\u0027port\u0027][\u0027network_id\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_8ea3d1b1","line":1241,"updated":"2016-08-23 01:37:14.000000000","message":"these methods are actually called by service plugins within a transaction.  in that case retrying here won\u0027t work.","commit_id":"4634c132de1e3ef712f1df7d68cb1e309106c7a9"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"50eca075c91efb6f62bb803457d2d68aab3534e2","unresolved":false,"context_lines":[{"line_number":1238,"context_line":"        return result, mech_context"},{"line_number":1239,"context_line":""},{"line_number":1240,"context_line":"    @utils.transaction_guard"},{"line_number":1241,"context_line":"    @db_api.retry_db_errors"},{"line_number":1242,"context_line":"    def create_port(self, context, port):"},{"line_number":1243,"context_line":"        # TODO(kevinbenton): remove when bug/1543094 is fixed."},{"line_number":1244,"context_line":"        with lockutils.lock(port[\u0027port\u0027][\u0027network_id\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_7d51e035","line":1241,"in_reply_to":"1ac06dbe_8ea3d1b1","updated":"2016-08-23 06:58:08.000000000","message":"in latest PS i have made it check if the transaction is active before activating retry logic","commit_id":"4634c132de1e3ef712f1df7d68cb1e309106c7a9"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"075ae88aedf40bf12954505009015d2acf8fb284","unresolved":false,"context_lines":[{"line_number":1748,"context_line":""},{"line_number":1749,"context_line":"        return port[\u0027id\u0027]"},{"line_number":1750,"context_line":""},{"line_number":1751,"context_line":"    def port_bound_to_host(self, context, port_id, host):"},{"line_number":1752,"context_line":"        if not host:"},{"line_number":1753,"context_line":"            return"},{"line_number":1754,"context_line":"        port \u003d db.get_port(context.session, port_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_850ec789","line":1751,"updated":"2016-08-23 22:08:21.000000000","message":"Done","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"54e23de40953ce6a640f78eecfcc2cf64e96c6e6","unresolved":false,"context_lines":[{"line_number":1748,"context_line":""},{"line_number":1749,"context_line":"        return port[\u0027id\u0027]"},{"line_number":1750,"context_line":""},{"line_number":1751,"context_line":"    def port_bound_to_host(self, context, port_id, host):"},{"line_number":1752,"context_line":"        if not host:"},{"line_number":1753,"context_line":"            return"},{"line_number":1754,"context_line":"        port \u003d db.get_port(context.session, port_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ac06dbe_49a87877","line":1751,"updated":"2016-08-23 17:50:23.000000000","message":"don\u0027t we need to protect these that are called from rpc.py?","commit_id":"4384e18974cf53babdaa0be6a30ae14b0dc5ecf1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"82bbbc61ecdcf0b9c0dbd4fbdfe25066d5845ddf","unresolved":false,"context_lines":[{"line_number":760,"context_line":"        return result, mech_context"},{"line_number":761,"context_line":""},{"line_number":762,"context_line":"    @utils.transaction_guard"},{"line_number":763,"context_line":"    @db_api.retry_if_session_inactive"},{"line_number":764,"context_line":"    def create_network(self, context, network):"},{"line_number":765,"context_line":"        result, mech_context \u003d self._create_network_db(context, network)"},{"line_number":766,"context_line":"        kwargs \u003d {\u0027context\u0027: context, \u0027network\u0027: result}"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_efcab819","line":763,"updated":"2016-08-27 06:37:06.000000000","message":"If someone wants to use wrap_db_retry, they could. It just doesn\u0027t have the arg copying or the defaults we use for types of exceptions to catch and backoff timers.","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5f802ec6e776f623228dfb8503c37dd4c7c2b14","unresolved":false,"context_lines":[{"line_number":760,"context_line":"        return result, mech_context"},{"line_number":761,"context_line":""},{"line_number":762,"context_line":"    @utils.transaction_guard"},{"line_number":763,"context_line":"    @db_api.retry_if_session_inactive"},{"line_number":764,"context_line":"    def create_network(self, context, network):"},{"line_number":765,"context_line":"        result, mech_context \u003d self._create_network_db(context, network)"},{"line_number":766,"context_line":"        kwargs \u003d {\u0027context\u0027: context, \u0027network\u0027: result}"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ac06dbe_399c0969","line":763,"updated":"2016-08-25 00:54:28.000000000","message":"what about decorating the methods of the default plugins [1]? For instance [2]. Is wrap_db_retry to be superseded by db_api.retry_db_errors?\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/plugins/common/constants.py#L42\n[2] https://github.com/openstack/neutron/blob/master/neutron/services/tag/tag_plugin.py#L67","commit_id":"ae8c4bde3428f6c220a2bc205cb73626ac81bd2a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"f5017a9858b1344d0c803389653828293b869e6a","unresolved":false,"context_lines":[{"line_number":772,"context_line":"        return result, mech_context"},{"line_number":773,"context_line":""},{"line_number":774,"context_line":"    @utils.transaction_guard"},{"line_number":775,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":776,"context_line":"    def create_network(self, context, network):"},{"line_number":777,"context_line":"        result, mech_context \u003d self._create_network_db(context, network)"},{"line_number":778,"context_line":"        kwargs \u003d {\u0027context\u0027: context, \u0027network\u0027: result}"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_7bdaad4d","line":775,"updated":"2016-09-07 08:56:42.000000000","message":"So we could do something like have the neutron manager auto decorate each plugin method that starts without an underscore. Is that what you mean?\n\nIf not, I don\u0027t see how we wouldn\u0027t end up sprinkling them all over anyway.","commit_id":"5cfd07c7b37ea7502bbd987c076fb1d72f1a2ffd"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"1b2b075c32c20137a32310afcf23f4431bb670b8","unresolved":false,"context_lines":[{"line_number":772,"context_line":"        return result, mech_context"},{"line_number":773,"context_line":""},{"line_number":774,"context_line":"    @utils.transaction_guard"},{"line_number":775,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":776,"context_line":"    def create_network(self, context, network):"},{"line_number":777,"context_line":"        result, mech_context \u003d self._create_network_db(context, network)"},{"line_number":778,"context_line":"        kwargs \u003d {\u0027context\u0027: context, \u0027network\u0027: result}"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_f5532e69","line":775,"updated":"2016-09-07 08:37:04.000000000","message":"i personally prefer having a decorator saying \"this is a plugin entry point\" rather than sprinkling these to specify particular behaviours every places.\nhow do you think?","commit_id":"5cfd07c7b37ea7502bbd987c076fb1d72f1a2ffd"}]}
