)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"43ed8ef35086a8a7d02acf27a14dbe37243dfdf6","unresolved":true,"context_lines":[{"line_number":23,"context_line":"times out; retrying raises the last exception from the callable."},{"line_number":24,"context_line":"Tenacity provides backwards compatibility here by offering"},{"line_number":25,"context_line":"the \u0027reraise\u0027 kwarg."},{"line_number":26,"context_line":"- Tenacity defines \u0027time.sleep\u0027 as a default value for a kwarg."},{"line_number":27,"context_line":"That said consumers who need to mock patch time.sleep"},{"line_number":28,"context_line":"need to account for this via mocking of time.sleep before"},{"line_number":29,"context_line":"tenacity is imported."},{"line_number":30,"context_line":"- For retries that check a result, tenacity will raise if the retried"},{"line_number":31,"context_line":"function raises, whereas retrying retried on all exceptions."},{"line_number":32,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"68b4fd71_4d898090","line":29,"range":{"start_line":26,"start_character":0,"end_line":29,"end_character":21},"updated":"2021-08-31 07:12:19.000000000","message":"This is no longer true: https://github.com/jd/tenacity/issues/228","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"},{"author":{"_account_id":32594,"name":"Ashley Rodriguez","email":"ashrod98@redhat.com","username":"ashrod98"},"change_message_id":"a232cee2dd5045e58b4070b03bb894d171bcdf16","unresolved":false,"context_lines":[{"line_number":23,"context_line":"times out; retrying raises the last exception from the callable."},{"line_number":24,"context_line":"Tenacity provides backwards compatibility here by offering"},{"line_number":25,"context_line":"the \u0027reraise\u0027 kwarg."},{"line_number":26,"context_line":"- Tenacity defines \u0027time.sleep\u0027 as a default value for a kwarg."},{"line_number":27,"context_line":"That said consumers who need to mock patch time.sleep"},{"line_number":28,"context_line":"need to account for this via mocking of time.sleep before"},{"line_number":29,"context_line":"tenacity is imported."},{"line_number":30,"context_line":"- For retries that check a result, tenacity will raise if the retried"},{"line_number":31,"context_line":"function raises, whereas retrying retried on all exceptions."},{"line_number":32,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"4decf8a9_0815aa57","line":29,"range":{"start_line":26,"start_character":0,"end_line":29,"end_character":21},"in_reply_to":"68b4fd71_4d898090","updated":"2021-08-31 15:38:37.000000000","message":"Ack","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"43ed8ef35086a8a7d02acf27a14dbe37243dfdf6","unresolved":true,"context_lines":[{"line_number":33,"context_line":"This patch updates all usages of retrying with tenacity."},{"line_number":34,"context_line":"Unit tests will be added where applicable."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"Note: This change is not newton critical so projects are welcome"},{"line_number":37,"context_line":"to hold off on committing until post-newton. Ideally this change"},{"line_number":38,"context_line":"will merge by the first part of Ocata so dependant functionality"},{"line_number":39,"context_line":"can land and have time to solidify for Ocata."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"[1] https://github.com/jd/tenacity"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"47d80556_85602fc4","line":39,"range":{"start_line":36,"start_character":0,"end_line":39,"end_character":45},"updated":"2021-08-31 07:12:19.000000000","message":"This note can be dropped","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"},{"author":{"_account_id":32594,"name":"Ashley Rodriguez","email":"ashrod98@redhat.com","username":"ashrod98"},"change_message_id":"a232cee2dd5045e58b4070b03bb894d171bcdf16","unresolved":false,"context_lines":[{"line_number":33,"context_line":"This patch updates all usages of retrying with tenacity."},{"line_number":34,"context_line":"Unit tests will be added where applicable."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"Note: This change is not newton critical so projects are welcome"},{"line_number":37,"context_line":"to hold off on committing until post-newton. Ideally this change"},{"line_number":38,"context_line":"will merge by the first part of Ocata so dependant functionality"},{"line_number":39,"context_line":"can land and have time to solidify for Ocata."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"[1] https://github.com/jd/tenacity"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"773dc043_23587df2","line":39,"range":{"start_line":36,"start_character":0,"end_line":39,"end_character":45},"in_reply_to":"47d80556_85602fc4","updated":"2021-08-31 15:38:37.000000000","message":"Ack","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"c3cb17414f3c392df895cb9bfee765da7e613adc","unresolved":true,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Tenacity provides the same functionality as retrying, but has the"},{"line_number":16,"context_line":"following major differences to account for:"},{"line_number":17,"context_line":"- Tenacity uses seconds rather than ms as retrying did."},{"line_number":18,"context_line":"- Tenacity has different kwargs for the decorator and"},{"line_number":19,"context_line":"Retrying class itself."},{"line_number":20,"context_line":"- Tenacity has a different approach for retrying args by"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"ec3f03b6_2e96054c","line":17,"range":{"start_line":17,"start_character":0,"end_line":17,"end_character":55},"updated":"2021-09-02 04:13:12.000000000","message":"We generally don\u0027t care about this since we were treating intervals in seconds already","commit_id":"517c6554618d376857ef30e3b5499a921e5f66f7"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"c3cb17414f3c392df895cb9bfee765da7e613adc","unresolved":true,"context_lines":[{"line_number":19,"context_line":"Retrying class itself."},{"line_number":20,"context_line":"- Tenacity has a different approach for retrying args by"},{"line_number":21,"context_line":"using classes for its stop/wait/retry kwargs."},{"line_number":22,"context_line":"- By default tenacity raises a RetryError if a retried callable"},{"line_number":23,"context_line":"times out; retrying raises the last exception from the callable."},{"line_number":24,"context_line":"Tenacity provides backwards compatibility here by offering"},{"line_number":25,"context_line":"the \u0027reraise\u0027 kwarg."},{"line_number":26,"context_line":"- For retries that check a result, tenacity will raise if the"},{"line_number":27,"context_line":"retried function raises, whereas retrying retried on all"},{"line_number":28,"context_line":"exceptions."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"88ecaae5_fc420298","line":25,"range":{"start_line":22,"start_character":2,"end_line":25,"end_character":20},"updated":"2021-09-02 04:13:12.000000000","message":"which we always set, should make that clear","commit_id":"517c6554618d376857ef30e3b5499a921e5f66f7"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"c3cb17414f3c392df895cb9bfee765da7e613adc","unresolved":true,"context_lines":[{"line_number":23,"context_line":"times out; retrying raises the last exception from the callable."},{"line_number":24,"context_line":"Tenacity provides backwards compatibility here by offering"},{"line_number":25,"context_line":"the \u0027reraise\u0027 kwarg."},{"line_number":26,"context_line":"- For retries that check a result, tenacity will raise if the"},{"line_number":27,"context_line":"retried function raises, whereas retrying retried on all"},{"line_number":28,"context_line":"exceptions."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"This patch updates all usages of retrying with tenacity."},{"line_number":31,"context_line":"Unit tests are added where applicable."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"6a0d3c65_25611267","line":28,"range":{"start_line":26,"start_character":22,"end_line":28,"end_character":11},"updated":"2021-09-02 04:13:12.000000000","message":"unsure if this affects manila","commit_id":"517c6554618d376857ef30e3b5499a921e5f66f7"}],"manila/data/helper.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"f65044189a217b0471d0a66fcd7353ef76d22a8c","unresolved":true,"context_lines":[{"line_number":235,"context_line":""},{"line_number":236,"context_line":"        return access_list"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @utils.retry(exception.NotFound, 1, 10, 1)"},{"line_number":239,"context_line":"    def _check_dir_exists(self, path):"},{"line_number":240,"context_line":"        if not os.path.exists(path):"},{"line_number":241,"context_line":"            raise exception.NotFound(\"Folder %s could not be found.\" % path)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5b75d8e6_b4aedee7","line":238,"range":{"start_line":238,"start_character":17,"end_line":238,"end_character":45},"updated":"2021-09-01 21:35:48.000000000","message":"always pass kwargs as kwargs","commit_id":"c80b871af417f66935d47a6ddbcbfade1ed47497"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"f65044189a217b0471d0a66fcd7353ef76d22a8c","unresolved":true,"context_lines":[{"line_number":240,"context_line":"        if not os.path.exists(path):"},{"line_number":241,"context_line":"            raise exception.NotFound(\"Folder %s could not be found.\" % path)"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    @utils.retry(exception.Found, 1, 10, 1)"},{"line_number":244,"context_line":"    def _check_dir_not_exists(self, path):"},{"line_number":245,"context_line":"        if os.path.exists(path):"},{"line_number":246,"context_line":"            raise exception.Found(\"Folder %s was found.\" % path)"}],"source_content_type":"text/x-python","patch_set":5,"id":"8e899456_857d0239","line":243,"range":{"start_line":243,"start_character":0,"end_line":243,"end_character":43},"updated":"2021-09-01 21:35:48.000000000","message":"always pass kwargs as kwargs","commit_id":"c80b871af417f66935d47a6ddbcbfade1ed47497"}],"manila/share/drivers/generic.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"f65044189a217b0471d0a66fcd7353ef76d22a8c","unresolved":true,"context_lines":[{"line_number":18,"context_line":"import os"},{"line_number":19,"context_line":"import time"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from oslo_concurrency import processutils"},{"line_number":23,"context_line":"from oslo_config import cfg"},{"line_number":24,"context_line":"from oslo_log import log"}],"source_content_type":"text/x-python","patch_set":5,"id":"8e217d6b_e3bfa5df","line":21,"updated":"2021-09-01 21:35:48.000000000","message":"unrelated whitespace change: https://wiki.openstack.org/wiki/GitCommitMessages#Things_to_avoid_when_creating_commits","commit_id":"c80b871af417f66935d47a6ddbcbfade1ed47497"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"f65044189a217b0471d0a66fcd7353ef76d22a8c","unresolved":true,"context_lines":[{"line_number":417,"context_line":"                        % volume[\u0027id\u0027])"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"            @utils.retry(retries\u003d3,"},{"line_number":420,"context_line":"                         interval\u003d2,"},{"line_number":421,"context_line":"                         retry_param\u003d("},{"line_number":422,"context_line":"                             exception.ManilaException, exception.Invalid))"},{"line_number":423,"context_line":"            def attach_volume():"}],"source_content_type":"text/x-python","patch_set":5,"id":"a22f77e4_7e086d8f","line":420,"range":{"start_line":420,"start_character":34,"end_line":420,"end_character":36},"updated":"2021-09-01 21:35:48.000000000","message":"a fixed interval can be achieved by turning off exponential backoff","commit_id":"c80b871af417f66935d47a6ddbcbfade1ed47497"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"f65044189a217b0471d0a66fcd7353ef76d22a8c","unresolved":true,"context_lines":[{"line_number":418,"context_line":""},{"line_number":419,"context_line":"            @utils.retry(retries\u003d3,"},{"line_number":420,"context_line":"                         interval\u003d2,"},{"line_number":421,"context_line":"                         retry_param\u003d("},{"line_number":422,"context_line":"                             exception.ManilaException, exception.Invalid))"},{"line_number":423,"context_line":"            def attach_volume():"},{"line_number":424,"context_line":"                self.compute_api.instance_volume_attach("},{"line_number":425,"context_line":"                    self.admin_context, instance_id, volume[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fa54aca_f24f4cd6","line":422,"range":{"start_line":421,"start_character":37,"end_line":422,"end_character":74},"updated":"2021-09-01 21:35:48.000000000","message":"looks like we were retrying no matter the type of exception. We can leave it like that here","commit_id":"c80b871af417f66935d47a6ddbcbfade1ed47497"}],"manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"43ed8ef35086a8a7d02acf27a14dbe37243dfdf6","unresolved":true,"context_lines":[{"line_number":2805,"context_line":"        \"\"\"Abort an ongoing migration.\"\"\""},{"line_number":2806,"context_line":"        vserver, vserver_client \u003d self._get_vserver(share_server\u003dshare_server)"},{"line_number":2807,"context_line":"        share_volume \u003d self._get_backend_share_name(source_share[\u0027id\u0027])"},{"line_number":2808,"context_line":""},{"line_number":2809,"context_line":"        try:"},{"line_number":2810,"context_line":"            self._get_volume_move_status(source_share, share_server)"},{"line_number":2811,"context_line":"        except exception.NetAppException:"}],"source_content_type":"text/x-python","patch_set":2,"id":"c47bd614_38172bb5","line":2808,"range":{"start_line":2808,"start_character":0,"end_line":2808,"end_character":0},"updated":"2021-08-31 07:12:19.000000000","message":"Why drop this?","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"},{"author":{"_account_id":32594,"name":"Ashley Rodriguez","email":"ashrod98@redhat.com","username":"ashrod98"},"change_message_id":"a232cee2dd5045e58b4070b03bb894d171bcdf16","unresolved":true,"context_lines":[{"line_number":2805,"context_line":"        \"\"\"Abort an ongoing migration.\"\"\""},{"line_number":2806,"context_line":"        vserver, vserver_client \u003d self._get_vserver(share_server\u003dshare_server)"},{"line_number":2807,"context_line":"        share_volume \u003d self._get_backend_share_name(source_share[\u0027id\u0027])"},{"line_number":2808,"context_line":""},{"line_number":2809,"context_line":"        try:"},{"line_number":2810,"context_line":"            self._get_volume_move_status(source_share, share_server)"},{"line_number":2811,"context_line":"        except exception.NetAppException:"}],"source_content_type":"text/x-python","patch_set":2,"id":"2da6bf2d_4da6d77a","line":2808,"range":{"start_line":2808,"start_character":0,"end_line":2808,"end_character":0},"in_reply_to":"c47bd614_38172bb5","updated":"2021-08-31 15:38:37.000000000","message":"I\u0027ve defaulted to 1, because the math there would result in something less than one. I\u0027ll change it to ceiling to preserve the math as much as possible instead.","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"}],"manila/tests/share/test_manager.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"43ed8ef35086a8a7d02acf27a14dbe37243dfdf6","unresolved":true,"context_lines":[{"line_number":234,"context_line":"        self.mock_object(self.share_manager.driver, \u0027do_setup\u0027,"},{"line_number":235,"context_line":"                         mock.Mock(side_effect\u003dException()))"},{"line_number":236,"context_line":"        # break the endless retry loop"},{"line_number":237,"context_line":"        with mock.patch(\u0027time.sleep\u0027) as mock_sleep:"},{"line_number":238,"context_line":"            mock_sleep.side_effect \u003d CustomTimeSleepException()"},{"line_number":239,"context_line":"            self.assertRaises(CustomTimeSleepException,"},{"line_number":240,"context_line":"                              self.share_manager.init_host)"},{"line_number":241,"context_line":"        self.assertRaises("}],"source_content_type":"text/x-python","patch_set":2,"id":"78c8a54e_07298b0b","line":238,"range":{"start_line":237,"start_character":7,"end_line":238,"end_character":63},"updated":"2021-08-31 07:12:19.000000000","message":"You should be able to mock tenacity.nap.sleep","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"},{"author":{"_account_id":32594,"name":"Ashley Rodriguez","email":"ashrod98@redhat.com","username":"ashrod98"},"change_message_id":"a232cee2dd5045e58b4070b03bb894d171bcdf16","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        self.mock_object(self.share_manager.driver, \u0027do_setup\u0027,"},{"line_number":235,"context_line":"                         mock.Mock(side_effect\u003dException()))"},{"line_number":236,"context_line":"        # break the endless retry loop"},{"line_number":237,"context_line":"        with mock.patch(\u0027time.sleep\u0027) as mock_sleep:"},{"line_number":238,"context_line":"            mock_sleep.side_effect \u003d CustomTimeSleepException()"},{"line_number":239,"context_line":"            self.assertRaises(CustomTimeSleepException,"},{"line_number":240,"context_line":"                              self.share_manager.init_host)"},{"line_number":241,"context_line":"        self.assertRaises("}],"source_content_type":"text/x-python","patch_set":2,"id":"27b05c29_cbffafea","line":238,"range":{"start_line":237,"start_character":7,"end_line":238,"end_character":63},"in_reply_to":"78c8a54e_07298b0b","updated":"2021-08-31 15:38:37.000000000","message":"Ack","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"}],"manila/tests/test_utils.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"43ed8ef35086a8a7d02acf27a14dbe37243dfdf6","unresolved":true,"context_lines":[{"line_number":713,"context_line":"        self.assertRaises(exception, raise_non_retriable_exit_code)"},{"line_number":714,"context_line":"        sleep_mock.assert_not_called()"},{"line_number":715,"context_line":""},{"line_number":716,"context_line":"    @mock.patch(\u0027tenacity.Retrying\u0027)"},{"line_number":717,"context_line":"    def test_infinite_retry(self, retry_base):"},{"line_number":718,"context_line":"        exceptions \u003d exception.ManilaException"},{"line_number":719,"context_line":""},{"line_number":720,"context_line":"        @utils.retry(retry\u003dutils.retry_if_exit_code,"},{"line_number":721,"context_line":"                     retry_param\u003dexceptions,"},{"line_number":722,"context_line":"                     infinite\u003dTrue)"},{"line_number":723,"context_line":"        def raise_retriable_exit_code():"},{"line_number":724,"context_line":"            pass"},{"line_number":725,"context_line":""},{"line_number":726,"context_line":"        Retrying.retry.assert_called_once_with(stop\u003dtenacity.stop.stop_never)"},{"line_number":727,"context_line":"        # retry_base.retry.assert_called_once_with(stop\u003dtenacity.stop.stop_never)"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":""},{"line_number":730,"context_line":"@ddt.ddt"}],"source_content_type":"text/x-python","patch_set":2,"id":"67dc5105_5fcd01a7","line":727,"range":{"start_line":716,"start_character":1,"end_line":727,"end_character":81},"updated":"2021-08-31 07:12:19.000000000","message":"Mocking a an external class\u0027s init method can be a bit more complex. Here\u0027s what this can be done like:\n\n\n      def test_infinite_retry(self):\n        retry_param \u003d exception.ManilaException\n\n        class FakeTenacityRetry(tenacity.Retrying):\n            def __init__(*args, **kwargs):\n                pass\n\n        with mock.patch(\u0027tenacity.Retrying\u0027,\n                        autospec\u003dFakeTenacityRetry) as tenacity_retry:\n\n            @utils.retry(retry_param\u003dretry_param,\n                         wait_random\u003dTrue,\n                         infinite\u003dTrue)\n            def some_retriable_function():\n                pass\n\n            some_retriable_function()\n\n            tenacity_retry.assert_called_once_with(\n                sleep\u003dtenacity.nap.sleep,\n                before_sleep\u003dmock.ANY,\n                after\u003dmock.ANY,\n                stop\u003dtenacity.stop.stop_never,\n                reraise\u003dTrue,\n                retry\u003dutils.IsAMatcher(tenacity.retry_if_exception_type),\n                wait\u003dutils.IsAMatcher(tenacity.wait_random_exponential))","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"},{"author":{"_account_id":32594,"name":"Ashley Rodriguez","email":"ashrod98@redhat.com","username":"ashrod98"},"change_message_id":"a232cee2dd5045e58b4070b03bb894d171bcdf16","unresolved":false,"context_lines":[{"line_number":713,"context_line":"        self.assertRaises(exception, raise_non_retriable_exit_code)"},{"line_number":714,"context_line":"        sleep_mock.assert_not_called()"},{"line_number":715,"context_line":""},{"line_number":716,"context_line":"    @mock.patch(\u0027tenacity.Retrying\u0027)"},{"line_number":717,"context_line":"    def test_infinite_retry(self, retry_base):"},{"line_number":718,"context_line":"        exceptions \u003d exception.ManilaException"},{"line_number":719,"context_line":""},{"line_number":720,"context_line":"        @utils.retry(retry\u003dutils.retry_if_exit_code,"},{"line_number":721,"context_line":"                     retry_param\u003dexceptions,"},{"line_number":722,"context_line":"                     infinite\u003dTrue)"},{"line_number":723,"context_line":"        def raise_retriable_exit_code():"},{"line_number":724,"context_line":"            pass"},{"line_number":725,"context_line":""},{"line_number":726,"context_line":"        Retrying.retry.assert_called_once_with(stop\u003dtenacity.stop.stop_never)"},{"line_number":727,"context_line":"        # retry_base.retry.assert_called_once_with(stop\u003dtenacity.stop.stop_never)"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":""},{"line_number":730,"context_line":"@ddt.ddt"}],"source_content_type":"text/x-python","patch_set":2,"id":"388aa474_55d33bfa","line":727,"range":{"start_line":716,"start_character":1,"end_line":727,"end_character":81},"in_reply_to":"67dc5105_5fcd01a7","updated":"2021-08-31 15:38:37.000000000","message":"Done","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"}],"manila/utils.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"43ed8ef35086a8a7d02acf27a14dbe37243dfdf6","unresolved":true,"context_lines":[{"line_number":53,"context_line":"from manila import exception"},{"line_number":54,"context_line":"from manila.i18n import _"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"# The following section is needed to be able to mock out the sleep calls that"},{"line_number":57,"context_line":"# happen in the tenacity retry handling. We save off the real time.sleep for"},{"line_number":58,"context_line":"# later and so it can be mocked in unit tests for the sleep call that tenacity"},{"line_number":59,"context_line":"# makes. But we don\u0027t want all time.sleep calls to be modified, so after"},{"line_number":60,"context_line":"# loading the tenacity module, we restore things back to normal. End result is"},{"line_number":61,"context_line":"# only the tenacity sleep calls go through the method that we can mock,"},{"line_number":62,"context_line":"# everything else works as normal."},{"line_number":63,"context_line":"_time_sleep \u003d time.sleep"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"def _sleep(duration):"},{"line_number":67,"context_line":"    \"\"\"Helper class to make it easier to mock retry sleeping.\"\"\""},{"line_number":68,"context_line":"    _time_sleep(duration)"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"time.sleep \u003d _sleep"},{"line_number":72,"context_line":"import tenacity  # noqa"},{"line_number":73,"context_line":"time.sleep \u003d _time_sleep"},{"line_number":74,"context_line":"# End of time"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"CONF \u003d cfg.CONF"},{"line_number":77,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":78,"context_line":"if hasattr(\u0027CONF\u0027, \u0027debug\u0027) and CONF.debug:"}],"source_content_type":"text/x-python","patch_set":2,"id":"a811e71e_198bd41b","line":75,"range":{"start_line":56,"start_character":0,"end_line":75,"end_character":0},"updated":"2021-08-31 07:12:19.000000000","message":"This is roundabout, and thankfully no longer needed. See a corresponding change in cinder that removed this, and just mocked \"tenacity.nap.sleep\": https://github.com/openstack/cinder/commit/ce5709d0e27413b56d8a645d9e6c9bfe46267035","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"},{"author":{"_account_id":32594,"name":"Ashley Rodriguez","email":"ashrod98@redhat.com","username":"ashrod98"},"change_message_id":"a232cee2dd5045e58b4070b03bb894d171bcdf16","unresolved":false,"context_lines":[{"line_number":53,"context_line":"from manila import exception"},{"line_number":54,"context_line":"from manila.i18n import _"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"# The following section is needed to be able to mock out the sleep calls that"},{"line_number":57,"context_line":"# happen in the tenacity retry handling. We save off the real time.sleep for"},{"line_number":58,"context_line":"# later and so it can be mocked in unit tests for the sleep call that tenacity"},{"line_number":59,"context_line":"# makes. But we don\u0027t want all time.sleep calls to be modified, so after"},{"line_number":60,"context_line":"# loading the tenacity module, we restore things back to normal. End result is"},{"line_number":61,"context_line":"# only the tenacity sleep calls go through the method that we can mock,"},{"line_number":62,"context_line":"# everything else works as normal."},{"line_number":63,"context_line":"_time_sleep \u003d time.sleep"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"def _sleep(duration):"},{"line_number":67,"context_line":"    \"\"\"Helper class to make it easier to mock retry sleeping.\"\"\""},{"line_number":68,"context_line":"    _time_sleep(duration)"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"time.sleep \u003d _sleep"},{"line_number":72,"context_line":"import tenacity  # noqa"},{"line_number":73,"context_line":"time.sleep \u003d _time_sleep"},{"line_number":74,"context_line":"# End of time"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"CONF \u003d cfg.CONF"},{"line_number":77,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":78,"context_line":"if hasattr(\u0027CONF\u0027, \u0027debug\u0027) and CONF.debug:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1e6c9a0b_7b83fa4d","line":75,"range":{"start_line":56,"start_character":0,"end_line":75,"end_character":0},"in_reply_to":"a811e71e_198bd41b","updated":"2021-08-31 15:38:37.000000000","message":"Ack","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"43ed8ef35086a8a7d02acf27a14dbe37243dfdf6","unresolved":true,"context_lines":[{"line_number":490,"context_line":"                exc.exit_code in self.codes)"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":""},{"line_number":493,"context_line":"def retry(retry_param: Optional[Type[Exception]],"},{"line_number":494,"context_line":"          interval: int \u003d 1,"},{"line_number":495,"context_line":"          retries: int \u003d 3,"},{"line_number":496,"context_line":"          backoff_rate: int \u003d 2,"},{"line_number":497,"context_line":"          wait_random: bool \u003d False,"},{"line_number":498,"context_line":"          infinite\u003dFalse,"},{"line_number":499,"context_line":"          retry\u003dtenacity.retry_if_exception_type) -\u003e Callable:"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"    if retries \u003c 1:"},{"line_number":502,"context_line":"        raise ValueError(\u0027Retries must be greater than or \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"df4e5236_2562f56a","line":499,"range":{"start_line":493,"start_character":10,"end_line":499,"end_character":62},"updated":"2021-08-31 07:12:19.000000000","message":"nit: adding type hints here is okay, but, we have no way currently of statically validating these during our checks, which means we would only hit programming errors at runtime: https://mypy.readthedocs.io/en/stable/","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"},{"author":{"_account_id":32594,"name":"Ashley Rodriguez","email":"ashrod98@redhat.com","username":"ashrod98"},"change_message_id":"a232cee2dd5045e58b4070b03bb894d171bcdf16","unresolved":false,"context_lines":[{"line_number":490,"context_line":"                exc.exit_code in self.codes)"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":""},{"line_number":493,"context_line":"def retry(retry_param: Optional[Type[Exception]],"},{"line_number":494,"context_line":"          interval: int \u003d 1,"},{"line_number":495,"context_line":"          retries: int \u003d 3,"},{"line_number":496,"context_line":"          backoff_rate: int \u003d 2,"},{"line_number":497,"context_line":"          wait_random: bool \u003d False,"},{"line_number":498,"context_line":"          infinite\u003dFalse,"},{"line_number":499,"context_line":"          retry\u003dtenacity.retry_if_exception_type) -\u003e Callable:"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"    if retries \u003c 1:"},{"line_number":502,"context_line":"        raise ValueError(\u0027Retries must be greater than or \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"06856c49_8f2183f0","line":499,"range":{"start_line":493,"start_character":10,"end_line":499,"end_character":62},"in_reply_to":"df4e5236_2562f56a","updated":"2021-08-31 15:38:37.000000000","message":"Ack","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"43ed8ef35086a8a7d02acf27a14dbe37243dfdf6","unresolved":true,"context_lines":[{"line_number":503,"context_line":"                         \u0027equal to 1 (received: %s). \u0027 % retries)"},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"    if wait_random:"},{"line_number":506,"context_line":"        wait \u003d tenacity.wait_random_exponential(multiplier\u003dinterval)"},{"line_number":507,"context_line":"    else:"},{"line_number":508,"context_line":"        wait \u003d tenacity.wait_exponential("},{"line_number":509,"context_line":"            multiplier\u003dinterval, min\u003d0, exp_base\u003dbackoff_rate)"},{"line_number":510,"context_line":""},{"line_number":511,"context_line":"    if infinite:"},{"line_number":512,"context_line":"        stop \u003d tenacity.stop.stop_never"}],"source_content_type":"text/x-python","patch_set":2,"id":"74dd6ba7_a9cecd10","line":509,"range":{"start_line":506,"start_character":7,"end_line":509,"end_character":62},"updated":"2021-08-31 07:12:19.000000000","message":"both of these methods (wait_random_exponential and wait_exponential) support specifying a max wait time:\nhttps://tenacity.readthedocs.io/en/latest/api.html#tenacity.wait.wait_random_exponential\nhttps://tenacity.readthedocs.io/en/latest/api.html#tenacity.wait.wait_exponential\n\nWe should support that parameter as backoff_sleep_max, because we were setting it to 10 minutes (600000 milliseconds) when doing an infinite retry: https://opendev.org/openstack/manila/src/commit/b50a0bb9deb6842e45b40f30d56f18b31c9fdd03/manila/share/manager.py#L334-L339","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"},{"author":{"_account_id":32594,"name":"Ashley Rodriguez","email":"ashrod98@redhat.com","username":"ashrod98"},"change_message_id":"a232cee2dd5045e58b4070b03bb894d171bcdf16","unresolved":false,"context_lines":[{"line_number":503,"context_line":"                         \u0027equal to 1 (received: %s). \u0027 % retries)"},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"    if wait_random:"},{"line_number":506,"context_line":"        wait \u003d tenacity.wait_random_exponential(multiplier\u003dinterval)"},{"line_number":507,"context_line":"    else:"},{"line_number":508,"context_line":"        wait \u003d tenacity.wait_exponential("},{"line_number":509,"context_line":"            multiplier\u003dinterval, min\u003d0, exp_base\u003dbackoff_rate)"},{"line_number":510,"context_line":""},{"line_number":511,"context_line":"    if infinite:"},{"line_number":512,"context_line":"        stop \u003d tenacity.stop.stop_never"}],"source_content_type":"text/x-python","patch_set":2,"id":"e952f751_eeaf7ddc","line":509,"range":{"start_line":506,"start_character":7,"end_line":509,"end_character":62},"in_reply_to":"74dd6ba7_a9cecd10","updated":"2021-08-31 15:38:37.000000000","message":"Ack","commit_id":"e458e9e164eed6993322a024011d6ed5eba436d9"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"f65044189a217b0471d0a66fcd7353ef76d22a8c","unresolved":true,"context_lines":[{"line_number":43,"context_line":"from oslo_utils import timeutils"},{"line_number":44,"context_line":"import paramiko"},{"line_number":45,"context_line":"import six"},{"line_number":46,"context_line":"from typing import Callable"},{"line_number":47,"context_line":"from webob import exc"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7f072815_5f648d91","line":46,"range":{"start_line":46,"start_character":0,"end_line":46,"end_character":27},"updated":"2021-09-01 21:35:48.000000000","message":"nit: not necessary right now, lets do type hinting in a separate effort","commit_id":"c80b871af417f66935d47a6ddbcbfade1ed47497"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"7af9efd62e40e6f35f58a4480d1daaf72c3904dd","unresolved":true,"context_lines":[{"line_number":471,"context_line":""},{"line_number":472,"context_line":"def retry(retry_param\u003dException,"},{"line_number":473,"context_line":"          interval\u003d1,"},{"line_number":474,"context_line":"          retries\u003d3,"},{"line_number":475,"context_line":"          backoff_rate\u003d2,"},{"line_number":476,"context_line":"          backoff_sleep_max\u003d60,"},{"line_number":477,"context_line":"          wait_random\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":6,"id":"e19d570b_b45d8b62","line":474,"range":{"start_line":474,"start_character":10,"end_line":474,"end_character":20},"updated":"2021-09-01 21:47:59.000000000","message":"Previously we defaulted to 10 retries, we should preserve this since that\u0027s the behavior that\u0027s assumed in many places across this code base.","commit_id":"58f5544bf60c5b8be04135026c7e5bd5ea29b42f"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"7af9efd62e40e6f35f58a4480d1daaf72c3904dd","unresolved":true,"context_lines":[{"line_number":473,"context_line":"          interval\u003d1,"},{"line_number":474,"context_line":"          retries\u003d3,"},{"line_number":475,"context_line":"          backoff_rate\u003d2,"},{"line_number":476,"context_line":"          backoff_sleep_max\u003d60,"},{"line_number":477,"context_line":"          wait_random\u003dFalse,"},{"line_number":478,"context_line":"          infinite\u003dFalse,"},{"line_number":479,"context_line":"          retry\u003dtenacity.retry_if_exception_type):"}],"source_content_type":"text/x-python","patch_set":6,"id":"f3955ec9_b3cd2cc0","line":476,"range":{"start_line":476,"start_character":0,"end_line":476,"end_character":31},"updated":"2021-09-01 21:47:59.000000000","message":"We shouldn\u0027t cap this - if unspecified, we should just not send this parameter to tenacity","commit_id":"58f5544bf60c5b8be04135026c7e5bd5ea29b42f"}]}
