)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"376d3e878cab1e7aefc76f135f1ad8e4742ad637","unresolved":false,"context_lines":[{"line_number":10,"context_line":"access might get lost when the driver takes a long time to process"},{"line_number":11,"context_line":"the new rules. This patch fixes this issue by verifying for the"},{"line_number":12,"context_line":"existence of new unprocessed rules at the end of the update_access"},{"line_number":13,"context_line":"method."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I0f863cbae4d8af0660114161deda7bf7aa60d71d"},{"line_number":16,"context_line":"Closes-bug: #1550295"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"3afc51ec_6f4fc492","line":13,"range":{"start_line":13,"start_character":6,"end_line":13,"end_character":7},"updated":"2016-03-13 16:19:56.000000000","message":"There is an APIImpact. Please add the flag here. \n\n\n    APIImpact\n    access_allow action on shares with access_rules_status \u0027out_of_sync\u0027\n    was previously disallowed with HTTPBadRequest. Now, the action is\n    disallowed only for shares with access_rules_status set to \u0027error\u0027.","commit_id":"aca1a8e9974d6c7a556190825772018852f3b18a"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"a8ab999435523c41a52812bfa9fb2fa963c574e4","unresolved":false,"context_lines":[{"line_number":10,"context_line":"access might get lost when the driver takes a long time to process"},{"line_number":11,"context_line":"the new rules. This patch fixes this issue by verifying for the"},{"line_number":12,"context_line":"existence of new unprocessed rules at the end of the update_access"},{"line_number":13,"context_line":"method."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I0f863cbae4d8af0660114161deda7bf7aa60d71d"},{"line_number":16,"context_line":"Closes-bug: #1550295"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"3afc51ec_af8b731d","line":13,"range":{"start_line":13,"start_character":6,"end_line":13,"end_character":7},"in_reply_to":"3afc51ec_6f4fc492","updated":"2016-03-14 12:13:16.000000000","message":"Done","commit_id":"aca1a8e9974d6c7a556190825772018852f3b18a"}],"manila/common/constants.py":[{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"fab969c61937ea960d3d9b1a388fe64d94a90fe0","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    STATUS_MIGRATING, STATUS_MIGRATING_TO,"},{"line_number":82,"context_line":")"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"UPDATING_RULES_STATUES \u003d ("},{"line_number":85,"context_line":"    STATUS_UPDATING,"},{"line_number":86,"context_line":"    STATUS_MULTIPLE_UPDATES,"},{"line_number":87,"context_line":")"}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_92600ed1","line":84,"range":{"start_line":84,"start_character":15,"end_line":84,"end_character":22},"updated":"2016-03-17 20:17:10.000000000","message":"s/STATUES/STATUSES","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"12ddbff7b47fa071181aa9bf2bf583eaf98f6ce6","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    STATUS_MIGRATING, STATUS_MIGRATING_TO,"},{"line_number":82,"context_line":")"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"UPDATING_RULES_STATUES \u003d ("},{"line_number":85,"context_line":"    STATUS_UPDATING,"},{"line_number":86,"context_line":"    STATUS_MULTIPLE_UPDATES,"},{"line_number":87,"context_line":")"}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_6f8bdd68","line":84,"range":{"start_line":84,"start_character":0,"end_line":84,"end_character":22},"updated":"2016-03-17 20:15:07.000000000","message":"typo: STATUSES","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"395c6af57e3ac824db287ae3e2e2607e7f4715b2","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    STATUS_MIGRATING, STATUS_MIGRATING_TO,"},{"line_number":82,"context_line":")"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"UPDATING_RULES_STATUES \u003d ("},{"line_number":85,"context_line":"    STATUS_UPDATING,"},{"line_number":86,"context_line":"    STATUS_MULTIPLE_UPDATES,"},{"line_number":87,"context_line":")"}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_4ff882c3","line":84,"range":{"start_line":84,"start_character":15,"end_line":84,"end_character":22},"in_reply_to":"1af94dfe_92600ed1","updated":"2016-03-18 13:58:14.000000000","message":"Done","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"12ddbff7b47fa071181aa9bf2bf583eaf98f6ce6","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"UPDATING_RULES_STATUES \u003d ("},{"line_number":85,"context_line":"    STATUS_UPDATING,"},{"line_number":86,"context_line":"    STATUS_MULTIPLE_UPDATES,"},{"line_number":87,"context_line":")"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"SUPPORTED_SHARE_PROTOCOLS \u003d ("}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_cfd15159","line":86,"range":{"start_line":86,"start_character":4,"end_line":86,"end_character":28},"updated":"2016-03-17 20:15:07.000000000","message":"I think I would have used an \u0027ING\u0027 suffix like the other transitional values, such as STATUS_UPDATING_MULTIPLE.","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"395c6af57e3ac824db287ae3e2e2607e7f4715b2","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"UPDATING_RULES_STATUES \u003d ("},{"line_number":85,"context_line":"    STATUS_UPDATING,"},{"line_number":86,"context_line":"    STATUS_MULTIPLE_UPDATES,"},{"line_number":87,"context_line":")"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"SUPPORTED_SHARE_PROTOCOLS \u003d ("}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_0f295a37","line":86,"range":{"start_line":86,"start_character":4,"end_line":86,"end_character":28},"in_reply_to":"1af94dfe_cfd15159","updated":"2016-03-18 13:58:14.000000000","message":"Done","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"}],"manila/share/access.py":[{"author":{"_account_id":13998,"name":"Daniel Gonzalez Nothnagel","email":"daniel.gonzalez.nothnagel@sap.com","username":"dgonzalez"},"change_message_id":"5b35f4b8d7851ee94b5d353a825fed9a4c0093ef","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        self._remove_access_rules(context, delete_rules, share_instance[\u0027id\u0027])"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # NOTE(tpsilva): checking for the existence of non processed rules"},{"line_number":105,"context_line":"        rule_ids \u003d [rule[\u0027id\u0027] for rule in rules]"},{"line_number":106,"context_line":"        queried_rules \u003d self.db.share_access_get_all_for_instance("},{"line_number":107,"context_line":"            context, share_instance[\u0027id\u0027])"},{"line_number":108,"context_line":"        new_rules \u003d [rule for rule in queried_rules"}],"source_content_type":"text/x-python","patch_set":3,"id":"7af24918_fc416264","line":105,"range":{"start_line":105,"start_character":19,"end_line":105,"end_character":49},"updated":"2016-03-03 12:35:32.000000000","message":"Just a little optimisation: You could make rule_ids a set instead of a list.\nAs you only use rule_ids for existence checks, a set should be slightly faster than a list.","commit_id":"1dd50810b641e630f7f5654f7f4bd1b9aa8d4052"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"b7e966b0232838485dc22c2e8c90a41222ab9ac3","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        self._remove_access_rules(context, delete_rules, share_instance[\u0027id\u0027])"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # NOTE(tpsilva): checking for the existence of non processed rules"},{"line_number":105,"context_line":"        rule_ids \u003d [rule[\u0027id\u0027] for rule in rules]"},{"line_number":106,"context_line":"        queried_rules \u003d self.db.share_access_get_all_for_instance("},{"line_number":107,"context_line":"            context, share_instance[\u0027id\u0027])"},{"line_number":108,"context_line":"        new_rules \u003d [rule for rule in queried_rules"}],"source_content_type":"text/x-python","patch_set":3,"id":"7af24918_a89b1017","line":105,"range":{"start_line":105,"start_character":19,"end_line":105,"end_character":49},"in_reply_to":"7af24918_fc416264","updated":"2016-03-03 13:33:18.000000000","message":"Done","commit_id":"1dd50810b641e630f7f5654f7f4bd1b9aa8d4052"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"1e53bb0d4a23599f5beb15e149f2f707f9e9866c","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        if remove_rules:"},{"line_number":100,"context_line":"            delete_rules \u003d remove_rules"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        self._remove_access_rules(context, delete_rules, share_instance[\u0027id\u0027])"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # NOTE(tpsilva): checking for the existence of non processed rules"},{"line_number":105,"context_line":"        rule_ids \u003d set([rule[\u0027id\u0027] for rule in rules])"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_9bcc87bc","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":78},"updated":"2016-03-03 19:32:46.000000000","message":"I believe there may still be one problem here. access.update_access always supplies drivers with a parameter \"access_rules\" which contain all rules that should exist in the backend.\nLet\u0027s say we have request #1 to delete an access rule. Rule is deleted from DB right in the end, after driver has deleted it from backend. If before driver is finished deleting the rule, a new request #2 comes and wants to add any other rule. This request will read rules from DB and tell the backend which rules should exist, including the one that is being deleted by the previous request. So request #1 finishes and deletes rule from backend, and request #2 adds it back, but this rule is not in DB, just backend.\n\nI believe this problem would be observable in (and probably only in) drivers that do not use \"add_rules\" and \"delete_rules\", and use only recovery mode.","commit_id":"a661aabebd0ad6798a90fe863daa2c57bf768d00"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"f566b149a223aca4f243e128000c3086d8b0966f","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        if remove_rules:"},{"line_number":100,"context_line":"            delete_rules \u003d remove_rules"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        self._remove_access_rules(context, delete_rules, share_instance[\u0027id\u0027])"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # NOTE(tpsilva): checking for the existence of non processed rules"},{"line_number":105,"context_line":"        rule_ids \u003d set([rule[\u0027id\u0027] for rule in rules])"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_f5545c55","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":78},"in_reply_to":"7af24918_0a6f5cfc","updated":"2016-03-07 18:12:30.000000000","message":"Actually, I changed the implementation for this bug fix and fixed this one as well. Fixed on PS 7.","commit_id":"a661aabebd0ad6798a90fe863daa2c57bf768d00"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"2d2af4e2b038e0d4381707696dbcf68bd92d7e9d","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        if remove_rules:"},{"line_number":100,"context_line":"            delete_rules \u003d remove_rules"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        self._remove_access_rules(context, delete_rules, share_instance[\u0027id\u0027])"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # NOTE(tpsilva): checking for the existence of non processed rules"},{"line_number":105,"context_line":"        rule_ids \u003d set([rule[\u0027id\u0027] for rule in rules])"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_70955531","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":78},"in_reply_to":"7af24918_4dad2287","updated":"2016-03-03 20:09:37.000000000","message":"It in fact will not be queried. It will run as soon as it has free CPU time to run (for example request #1 is waiting for backend\u0027s REST response). \n\nI just reproduced the problem I described. Please consider investigating a possible fix.","commit_id":"a661aabebd0ad6798a90fe863daa2c57bf768d00"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"901d23bbfc7b5dede7c24e19540a620dc2b8b8fb","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        if remove_rules:"},{"line_number":100,"context_line":"            delete_rules \u003d remove_rules"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        self._remove_access_rules(context, delete_rules, share_instance[\u0027id\u0027])"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # NOTE(tpsilva): checking for the existence of non processed rules"},{"line_number":105,"context_line":"        rule_ids \u003d set([rule[\u0027id\u0027] for rule in rules])"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_0a6f5cfc","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":78},"in_reply_to":"7af24918_70955531","updated":"2016-03-04 11:46:00.000000000","message":"I could reproduce as well, but this is out of scope of this bug. Filed another bug on launchpad for this.","commit_id":"a661aabebd0ad6798a90fe863daa2c57bf768d00"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"8758218ad732655c2a1f97cdfac96c92dbcdcc2e","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        if remove_rules:"},{"line_number":100,"context_line":"            delete_rules \u003d remove_rules"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        self._remove_access_rules(context, delete_rules, share_instance[\u0027id\u0027])"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # NOTE(tpsilva): checking for the existence of non processed rules"},{"line_number":105,"context_line":"        rule_ids \u003d set([rule[\u0027id\u0027] for rule in rules])"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_fb702b0d","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":78},"in_reply_to":"7af24918_9bcc87bc","updated":"2016-03-03 19:41:00.000000000","message":"Nevermind, request #2 (allow_access) will not exist because when it is OUT_OF_SYNC they are not processed. This code when running again will fix it.\n\nBut I am concerned that the scenario above is still valid in deny_access, request #2 is processed, reading all rules from DB, and sending the list to drivers which may operate on recovery mode.","commit_id":"a661aabebd0ad6798a90fe863daa2c57bf768d00"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"953abd36df6a41ba56e960e3833fee04adde2d8f","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        if remove_rules:"},{"line_number":100,"context_line":"            delete_rules \u003d remove_rules"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        self._remove_access_rules(context, delete_rules, share_instance[\u0027id\u0027])"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # NOTE(tpsilva): checking for the existence of non processed rules"},{"line_number":105,"context_line":"        rule_ids \u003d set([rule[\u0027id\u0027] for rule in rules])"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_4dad2287","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":78},"in_reply_to":"7af24918_fb702b0d","updated":"2016-03-03 19:53:55.000000000","message":"If request #2 is deny_access, the rpcapi will be called and the request will be queued to be executed after request #1, so this will not be a problem.","commit_id":"a661aabebd0ad6798a90fe863daa2c57bf768d00"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"506ef3e7b90e8458b735dd317fc8affea74d62a8","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # NOTE(tpsilva): checking for the existence of non processed rules"},{"line_number":105,"context_line":"        rule_ids \u003d set([rule[\u0027id\u0027] for rule in rules])"},{"line_number":106,"context_line":"        queried_rules \u003d self.db.share_access_get_all_for_share("},{"line_number":107,"context_line":"            context, share_instance[\u0027share_id\u0027])"},{"line_number":108,"context_line":"        queried_ids \u003d set([rule[\u0027id\u0027] for rule in queried_rules])"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        if rule_ids !\u003d queried_ids:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5aef4532_08924b57","line":107,"range":{"start_line":106,"start_character":8,"end_line":107,"end_character":48},"updated":"2016-03-08 20:05:02.000000000","message":"any specific reason to use \"get_all_for_share\" instead of \"get_all_for_share_instance\"?","commit_id":"e09ecd0bf8bc6edd7be9117d1a3db26f500b5fb4"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"cc2054859821d5efb964403860a484a3b706b0fe","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # NOTE(tpsilva): checking for the existence of non processed rules"},{"line_number":105,"context_line":"        rule_ids \u003d set([rule[\u0027id\u0027] for rule in rules])"},{"line_number":106,"context_line":"        queried_rules \u003d self.db.share_access_get_all_for_share("},{"line_number":107,"context_line":"            context, share_instance[\u0027share_id\u0027])"},{"line_number":108,"context_line":"        queried_ids \u003d set([rule[\u0027id\u0027] for rule in queried_rules])"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        if rule_ids !\u003d queried_ids:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5aef4532_f321d4a0","line":107,"range":{"start_line":106,"start_character":8,"end_line":107,"end_character":48},"in_reply_to":"5aef4532_08924b57","updated":"2016-03-08 20:10:48.000000000","message":"Migration does not work if using get_all_for_share_instance.","commit_id":"e09ecd0bf8bc6edd7be9117d1a3db26f500b5fb4"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"923480f6e3847b2920ab5dc0d29e41e37cc08472","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                context, share_instance[\u0027id\u0027])"},{"line_number":58,"context_line":"            rules \u003d []"},{"line_number":59,"context_line":"        else:"},{"line_number":60,"context_line":"            rules \u003d self.db.share_access_get_all_for_share("},{"line_number":61,"context_line":"                context, share_instance[\u0027share_id\u0027])"},{"line_number":62,"context_line":"            if delete_rules:"},{"line_number":63,"context_line":"                delete_ids \u003d [rule[\u0027id\u0027] for rule in delete_rules]"},{"line_number":64,"context_line":"                rules \u003d list(filter(lambda r: r[\u0027id\u0027] not in delete_ids,"}],"source_content_type":"text/x-python","patch_set":11,"id":"5aef4532_8be6dee5","line":61,"range":{"start_line":60,"start_character":12,"end_line":61,"end_character":52},"updated":"2016-03-10 14:56:21.000000000","message":"Discussed this with Goutham, this should be share_access_get_all_for_instance(). This line is syncing instances that do not necessary have an access mapping.\n\nSuppose instance 1 exists and user adds a rule to its share. A mapping is created between the rule and that instance. If instance 2 is created, this method will apply the same rules as instance 1 to instance 2, while there are no DB mappings to instance 2. Goutham created a method (https://github.com/openstack/manila/blob/cdab09b822d38e58b2249863310a9ae2f8eb7dfe/manila/db/sqlalchemy/api.py#L1735) that does this, and migration should be doing this (at the moment it is not, this is a separate bug). So, for consistency, this method should retrieve only rules that are mapped to this instance in DB, not all of share\u0027s. If you change here and below, migration will work, and when the other separate bug is fixed it will be consistent as well.","commit_id":"1045a15722fd4e87acdd2b1bfbb647669a0dbf72"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"5e7f62dfb969b4f84f8d0c8dc5ea9cdb8d71f0d1","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                context, share_instance[\u0027id\u0027])"},{"line_number":58,"context_line":"            rules \u003d []"},{"line_number":59,"context_line":"        else:"},{"line_number":60,"context_line":"            rules \u003d self.db.share_access_get_all_for_share("},{"line_number":61,"context_line":"                context, share_instance[\u0027share_id\u0027])"},{"line_number":62,"context_line":"            if delete_rules:"},{"line_number":63,"context_line":"                delete_ids \u003d [rule[\u0027id\u0027] for rule in delete_rules]"},{"line_number":64,"context_line":"                rules \u003d list(filter(lambda r: r[\u0027id\u0027] not in delete_ids,"}],"source_content_type":"text/x-python","patch_set":11,"id":"5aef4532_26054110","line":61,"range":{"start_line":60,"start_character":12,"end_line":61,"end_character":52},"in_reply_to":"5aef4532_8be6dee5","updated":"2016-03-10 15:01:04.000000000","message":"Thank you for poiting this. Will fix both these calls on the next patchset.","commit_id":"1045a15722fd4e87acdd2b1bfbb647669a0dbf72"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"a601cbe1cf9763fbb922262d4227043aa00a78f8","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        be deleted."},{"line_number":43,"context_line":"        :param share_server: Share server model or None"},{"line_number":44,"context_line":"        \"\"\""},{"line_number":45,"context_line":"        self.db.share_instance_update_access_status("},{"line_number":46,"context_line":"            context,"},{"line_number":47,"context_line":"            share_instance_id,"},{"line_number":48,"context_line":"            constants.STATUS_UPDATING"},{"line_number":49,"context_line":"        )"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        share_instance \u003d self.db.share_instance_get("},{"line_number":52,"context_line":"            context, share_instance_id, with_share_data\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_32d01af6","line":49,"range":{"start_line":45,"start_character":7,"end_line":49,"end_character":9},"updated":"2016-03-17 20:27:41.000000000","message":"see other comment, I believe it is best to set this in manager.","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"395c6af57e3ac824db287ae3e2e2607e7f4715b2","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        be deleted."},{"line_number":43,"context_line":"        :param share_server: Share server model or None"},{"line_number":44,"context_line":"        \"\"\""},{"line_number":45,"context_line":"        self.db.share_instance_update_access_status("},{"line_number":46,"context_line":"            context,"},{"line_number":47,"context_line":"            share_instance_id,"},{"line_number":48,"context_line":"            constants.STATUS_UPDATING"},{"line_number":49,"context_line":"        )"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        share_instance \u003d self.db.share_instance_get("},{"line_number":52,"context_line":"            context, share_instance_id, with_share_data\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_6fd0de1f","line":49,"range":{"start_line":45,"start_character":7,"end_line":49,"end_character":9},"in_reply_to":"1af94dfe_32d01af6","updated":"2016-03-18 13:58:14.000000000","message":"As Clinton commented, this update needs to stay here to end the recursion.","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"4d20fc63630b0b3981f1345808fb2e75bcdfa60a","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                                                    with_share_data\u003dTrue)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        if self._check_needs_refresh(context, rules, share_instance):"},{"line_number":114,"context_line":"            self.update_access_rules(context, share_instance_id,"},{"line_number":115,"context_line":"                                     share_server\u003dshare_server)"},{"line_number":116,"context_line":"        else:"},{"line_number":117,"context_line":"            self.db.share_instance_update_access_status("}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_786721b7","line":114,"range":{"start_line":114,"start_character":17,"end_line":114,"end_character":36},"updated":"2016-03-17 21:08:15.000000000","message":"Interesting that you chose recursion instead of a loop.  It works, though, as long as you don\u0027t run out of stack frames, which seems unlikely.","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"a601cbe1cf9763fbb922262d4227043aa00a78f8","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        access_rules_status \u003d share_instance[\u0027access_rules_status\u0027]"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        return (access_rules_status \u003d\u003d constants.STATUS_MULTIPLE_UPDATES or"},{"line_number":136,"context_line":"                rule_ids !\u003d queried_ids)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _update_access_fallback(self, add_rules, context, delete_rules,"},{"line_number":139,"context_line":"                                remove_rules, share_instance, share_server):"}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_92f00e93","line":136,"range":{"start_line":135,"start_character":7,"end_line":136,"end_character":40},"updated":"2016-03-17 20:27:41.000000000","message":"how about the last request on deny_access? shouldn\u0027t it include case for UPDATING?","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"7b319555f651b3738f4c23f35d138e5e973f2dc5","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        access_rules_status \u003d share_instance[\u0027access_rules_status\u0027]"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        return (access_rules_status \u003d\u003d constants.STATUS_MULTIPLE_UPDATES or"},{"line_number":136,"context_line":"                rule_ids !\u003d queried_ids)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _update_access_fallback(self, add_rules, context, delete_rules,"},{"line_number":139,"context_line":"                                remove_rules, share_instance, share_server):"}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_92face41","line":136,"range":{"start_line":135,"start_character":7,"end_line":136,"end_character":40},"in_reply_to":"1af94dfe_92f00e93","updated":"2016-03-17 20:32:19.000000000","message":"I see now that you are not changing status to UPDATING on manager.deny_access. So you would not need to address that case here.","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"}],"manila/share/api.py":[{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"717cc889b5b9c1604d25e719b5c236eb2173a594","unresolved":false,"context_lines":[{"line_number":1039,"context_line":"        # from ShareInstanceAccess will check for non processed rules at its"},{"line_number":1040,"context_line":"        # end and will re-run itself if needed."},{"line_number":1041,"context_line":"        if status \u003d\u003d constants.STATUS_ERROR:"},{"line_number":1042,"context_line":"            msg \u003d _(\"Share instance current access rules status is: \""},{"line_number":1043,"context_line":"                    \"%(status)s.\") % {\u0027status\u0027: status}"},{"line_number":1044,"context_line":""},{"line_number":1045,"context_line":"            raise exception.InvalidShareInstance(reason\u003dmsg)"},{"line_number":1046,"context_line":"        elif status \u003d\u003d constants.STATUS_ACTIVE:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_0ca84376","line":1043,"range":{"start_line":1042,"start_character":12,"end_line":1043,"end_character":55},"updated":"2016-03-03 18:49:47.000000000","message":"Please change message to something like \"Access rules cannot be added while share\u0027s access rules status is \u0027error\u0027.\"","commit_id":"a661aabebd0ad6798a90fe863daa2c57bf768d00"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"953abd36df6a41ba56e960e3833fee04adde2d8f","unresolved":false,"context_lines":[{"line_number":1039,"context_line":"        # from ShareInstanceAccess will check for non processed rules at its"},{"line_number":1040,"context_line":"        # end and will re-run itself if needed."},{"line_number":1041,"context_line":"        if status \u003d\u003d constants.STATUS_ERROR:"},{"line_number":1042,"context_line":"            msg \u003d _(\"Share instance current access rules status is: \""},{"line_number":1043,"context_line":"                    \"%(status)s.\") % {\u0027status\u0027: status}"},{"line_number":1044,"context_line":""},{"line_number":1045,"context_line":"            raise exception.InvalidShareInstance(reason\u003dmsg)"},{"line_number":1046,"context_line":"        elif status \u003d\u003d constants.STATUS_ACTIVE:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_ad5ae6ef","line":1043,"range":{"start_line":1042,"start_character":12,"end_line":1043,"end_character":55},"in_reply_to":"7af24918_0ca84376","updated":"2016-03-03 19:53:55.000000000","message":"They can and any rules will be added, as you can see on line 1011. The rules just won\u0027t be sent to the driver, since the current instance access_rules_status is error, which makes sense. In order for it to get back to active, the admin must check which rule is causing the error and remove it. After that, the access_rules_status will revert automatically to active and the driver will apply all rules existent on the database.","commit_id":"a661aabebd0ad6798a90fe863daa2c57bf768d00"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"901d23bbfc7b5dede7c24e19540a620dc2b8b8fb","unresolved":false,"context_lines":[{"line_number":1039,"context_line":"        # from ShareInstanceAccess will check for non processed rules at its"},{"line_number":1040,"context_line":"        # end and will re-run itself if needed."},{"line_number":1041,"context_line":"        if status \u003d\u003d constants.STATUS_ERROR:"},{"line_number":1042,"context_line":"            msg \u003d _(\"Share instance current access rules status is: \""},{"line_number":1043,"context_line":"                    \"%(status)s.\") % {\u0027status\u0027: status}"},{"line_number":1044,"context_line":""},{"line_number":1045,"context_line":"            raise exception.InvalidShareInstance(reason\u003dmsg)"},{"line_number":1046,"context_line":"        elif status \u003d\u003d constants.STATUS_ACTIVE:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_6a28a09a","line":1043,"range":{"start_line":1042,"start_character":12,"end_line":1043,"end_character":55},"in_reply_to":"7af24918_3018ed74","updated":"2016-03-04 11:46:00.000000000","message":"I agree that this is confusing, but I don\u0027t think we should remove the exception. Changed the message.","commit_id":"a661aabebd0ad6798a90fe863daa2c57bf768d00"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"2d2af4e2b038e0d4381707696dbcf68bd92d7e9d","unresolved":false,"context_lines":[{"line_number":1039,"context_line":"        # from ShareInstanceAccess will check for non processed rules at its"},{"line_number":1040,"context_line":"        # end and will re-run itself if needed."},{"line_number":1041,"context_line":"        if status \u003d\u003d constants.STATUS_ERROR:"},{"line_number":1042,"context_line":"            msg \u003d _(\"Share instance current access rules status is: \""},{"line_number":1043,"context_line":"                    \"%(status)s.\") % {\u0027status\u0027: status}"},{"line_number":1044,"context_line":""},{"line_number":1045,"context_line":"            raise exception.InvalidShareInstance(reason\u003dmsg)"},{"line_number":1046,"context_line":"        elif status \u003d\u003d constants.STATUS_ACTIVE:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_3018ed74","line":1043,"range":{"start_line":1042,"start_character":12,"end_line":1043,"end_character":55},"in_reply_to":"7af24918_ad5ae6ef","updated":"2016-03-03 20:09:37.000000000","message":"It is confusing to the user if an exception is thrown and error messages being shown when access rules are being in fact added.\n\nThen I think this exception should not be raised, or the message changed to \"Share instance access rules status is error, please remove access rules causing error.\"","commit_id":"a661aabebd0ad6798a90fe863daa2c57bf768d00"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"25fa2dd7fec0f092c4b7e0e286190382b85c7c0d","unresolved":false,"context_lines":[{"line_number":1125,"context_line":"            }"},{"line_number":1126,"context_line":""},{"line_number":1127,"context_line":"            raise exception.InvalidShareInstance(reason\u003dmsg)"},{"line_number":1128,"context_line":"        elif status \u003d\u003d constants.STATUS_ACTIVE:"},{"line_number":1129,"context_line":"            self.db.share_instance_update_access_status("},{"line_number":1130,"context_line":"                context, share_instance[\u0027id\u0027],"},{"line_number":1131,"context_line":"                constants.STATUS_OUT_OF_SYNC"}],"source_content_type":"text/x-python","patch_set":9,"id":"5aef4532_db0be528","line":1128,"range":{"start_line":1128,"start_character":8,"end_line":1128,"end_character":47},"updated":"2016-03-09 13:32:35.000000000","message":"Now, if it is neither \"constants.STATUS_ERROR\" nor \"constants.STATUS_ACTIVE\" nothing will be done at all.\n\nShould be \"else\" clause with expected behavior.\n\nAlso, it should be covered with unit tests.","commit_id":"e09ecd0bf8bc6edd7be9117d1a3db26f500b5fb4"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"63b450bdb8f5007c91175f7724c5cf8d9bca89ab","unresolved":false,"context_lines":[{"line_number":1125,"context_line":"            }"},{"line_number":1126,"context_line":""},{"line_number":1127,"context_line":"            raise exception.InvalidShareInstance(reason\u003dmsg)"},{"line_number":1128,"context_line":"        elif status \u003d\u003d constants.STATUS_ACTIVE:"},{"line_number":1129,"context_line":"            self.db.share_instance_update_access_status("},{"line_number":1130,"context_line":"                context, share_instance[\u0027id\u0027],"},{"line_number":1131,"context_line":"                constants.STATUS_OUT_OF_SYNC"}],"source_content_type":"text/x-python","patch_set":9,"id":"5aef4532_711584e3","line":1128,"range":{"start_line":1128,"start_character":8,"end_line":1128,"end_character":47},"in_reply_to":"5aef4532_4e4d44c3","updated":"2016-03-09 16:40:08.000000000","message":"Yes, debug logging would be useful.","commit_id":"e09ecd0bf8bc6edd7be9117d1a3db26f500b5fb4"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"a7aaed3dec9a62e8f0f8ecdb334006bee58eeed0","unresolved":false,"context_lines":[{"line_number":1125,"context_line":"            }"},{"line_number":1126,"context_line":""},{"line_number":1127,"context_line":"            raise exception.InvalidShareInstance(reason\u003dmsg)"},{"line_number":1128,"context_line":"        elif status \u003d\u003d constants.STATUS_ACTIVE:"},{"line_number":1129,"context_line":"            self.db.share_instance_update_access_status("},{"line_number":1130,"context_line":"                context, share_instance[\u0027id\u0027],"},{"line_number":1131,"context_line":"                constants.STATUS_OUT_OF_SYNC"}],"source_content_type":"text/x-python","patch_set":9,"id":"5aef4532_7ab43934","line":1128,"range":{"start_line":1128,"start_character":8,"end_line":1128,"end_character":47},"in_reply_to":"5aef4532_711584e3","updated":"2016-03-09 17:08:53.000000000","message":"Done","commit_id":"e09ecd0bf8bc6edd7be9117d1a3db26f500b5fb4"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"07d88bdef11096bbec31bbb51f86aa95e9f49745","unresolved":false,"context_lines":[{"line_number":1125,"context_line":"            }"},{"line_number":1126,"context_line":""},{"line_number":1127,"context_line":"            raise exception.InvalidShareInstance(reason\u003dmsg)"},{"line_number":1128,"context_line":"        elif status \u003d\u003d constants.STATUS_ACTIVE:"},{"line_number":1129,"context_line":"            self.db.share_instance_update_access_status("},{"line_number":1130,"context_line":"                context, share_instance[\u0027id\u0027],"},{"line_number":1131,"context_line":"                constants.STATUS_OUT_OF_SYNC"}],"source_content_type":"text/x-python","patch_set":9,"id":"5aef4532_4e4d44c3","line":1128,"range":{"start_line":1128,"start_character":8,"end_line":1128,"end_character":47},"in_reply_to":"5aef4532_db0be528","updated":"2016-03-09 16:23:53.000000000","message":"The expected behavior is not doing anything, since the ShareInstanceAccess.update_access_rules will already take care of this access rule. Should I add an else clause with a log or something like that?\n\nRegarding the unit tests, I will cover that on a next patchset.","commit_id":"e09ecd0bf8bc6edd7be9117d1a3db26f500b5fb4"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"5fdf55d7f37206682ec24103e5abb1da35e7a753","unresolved":false,"context_lines":[{"line_number":1134,"context_line":"            self.share_rpcapi.allow_access(context, share_instance, access)"},{"line_number":1135,"context_line":"        else:"},{"line_number":1136,"context_line":"            LOG.debug(\"Share instance is OUT_OF_SYNC. Allow access does not \""},{"line_number":1137,"context_line":"                      \"need to be called for this instance.\")"},{"line_number":1138,"context_line":""},{"line_number":1139,"context_line":"    def deny_access(self, ctx, share, access):"},{"line_number":1140,"context_line":"        \"\"\"Deny access to share.\"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5aef4532_faccc9bc","line":1137,"range":{"start_line":1137,"start_character":44,"end_line":1137,"end_character":49},"updated":"2016-03-09 17:09:43.000000000","message":"which this?","commit_id":"7d3963c660f441986240df789b54bf77d6ebbc2c"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"fa6ce9ff1b5c33aa505178804bcc7f2f8b64c6c3","unresolved":false,"context_lines":[{"line_number":1134,"context_line":"            self.share_rpcapi.allow_access(context, share_instance, access)"},{"line_number":1135,"context_line":"        else:"},{"line_number":1136,"context_line":"            LOG.debug(\"Share instance is OUT_OF_SYNC. Allow access does not \""},{"line_number":1137,"context_line":"                      \"need to be called for this instance.\")"},{"line_number":1138,"context_line":""},{"line_number":1139,"context_line":"    def deny_access(self, ctx, share, access):"},{"line_number":1140,"context_line":"        \"\"\"Deny access to share.\"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5aef4532_e500aa03","line":1137,"range":{"start_line":1137,"start_character":44,"end_line":1137,"end_character":49},"in_reply_to":"5aef4532_faccc9bc","updated":"2016-03-09 17:16:52.000000000","message":"Done. Added to the previous log as well.","commit_id":"7d3963c660f441986240df789b54bf77d6ebbc2c"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"3f286886506dbd6aadad09f6a0c9aeaaf381e71f","unresolved":false,"context_lines":[{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"            self.share_rpcapi.allow_access(context, share_instance, access)"},{"line_number":1136,"context_line":"        else:"},{"line_number":1137,"context_line":"            LOG.debug(\"Share instance %s is OUT_OF_SYNC. Allow access does not\""},{"line_number":1138,"context_line":"                      \" need to be called for this instance.\","},{"line_number":1139,"context_line":"                      share_instance[\u0027id\u0027])"},{"line_number":1140,"context_line":""},{"line_number":1141,"context_line":"    def deny_access(self, ctx, share, access):"},{"line_number":1142,"context_line":"        \"\"\"Deny access to share.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"3afc51ec_7835d3d8","line":1139,"range":{"start_line":1137,"start_character":12,"end_line":1139,"end_character":43},"updated":"2016-03-12 20:15:58.000000000","message":"Questions for my understanding of this design: \n\nIf the \u0027access_rules_status\u0027 is \u0027out_of_sync\u0027, don\u0027t we want to create this new rule in the database for the retry in https://review.openstack.org/#/c/287758/12/manila/share/access.py?\n\nI don\u0027t see where you are adding a db entry for this new rule. \n\nShould all *consequently added rules* be ignored when the status is \u0027out_of_sync\u0027?\nIs this design only for *parallel/concurrent* requests that somehow went past the API to the share manager?","commit_id":"aca1a8e9974d6c7a556190825772018852f3b18a"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"a8ab999435523c41a52812bfa9fb2fa963c574e4","unresolved":false,"context_lines":[{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"            self.share_rpcapi.allow_access(context, share_instance, access)"},{"line_number":1136,"context_line":"        else:"},{"line_number":1137,"context_line":"            LOG.debug(\"Share instance %s is OUT_OF_SYNC. Allow access does not\""},{"line_number":1138,"context_line":"                      \" need to be called for this instance.\","},{"line_number":1139,"context_line":"                      share_instance[\u0027id\u0027])"},{"line_number":1140,"context_line":""},{"line_number":1141,"context_line":"    def deny_access(self, ctx, share, access):"},{"line_number":1142,"context_line":"        \"\"\"Deny access to share.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"3afc51ec_0c59d5fe","line":1139,"range":{"start_line":1137,"start_character":12,"end_line":1139,"end_character":43},"in_reply_to":"3afc51ec_4ffda839","updated":"2016-03-14 12:13:16.000000000","message":"Goutham, as Rodrigo already pointed out, the rules are created in DB on the allow_access method, so we don\u0027t need to send the rpcapi call. I updated the message as you suggested.","commit_id":"aca1a8e9974d6c7a556190825772018852f3b18a"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"376d3e878cab1e7aefc76f135f1ad8e4742ad637","unresolved":false,"context_lines":[{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"            self.share_rpcapi.allow_access(context, share_instance, access)"},{"line_number":1136,"context_line":"        else:"},{"line_number":1137,"context_line":"            LOG.debug(\"Share instance %s is OUT_OF_SYNC. Allow access does not\""},{"line_number":1138,"context_line":"                      \" need to be called for this instance.\","},{"line_number":1139,"context_line":"                      share_instance[\u0027id\u0027])"},{"line_number":1140,"context_line":""},{"line_number":1141,"context_line":"    def deny_access(self, ctx, share, access):"},{"line_number":1142,"context_line":"        \"\"\"Deny access to share.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"3afc51ec_4ffda839","line":1139,"range":{"start_line":1137,"start_character":12,"end_line":1139,"end_character":43},"in_reply_to":"3afc51ec_5caba41d","updated":"2016-03-13 16:19:56.000000000","message":"Ah, Thanks for pointing that out. The message seemed a little confusing.\nCan we have it say:\n\n \n    \n\n   msg \u003d \"The access_rules_status of the share instance %(instance)s is \"\n         \"currently %(status)s. Application of previous rules may still \"\n         \"be pending. Request will be queued.\"\n   payload \u003d  {\n               \u0027instance\u0027: share_instance[\u0027id\u0027],\n               \u0027status\u0027: share_instance[\u0027access_rules_status\u0027],\n             }\n   \n   LOG.debug(msg, payload)","commit_id":"aca1a8e9974d6c7a556190825772018852f3b18a"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"ac07095b90ad34b278d15d5048092fa9c06f79ff","unresolved":false,"context_lines":[{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"            self.share_rpcapi.allow_access(context, share_instance, access)"},{"line_number":1136,"context_line":"        else:"},{"line_number":1137,"context_line":"            LOG.debug(\"Share instance %s is OUT_OF_SYNC. Allow access does not\""},{"line_number":1138,"context_line":"                      \" need to be called for this instance.\","},{"line_number":1139,"context_line":"                      share_instance[\u0027id\u0027])"},{"line_number":1140,"context_line":""},{"line_number":1141,"context_line":"    def deny_access(self, ctx, share, access):"},{"line_number":1142,"context_line":"        \"\"\"Deny access to share.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"3afc51ec_5caba41d","line":1139,"range":{"start_line":1137,"start_character":12,"end_line":1139,"end_character":43},"in_reply_to":"3afc51ec_7835d3d8","updated":"2016-03-13 14:48:36.000000000","message":"Hi Goutham, new rule is created in line 1089, before checking instance status. Every allow_access invoked creates a rule. If it is out of sync, it does not send the request, because a previous access rule change is still running and will pick up the difference in the DB at the end.","commit_id":"aca1a8e9974d6c7a556190825772018852f3b18a"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"4d20fc63630b0b3981f1345808fb2e75bcdfa60a","unresolved":false,"context_lines":[{"line_number":1116,"context_line":"            msg \u003d _(\"Share instance %(instance_id)s access rules status is: \""},{"line_number":1117,"context_line":"                    \"%(status)s. Please remove any incorrect rules to get it \""},{"line_number":1118,"context_line":"                    \"back to %(valid_status)s.\") % {"},{"line_number":1119,"context_line":"                \u0027instance_id\u0027: share_instance[\u0027id\u0027],"},{"line_number":1120,"context_line":"                \u0027status\u0027: status,"},{"line_number":1121,"context_line":"                \u0027valid_status\u0027: constants.STATUS_ACTIVE,"},{"line_number":1122,"context_line":"            }"},{"line_number":1123,"context_line":""},{"line_number":1124,"context_line":"            raise exception.InvalidShareInstance(reason\u003dmsg)"},{"line_number":1125,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_75d60cf2","line":1122,"range":{"start_line":1119,"start_character":0,"end_line":1122,"end_character":13},"updated":"2016-03-17 21:08:15.000000000","message":"PEP-8 isn\u0027t complaining, but these lines are technically underindented.","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"395c6af57e3ac824db287ae3e2e2607e7f4715b2","unresolved":false,"context_lines":[{"line_number":1116,"context_line":"            msg \u003d _(\"Share instance %(instance_id)s access rules status is: \""},{"line_number":1117,"context_line":"                    \"%(status)s. Please remove any incorrect rules to get it \""},{"line_number":1118,"context_line":"                    \"back to %(valid_status)s.\") % {"},{"line_number":1119,"context_line":"                \u0027instance_id\u0027: share_instance[\u0027id\u0027],"},{"line_number":1120,"context_line":"                \u0027status\u0027: status,"},{"line_number":1121,"context_line":"                \u0027valid_status\u0027: constants.STATUS_ACTIVE,"},{"line_number":1122,"context_line":"            }"},{"line_number":1123,"context_line":""},{"line_number":1124,"context_line":"            raise exception.InvalidShareInstance(reason\u003dmsg)"},{"line_number":1125,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_8c461379","line":1122,"range":{"start_line":1119,"start_character":0,"end_line":1122,"end_character":13},"in_reply_to":"1af94dfe_75d60cf2","updated":"2016-03-18 13:58:14.000000000","message":"Done","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"4d20fc63630b0b3981f1345808fb2e75bcdfa60a","unresolved":false,"context_lines":[{"line_number":1125,"context_line":"        else:"},{"line_number":1126,"context_line":"            new_status \u003d constants.STATUS_OUT_OF_SYNC"},{"line_number":1127,"context_line":""},{"line_number":1128,"context_line":"            if status in constants.UPDATING_RULES_STATUES:"},{"line_number":1129,"context_line":"                new_status \u003d constants.STATUS_MULTIPLE_UPDATES"},{"line_number":1130,"context_line":""},{"line_number":1131,"context_line":"            self.db.share_instance_update_access_status("},{"line_number":1132,"context_line":"                context, share_instance[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_d561e03a","line":1129,"range":{"start_line":1128,"start_character":0,"end_line":1129,"end_character":62},"updated":"2016-03-17 21:08:15.000000000","message":"If the status is STATUS_MULTIPLE_UPDATES already, this code will still update the DB to that value.  Is there value in that?","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"4d20fc63630b0b3981f1345808fb2e75bcdfa60a","unresolved":false,"context_lines":[{"line_number":1130,"context_line":""},{"line_number":1131,"context_line":"            self.db.share_instance_update_access_status("},{"line_number":1132,"context_line":"                context, share_instance[\u0027id\u0027],"},{"line_number":1133,"context_line":"                new_status"},{"line_number":1134,"context_line":"            )"},{"line_number":1135,"context_line":""},{"line_number":1136,"context_line":"            self.share_rpcapi.allow_access(context, share_instance, access)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_d5de0010","line":1133,"range":{"start_line":1133,"start_character":16,"end_line":1133,"end_character":26},"updated":"2016-03-17 21:08:15.000000000","message":"Unwrap, please.","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"a39959755857d50738219aab80252762f7e97129","unresolved":false,"context_lines":[{"line_number":1128,"context_line":"            if status in constants.UPDATING_RULES_STATUES:"},{"line_number":1129,"context_line":"                new_status \u003d constants.STATUS_MULTIPLE_UPDATES"},{"line_number":1130,"context_line":""},{"line_number":1131,"context_line":"            self.db.share_instance_update_access_status("},{"line_number":1132,"context_line":"                context, share_instance[\u0027id\u0027],"},{"line_number":1133,"context_line":"                new_status"},{"line_number":1134,"context_line":"            )"},{"line_number":1135,"context_line":""},{"line_number":1136,"context_line":"            self.share_rpcapi.allow_access(context, share_instance, access)"},{"line_number":1137,"context_line":""},{"line_number":1138,"context_line":"    def deny_access(self, ctx, share, access):"},{"line_number":1139,"context_line":"        \"\"\"Deny access to share.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_f584dc0b","line":1136,"range":{"start_line":1131,"start_character":12,"end_line":1136,"end_character":75},"updated":"2016-03-17 20:46:53.000000000","message":"you are not blocking RPC calls in any status other than error, like in previous patches, but you are still recursively calling update_access_rules if there are differences. Isn\u0027t this causing the first request to run twice if there are 2 requests, having a total of update_access running 3 times?","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"7bc07a2d06ae103e45dabd26c78d6bd49af29376","unresolved":false,"context_lines":[{"line_number":1128,"context_line":"            if status in constants.UPDATING_RULES_STATUES:"},{"line_number":1129,"context_line":"                new_status \u003d constants.STATUS_MULTIPLE_UPDATES"},{"line_number":1130,"context_line":""},{"line_number":1131,"context_line":"            self.db.share_instance_update_access_status("},{"line_number":1132,"context_line":"                context, share_instance[\u0027id\u0027],"},{"line_number":1133,"context_line":"                new_status"},{"line_number":1134,"context_line":"            )"},{"line_number":1135,"context_line":""},{"line_number":1136,"context_line":"            self.share_rpcapi.allow_access(context, share_instance, access)"},{"line_number":1137,"context_line":""},{"line_number":1138,"context_line":"    def deny_access(self, ctx, share, access):"},{"line_number":1139,"context_line":"        \"\"\"Deny access to share.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_be66b14e","line":1136,"range":{"start_line":1131,"start_character":12,"end_line":1136,"end_character":75},"in_reply_to":"1af94dfe_b866c94e","updated":"2016-03-17 22:03:47.000000000","message":"This is definitely a race condition.  It seems since we\u0027re coalescing access rule updates by recursing on the backend, we should also be tolerant of duplicate requests that were delayed in transit, either by checking for ACTIVE state in the manager or comparing the rules in the manager to see if there really are any changes to apply.","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":17097,"name":"Tiago Pasqualini da Silva","email":"t.pasqualini@luizalabs.com","username":"tiago.pasqualini"},"change_message_id":"395c6af57e3ac824db287ae3e2e2607e7f4715b2","unresolved":false,"context_lines":[{"line_number":1128,"context_line":"            if status in constants.UPDATING_RULES_STATUES:"},{"line_number":1129,"context_line":"                new_status \u003d constants.STATUS_MULTIPLE_UPDATES"},{"line_number":1130,"context_line":""},{"line_number":1131,"context_line":"            self.db.share_instance_update_access_status("},{"line_number":1132,"context_line":"                context, share_instance[\u0027id\u0027],"},{"line_number":1133,"context_line":"                new_status"},{"line_number":1134,"context_line":"            )"},{"line_number":1135,"context_line":""},{"line_number":1136,"context_line":"            self.share_rpcapi.allow_access(context, share_instance, access)"},{"line_number":1137,"context_line":""},{"line_number":1138,"context_line":"    def deny_access(self, ctx, share, access):"},{"line_number":1139,"context_line":"        \"\"\"Deny access to share.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_0c2a0390","line":1136,"range":{"start_line":1131,"start_character":12,"end_line":1136,"end_character":75},"in_reply_to":"1af94dfe_be66b14e","updated":"2016-03-18 13:58:14.000000000","message":"Added a verification in the manager to ignore the requests when the state is \u0027active\u0027.","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"7c3d1b07ccee5fa4bb7b2789b1ecb7aaafa10fce","unresolved":false,"context_lines":[{"line_number":1128,"context_line":"            if status in constants.UPDATING_RULES_STATUES:"},{"line_number":1129,"context_line":"                new_status \u003d constants.STATUS_MULTIPLE_UPDATES"},{"line_number":1130,"context_line":""},{"line_number":1131,"context_line":"            self.db.share_instance_update_access_status("},{"line_number":1132,"context_line":"                context, share_instance[\u0027id\u0027],"},{"line_number":1133,"context_line":"                new_status"},{"line_number":1134,"context_line":"            )"},{"line_number":1135,"context_line":""},{"line_number":1136,"context_line":"            self.share_rpcapi.allow_access(context, share_instance, access)"},{"line_number":1137,"context_line":""},{"line_number":1138,"context_line":"    def deny_access(self, ctx, share, access):"},{"line_number":1139,"context_line":"        \"\"\"Deny access to share.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_b866c94e","line":1136,"range":{"start_line":1131,"start_character":12,"end_line":1136,"end_character":75},"in_reply_to":"1af94dfe_f584dc0b","updated":"2016-03-17 21:15:47.000000000","message":"+1  I just reproduced this using artificial delays in a debugger.","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"c91155e21ff077c80d4eb4e1f534665ddef30292","unresolved":false,"context_lines":[{"line_number":1142,"context_line":"                    constants.STATUS_OUT_OF_SYNC"},{"line_number":1143,"context_line":"                )"},{"line_number":1144,"context_line":"            elif status \u003d\u003d constants.STATUS_UPDATING:"},{"line_number":1145,"context_line":"                self.db.share_instance_update_access_status("},{"line_number":1146,"context_line":"                    context, share_instance[\u0027id\u0027],"},{"line_number":1147,"context_line":"                    constants.STATUS_UPDATING_MULTIPLE"},{"line_number":1148,"context_line":"                )"},{"line_number":1149,"context_line":""},{"line_number":1150,"context_line":"            self.share_rpcapi.allow_access(context, share_instance, access)"},{"line_number":1151,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"1af94dfe_fe5c861a","line":1148,"range":{"start_line":1145,"start_character":0,"end_line":1148,"end_character":17},"updated":"2016-03-18 18:40:55.000000000","message":"Not covered by a unit test.","commit_id":"51650ec5669f22133b3f2a7a165e5f5ef9f86158"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"c91155e21ff077c80d4eb4e1f534665ddef30292","unresolved":false,"context_lines":[{"line_number":1183,"context_line":"            new_status \u003d constants.STATUS_OUT_OF_SYNC"},{"line_number":1184,"context_line":""},{"line_number":1185,"context_line":"            if status in constants.UPDATING_RULES_STATUSES:"},{"line_number":1186,"context_line":"                new_status \u003d constants.STATUS_UPDATING_MULTIPLE"},{"line_number":1187,"context_line":""},{"line_number":1188,"context_line":"            self.db.share_instance_update_access_status("},{"line_number":1189,"context_line":"                context, share_instance[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":17,"id":"1af94dfe_3ea1cef8","line":1186,"range":{"start_line":1186,"start_character":0,"end_line":1186,"end_character":63},"updated":"2016-03-18 18:40:55.000000000","message":"Not covered by a unit test.","commit_id":"51650ec5669f22133b3f2a7a165e5f5ef9f86158"}],"manila/share/manager.py":[{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"a601cbe1cf9763fbb922262d4227043aa00a78f8","unresolved":false,"context_lines":[{"line_number":1822,"context_line":"        \"\"\"Allow access to some share instance.\"\"\""},{"line_number":1823,"context_line":"        share_instance \u003d self._get_share_instance(context, share_instance_id)"},{"line_number":1824,"context_line":"        status \u003d share_instance[\u0027access_rules_status\u0027]"},{"line_number":1825,"context_line":""},{"line_number":1826,"context_line":"        if status not in constants.UPDATING_RULES_STATUES:"},{"line_number":1827,"context_line":"            add_rules \u003d [self.db.share_access_get(context, rule_id)"},{"line_number":1828,"context_line":"                         for rule_id in access_rules]"},{"line_number":1829,"context_line":""},{"line_number":1830,"context_line":"            share_server \u003d self._get_share_server(context, share_instance)"},{"line_number":1831,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_f2b232e4","line":1828,"range":{"start_line":1825,"start_character":0,"end_line":1828,"end_character":53},"updated":"2016-03-17 20:27:41.000000000","message":"I think it is better to set the status to UPDATING here instead of in the helper.","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"4d20fc63630b0b3981f1345808fb2e75bcdfa60a","unresolved":false,"context_lines":[{"line_number":1822,"context_line":"        \"\"\"Allow access to some share instance.\"\"\""},{"line_number":1823,"context_line":"        share_instance \u003d self._get_share_instance(context, share_instance_id)"},{"line_number":1824,"context_line":"        status \u003d share_instance[\u0027access_rules_status\u0027]"},{"line_number":1825,"context_line":""},{"line_number":1826,"context_line":"        if status not in constants.UPDATING_RULES_STATUES:"},{"line_number":1827,"context_line":"            add_rules \u003d [self.db.share_access_get(context, rule_id)"},{"line_number":1828,"context_line":"                         for rule_id in access_rules]"},{"line_number":1829,"context_line":""},{"line_number":1830,"context_line":"            share_server \u003d self._get_share_server(context, share_instance)"},{"line_number":1831,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"1af94dfe_78b9e114","line":1828,"range":{"start_line":1825,"start_character":0,"end_line":1828,"end_character":53},"in_reply_to":"1af94dfe_f2b232e4","updated":"2016-03-17 21:08:15.000000000","message":"-1  This needs to be set at the top of the helper, so that the recursive call has a terminating condition.","commit_id":"f3b80f8b4843a56625b1c72133af7a93e4892f9e"}]}
