)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"93fb2a3e4fa1c9aa4b5d9925b896f99c0d9cebe6","unresolved":true,"context_lines":[{"line_number":16,"context_line":"2. When checking quota as part of a long-running process of consuming"},{"line_number":17,"context_line":"   an unbounded data stream, we need to be able to determine how much"},{"line_number":18,"context_line":"   quota remains so that we can stop the transfer if we exceed the"},{"line_number":19,"context_line":"   limit. Without this, we have to periodically call to keystone"},{"line_number":20,"context_line":"   during the transfer, which is expensive and could fail."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"This patch adds a calculate_usage() method to the Enforcer which"},{"line_number":23,"context_line":"calculates the usage using the enforcement model and returns a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"2f4476e5_c312e92f","line":20,"range":{"start_line":19,"start_character":10,"end_line":20,"end_character":58},"updated":"2021-06-07 15:38:06.000000000","message":"I\u0027m not sure I understand how this solves the problem. The new function also calls Keystone.\n\nThat said, if we implement the cache as suggested in [0] then this would benefit, so probably still a net benefit.\n\n0: https://opendev.org/openstack/oslo.limit/src/commit/efc26ae724d504ce3bdd5fc21b39a79fa93552a8/oslo_limit/limit.py#L243","commit_id":"11549709bb4c84afbf83e87015574f8ba810e086"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9bd1abbbb1bd5a814dddd35a9ed335648b584067","unresolved":false,"context_lines":[{"line_number":16,"context_line":"2. When checking quota as part of a long-running process of consuming"},{"line_number":17,"context_line":"   an unbounded data stream, we need to be able to determine how much"},{"line_number":18,"context_line":"   quota remains so that we can stop the transfer if we exceed the"},{"line_number":19,"context_line":"   limit. Without this, we have to periodically call to keystone"},{"line_number":20,"context_line":"   during the transfer, which is expensive and could fail."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"This patch adds a calculate_usage() method to the Enforcer which"},{"line_number":23,"context_line":"calculates the usage using the enforcement model and returns a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"09f4d1df_32d4f5e8","line":20,"range":{"start_line":19,"start_character":10,"end_line":20,"end_character":58},"in_reply_to":"217f244b_d0afedd8","updated":"2021-06-07 15:55:05.000000000","message":"Yeah, basically define the maximum amount of data we\u0027d be willing to munch at the start, and even though that could change during a long-running activity where other things got deleted or added, it\u0027d be reasonable. We could also use that value to bound when we check the quota again, in case you scrambled to delete stuff before you hit your quota or something. But anyway, you get the idea :)","commit_id":"11549709bb4c84afbf83e87015574f8ba810e086"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"68aa8abc1dc2ae0c44e77cee689415d3d4c0b1c1","unresolved":true,"context_lines":[{"line_number":16,"context_line":"2. When checking quota as part of a long-running process of consuming"},{"line_number":17,"context_line":"   an unbounded data stream, we need to be able to determine how much"},{"line_number":18,"context_line":"   quota remains so that we can stop the transfer if we exceed the"},{"line_number":19,"context_line":"   limit. Without this, we have to periodically call to keystone"},{"line_number":20,"context_line":"   during the transfer, which is expensive and could fail."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"This patch adds a calculate_usage() method to the Enforcer which"},{"line_number":23,"context_line":"calculates the usage using the enforcement model and returns a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"d84b21c2_fd9bc523","line":20,"range":{"start_line":19,"start_character":10,"end_line":20,"end_character":58},"in_reply_to":"2f4476e5_c312e92f","updated":"2021-06-07 15:42:10.000000000","message":"It solves the problem because before we start a transfer, we can figure out what the current usage and quota is, calculate the different, and then stop the transfer later if we\u0027ve munched more than that amount of data.\n\nJohn\u0027s caching thing is definitely something we should have as well, just because we\u0027re banging the crap out of keystone in a lot of places. However, we\u0027d really like to not have to pass an enforcer down into the deep depths of the data pipeline just so we can check to see if we\u0027ve gone over the remaining limit. We\u0027d opt for the slightly leaky quota enforcement over strict correctness in that case, obviously.","commit_id":"11549709bb4c84afbf83e87015574f8ba810e086"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"ffc557a3ccafce4e8c7163a4a5d592d5795e4315","unresolved":false,"context_lines":[{"line_number":16,"context_line":"2. When checking quota as part of a long-running process of consuming"},{"line_number":17,"context_line":"   an unbounded data stream, we need to be able to determine how much"},{"line_number":18,"context_line":"   quota remains so that we can stop the transfer if we exceed the"},{"line_number":19,"context_line":"   limit. Without this, we have to periodically call to keystone"},{"line_number":20,"context_line":"   during the transfer, which is expensive and could fail."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"This patch adds a calculate_usage() method to the Enforcer which"},{"line_number":23,"context_line":"calculates the usage using the enforcement model and returns a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"217f244b_d0afedd8","line":20,"range":{"start_line":19,"start_character":10,"end_line":20,"end_character":58},"in_reply_to":"d84b21c2_fd9bc523","updated":"2021-06-07 15:52:23.000000000","message":"Ah, so the idea is to call this once before you start instead of repeatedly calling enforce in the inner loop. That makes sense.","commit_id":"11549709bb4c84afbf83e87015574f8ba810e086"}],"oslo_limit/limit.py":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"93fb2a3e4fa1c9aa4b5d9925b896f99c0d9cebe6","unresolved":true,"context_lines":[{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        This should *not* be used to conduct custom enforcement, but"},{"line_number":141,"context_line":"        rather only for reporting."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        \"\"\""},{"line_number":144,"context_line":"        if not project_id or not isinstance(project_id, str):"},{"line_number":145,"context_line":"            msg \u003d \u0027project_id must be a non-empty string.\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"1acb0b26_d350adde","line":142,"updated":"2021-06-07 15:38:06.000000000","message":"Would be good to document the data structure this returns too.","commit_id":"11549709bb4c84afbf83e87015574f8ba810e086"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"68aa8abc1dc2ae0c44e77cee689415d3d4c0b1c1","unresolved":true,"context_lines":[{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        This should *not* be used to conduct custom enforcement, but"},{"line_number":141,"context_line":"        rather only for reporting."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        \"\"\""},{"line_number":144,"context_line":"        if not project_id or not isinstance(project_id, str):"},{"line_number":145,"context_line":"            msg \u003d \u0027project_id must be a non-empty string.\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"9cbe668f_a196127e","line":142,"in_reply_to":"1acb0b26_d350adde","updated":"2021-06-07 15:42:10.000000000","message":"Sure, I\u0027ll fix that.","commit_id":"11549709bb4c84afbf83e87015574f8ba810e086"}]}
