)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"c17a6aec1a35e9c6f7347a8ead46257d50c55dc1","unresolved":false,"context_lines":[{"line_number":10,"context_line":"retry and timeout options part of the watcher_datasources config group."},{"line_number":11,"context_line":"This makes the query_retry behavior uniform across all datasources."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"A new baseclass method named query_retry_error is added so datasources"},{"line_number":14,"context_line":"can define operations to perform when recovering from a query error."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I33e9dc2d1f5ba8f83fcf1488ff583ca5be5529cc"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"bfb3d3c7_54f63465","line":13,"range":{"start_line":13,"start_character":29,"end_line":13,"end_character":46},"updated":"2019-05-29 13:52:20.000000000","message":"nit: query_retry_reset","commit_id":"689591f311f67dca92f7591ebfc78b766551d5ab"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"cf375ddbefea478fd52b1c7b897628cba85a6c50","unresolved":false,"context_lines":[{"line_number":10,"context_line":"retry and timeout options part of the watcher_datasources config group."},{"line_number":11,"context_line":"This makes the query_retry behavior uniform across all datasources."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"A new baseclass method named query_retry_error is added so datasources"},{"line_number":14,"context_line":"can define operations to perform when recovering from a query error."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I33e9dc2d1f5ba8f83fcf1488ff583ca5be5529cc"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"bfb3d3c7_152af62a","line":13,"range":{"start_line":13,"start_character":29,"end_line":13,"end_character":46},"in_reply_to":"bfb3d3c7_54f63465","updated":"2019-05-29 15:18:45.000000000","message":"Done","commit_id":"689591f311f67dca92f7591ebfc78b766551d5ab"}],"releasenotes/notes/datasource-query-retry-00cba5f7e68aec39.yaml":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79496678b574365fe96e9dde08fcfcde009b52b9","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    which can be adjusted from the configuration. These configuration"},{"line_number":7,"context_line":"    options can be found in the `[watcher_datasources]` group and are named"},{"line_number":8,"context_line":"    `query_max_retries` and `query_timeout`."},{"line_number":9,"context_line":"upgrade:"},{"line_number":10,"context_line":"  - |"},{"line_number":11,"context_line":"    If Gnocchi was configured to have a custom amount of retries and or a"},{"line_number":12,"context_line":"    custom timeout then the configuration needs to moved into the"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"9fb8cfa7_ce4dc59a","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":7},"updated":"2019-06-11 23:49:44.000000000","message":"You also added min\u003d values to each option so you should probably note that here - or split that out into a separate change since it\u0027s an additional complexity to moving the options. i.e. if I was setting query_max_retries\u003d0 to disable retries my service will now not start with a ValueError when parsing the option. If we\u0027re going to enforce a min value on these, I\u0027d probably write a separate change in Train that checks if the values are less than 1, log a warning and then enforce the minimum in U.","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"017b8d63fd7c3ef2348724d8a67985ae6deb23b1","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    which can be adjusted from the configuration. These configuration"},{"line_number":7,"context_line":"    options can be found in the `[watcher_datasources]` group and are named"},{"line_number":8,"context_line":"    `query_max_retries` and `query_timeout`."},{"line_number":9,"context_line":"upgrade:"},{"line_number":10,"context_line":"  - |"},{"line_number":11,"context_line":"    If Gnocchi was configured to have a custom amount of retries and or a"},{"line_number":12,"context_line":"    custom timeout then the configuration needs to moved into the"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"9fb8cfa7_5da2e0fd","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":7},"in_reply_to":"9fb8cfa7_ce4dc59a","updated":"2019-06-12 11:35:57.000000000","message":"If you would have query_max_retries\u003d0 all attempts to retrieve metrics will result in a DataSourceNotAvailable exception as the `for i in range(num_retries)` \n\nloop will never be entered. I think it is better to stop the service from starting and address that this value is constrained. Although I think it is extremely unlike someone will actually use this value as it would stop the datasource from functioning.","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79496678b574365fe96e9dde08fcfcde009b52b9","unresolved":false,"context_lines":[{"line_number":14,"context_line":"deprecations:"},{"line_number":15,"context_line":"  - |"},{"line_number":16,"context_line":"    The configuration options for query retries in `[gnocchi_client]` are"},{"line_number":17,"context_line":"    deprecated and the option in \u0027[watcher_datasources]\u0027 should now be used."}],"source_content_type":"text/x-yaml","patch_set":5,"id":"9fb8cfa7_0e7e7dae","line":17,"range":{"start_line":17,"start_character":55,"end_line":17,"end_character":56},"updated":"2019-06-11 23:49:44.000000000","message":"and here","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79496678b574365fe96e9dde08fcfcde009b52b9","unresolved":false,"context_lines":[{"line_number":14,"context_line":"deprecations:"},{"line_number":15,"context_line":"  - |"},{"line_number":16,"context_line":"    The configuration options for query retries in `[gnocchi_client]` are"},{"line_number":17,"context_line":"    deprecated and the option in \u0027[watcher_datasources]\u0027 should now be used."}],"source_content_type":"text/x-yaml","patch_set":5,"id":"9fb8cfa7_6e75b9ca","line":17,"range":{"start_line":17,"start_character":33,"end_line":17,"end_character":34},"updated":"2019-06-11 23:49:44.000000000","message":"nit: be consistent and use a back-tick here","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"017b8d63fd7c3ef2348724d8a67985ae6deb23b1","unresolved":false,"context_lines":[{"line_number":14,"context_line":"deprecations:"},{"line_number":15,"context_line":"  - |"},{"line_number":16,"context_line":"    The configuration options for query retries in `[gnocchi_client]` are"},{"line_number":17,"context_line":"    deprecated and the option in \u0027[watcher_datasources]\u0027 should now be used."}],"source_content_type":"text/x-yaml","patch_set":5,"id":"9fb8cfa7_fd2f1485","line":17,"range":{"start_line":17,"start_character":55,"end_line":17,"end_character":56},"in_reply_to":"9fb8cfa7_0e7e7dae","updated":"2019-06-12 11:35:57.000000000","message":"Done","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"017b8d63fd7c3ef2348724d8a67985ae6deb23b1","unresolved":false,"context_lines":[{"line_number":14,"context_line":"deprecations:"},{"line_number":15,"context_line":"  - |"},{"line_number":16,"context_line":"    The configuration options for query retries in `[gnocchi_client]` are"},{"line_number":17,"context_line":"    deprecated and the option in \u0027[watcher_datasources]\u0027 should now be used."}],"source_content_type":"text/x-yaml","patch_set":5,"id":"9fb8cfa7_bd53dc16","line":17,"range":{"start_line":17,"start_character":33,"end_line":17,"end_character":34},"in_reply_to":"9fb8cfa7_6e75b9ca","updated":"2019-06-12 11:35:57.000000000","message":"Done","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"}],"watcher/conf/datasources.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cd0ea78df63cc84af2f66d444b06b47d749da2f6","unresolved":false,"context_lines":[{"line_number":35,"context_line":"                     \" specific override.\","},{"line_number":36,"context_line":"                item_type\u003dcfg.types.String(choices\u003dpossible_datasources),"},{"line_number":37,"context_line":"                default\u003dpossible_datasources),"},{"line_number":38,"context_line":"    cfg.IntOpt(\u0027query_max_retries\u0027,"},{"line_number":39,"context_line":"               default\u003d10,"},{"line_number":40,"context_line":"               mutable\u003dTrue,"},{"line_number":41,"context_line":"               help\u003d\u0027How many times Watcher is trying to query again\u0027),"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_dbc0bc53","line":38,"updated":"2019-06-03 16:53:44.000000000","message":"In a future change we may want to consider adding lower bound min kwargs to these two options so someone can\u0027t set negative or 0 for values unless those are supported, e.g. to disable retries.","commit_id":"0c814f7315271bd73343ccb708a2fa4d19837b32"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"7cd0753162285bee718967058c978415c3c84b45","unresolved":false,"context_lines":[{"line_number":35,"context_line":"                     \" specific override.\","},{"line_number":36,"context_line":"                item_type\u003dcfg.types.String(choices\u003dpossible_datasources),"},{"line_number":37,"context_line":"                default\u003dpossible_datasources),"},{"line_number":38,"context_line":"    cfg.IntOpt(\u0027query_max_retries\u0027,"},{"line_number":39,"context_line":"               default\u003d10,"},{"line_number":40,"context_line":"               mutable\u003dTrue,"},{"line_number":41,"context_line":"               help\u003d\u0027How many times Watcher is trying to query again\u0027),"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_3cb5c97e","line":38,"in_reply_to":"9fb8cfa7_dbc0bc53","updated":"2019-06-11 12:12:10.000000000","message":"Done","commit_id":"0c814f7315271bd73343ccb708a2fa4d19837b32"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79496678b574365fe96e9dde08fcfcde009b52b9","unresolved":false,"context_lines":[{"line_number":35,"context_line":"                     \" specific override.\","},{"line_number":36,"context_line":"                item_type\u003dcfg.types.String(choices\u003dpossible_datasources),"},{"line_number":37,"context_line":"                default\u003dpossible_datasources),"},{"line_number":38,"context_line":"    cfg.IntOpt(\u0027query_max_retries\u0027,"},{"line_number":39,"context_line":"               min\u003d1,"},{"line_number":40,"context_line":"               default\u003d10,"},{"line_number":41,"context_line":"               mutable\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_393dc9c3","line":38,"updated":"2019-06-11 23:49:44.000000000","message":"Add deprecated_group\u003d\"gnocchi_client\".","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"017b8d63fd7c3ef2348724d8a67985ae6deb23b1","unresolved":false,"context_lines":[{"line_number":35,"context_line":"                     \" specific override.\","},{"line_number":36,"context_line":"                item_type\u003dcfg.types.String(choices\u003dpossible_datasources),"},{"line_number":37,"context_line":"                default\u003dpossible_datasources),"},{"line_number":38,"context_line":"    cfg.IntOpt(\u0027query_max_retries\u0027,"},{"line_number":39,"context_line":"               min\u003d1,"},{"line_number":40,"context_line":"               default\u003d10,"},{"line_number":41,"context_line":"               mutable\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_822479b0","line":38,"in_reply_to":"9fb8cfa7_393dc9c3","updated":"2019-06-12 11:35:57.000000000","message":"Done","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79496678b574365fe96e9dde08fcfcde009b52b9","unresolved":false,"context_lines":[{"line_number":36,"context_line":"                item_type\u003dcfg.types.String(choices\u003dpossible_datasources),"},{"line_number":37,"context_line":"                default\u003dpossible_datasources),"},{"line_number":38,"context_line":"    cfg.IntOpt(\u0027query_max_retries\u0027,"},{"line_number":39,"context_line":"               min\u003d1,"},{"line_number":40,"context_line":"               default\u003d10,"},{"line_number":41,"context_line":"               mutable\u003dTrue,"},{"line_number":42,"context_line":"               help\u003d\u0027How many times Watcher is trying to query again\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_8e382dee","line":39,"updated":"2019-06-11 23:49:44.000000000","message":"As noted in the release note, I\u0027d be a bit hesitant to munge this into this change, it\u0027s probably better to do it separately since it\u0027s a behavioral change in addition to moving the options around, and is likely something we\u0027d want to check for in T, warn if less than 1, and then restrict in U.","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c51998048018048c494346202bea71c1fbf7890a","unresolved":false,"context_lines":[{"line_number":36,"context_line":"                item_type\u003dcfg.types.String(choices\u003dpossible_datasources),"},{"line_number":37,"context_line":"                default\u003dpossible_datasources),"},{"line_number":38,"context_line":"    cfg.IntOpt(\u0027query_max_retries\u0027,"},{"line_number":39,"context_line":"               min\u003d1,"},{"line_number":40,"context_line":"               default\u003d10,"},{"line_number":41,"context_line":"               mutable\u003dTrue,"},{"line_number":42,"context_line":"               help\u003d\u0027How many times Watcher is trying to query again\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_dfe563dd","line":39,"in_reply_to":"9fb8cfa7_4223e1bd","updated":"2019-06-12 14:07:21.000000000","message":"OK fair enough.","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"017b8d63fd7c3ef2348724d8a67985ae6deb23b1","unresolved":false,"context_lines":[{"line_number":36,"context_line":"                item_type\u003dcfg.types.String(choices\u003dpossible_datasources),"},{"line_number":37,"context_line":"                default\u003dpossible_datasources),"},{"line_number":38,"context_line":"    cfg.IntOpt(\u0027query_max_retries\u0027,"},{"line_number":39,"context_line":"               min\u003d1,"},{"line_number":40,"context_line":"               default\u003d10,"},{"line_number":41,"context_line":"               mutable\u003dTrue,"},{"line_number":42,"context_line":"               help\u003d\u0027How many times Watcher is trying to query again\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_4223e1bd","line":39,"in_reply_to":"9fb8cfa7_8e382dee","updated":"2019-06-12 11:35:57.000000000","message":"If anyone would have set it 0 or less than using any datasource will simply stop working because it would never enter `for i in range(num_retries)` anymore. \n\nSo there is no difference in behavior but at least the users will get a meaningful error that the value is below the minimum instead of getting the DataSourceNotAvailable exception.","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79496678b574365fe96e9dde08fcfcde009b52b9","unresolved":false,"context_lines":[{"line_number":40,"context_line":"               default\u003d10,"},{"line_number":41,"context_line":"               mutable\u003dTrue,"},{"line_number":42,"context_line":"               help\u003d\u0027How many times Watcher is trying to query again\u0027),"},{"line_number":43,"context_line":"    cfg.IntOpt(\u0027query_timeout\u0027,"},{"line_number":44,"context_line":"               min\u003d0,"},{"line_number":45,"context_line":"               default\u003d1,"},{"line_number":46,"context_line":"               mutable\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_593afdcb","line":43,"updated":"2019-06-11 23:49:44.000000000","message":"Add deprecated_group\u003d\"gnocchi_client\".","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"017b8d63fd7c3ef2348724d8a67985ae6deb23b1","unresolved":false,"context_lines":[{"line_number":40,"context_line":"               default\u003d10,"},{"line_number":41,"context_line":"               mutable\u003dTrue,"},{"line_number":42,"context_line":"               help\u003d\u0027How many times Watcher is trying to query again\u0027),"},{"line_number":43,"context_line":"    cfg.IntOpt(\u0027query_timeout\u0027,"},{"line_number":44,"context_line":"               min\u003d0,"},{"line_number":45,"context_line":"               default\u003d1,"},{"line_number":46,"context_line":"               mutable\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_e23215f2","line":43,"in_reply_to":"9fb8cfa7_593afdcb","updated":"2019-06-12 11:35:57.000000000","message":"Done","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79496678b574365fe96e9dde08fcfcde009b52b9","unresolved":false,"context_lines":[{"line_number":41,"context_line":"               mutable\u003dTrue,"},{"line_number":42,"context_line":"               help\u003d\u0027How many times Watcher is trying to query again\u0027),"},{"line_number":43,"context_line":"    cfg.IntOpt(\u0027query_timeout\u0027,"},{"line_number":44,"context_line":"               min\u003d0,"},{"line_number":45,"context_line":"               default\u003d1,"},{"line_number":46,"context_line":"               mutable\u003dTrue,"},{"line_number":47,"context_line":"               help\u003d\u0027How many seconds Watcher should wait to do query again\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_4e26b5d0","line":44,"range":{"start_line":44,"start_character":19,"end_line":44,"end_character":20},"updated":"2019-06-11 23:49:44.000000000","message":"0 or 1?","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c51998048018048c494346202bea71c1fbf7890a","unresolved":false,"context_lines":[{"line_number":41,"context_line":"               mutable\u003dTrue,"},{"line_number":42,"context_line":"               help\u003d\u0027How many times Watcher is trying to query again\u0027),"},{"line_number":43,"context_line":"    cfg.IntOpt(\u0027query_timeout\u0027,"},{"line_number":44,"context_line":"               min\u003d0,"},{"line_number":45,"context_line":"               default\u003d1,"},{"line_number":46,"context_line":"               mutable\u003dTrue,"},{"line_number":47,"context_line":"               help\u003d\u0027How many seconds Watcher should wait to do query again\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_ffe867b3","line":44,"range":{"start_line":44,"start_character":19,"end_line":44,"end_character":20},"in_reply_to":"9fb8cfa7_3d3a8ccb","updated":"2019-06-12 14:07:21.000000000","message":"ack","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"017b8d63fd7c3ef2348724d8a67985ae6deb23b1","unresolved":false,"context_lines":[{"line_number":41,"context_line":"               mutable\u003dTrue,"},{"line_number":42,"context_line":"               help\u003d\u0027How many times Watcher is trying to query again\u0027),"},{"line_number":43,"context_line":"    cfg.IntOpt(\u0027query_timeout\u0027,"},{"line_number":44,"context_line":"               min\u003d0,"},{"line_number":45,"context_line":"               default\u003d1,"},{"line_number":46,"context_line":"               mutable\u003dTrue,"},{"line_number":47,"context_line":"               help\u003d\u0027How many seconds Watcher should wait to do query again\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_3d3a8ccb","line":44,"range":{"start_line":44,"start_character":19,"end_line":44,"end_character":20},"in_reply_to":"9fb8cfa7_4e26b5d0","updated":"2019-06-12 11:35:57.000000000","message":"A timeout of 0 (retry immediately) seems fine to me. It should not be negative as calling time.sleep with a negative value will trigger a ValueError.\n\nThis also does not introduce a behavioral change since having a value below 0 would already cause an exception to occur but this provides a more meaningful error message the ValueError would.","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"}],"watcher/conf/gnocchi_client.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cd0ea78df63cc84af2f66d444b06b47d749da2f6","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    cfg.StrOpt(\u0027region_name\u0027,"},{"line_number":34,"context_line":"               help\u003d\u0027Region in Identity service catalog to use for \u0027"},{"line_number":35,"context_line":"                    \u0027communication with the OpenStack service.\u0027),"},{"line_number":36,"context_line":"    cfg.IntOpt(\u0027query_max_retries\u0027,"},{"line_number":37,"context_line":"               default\u003d10,"},{"line_number":38,"context_line":"               mutable\u003dTrue,"},{"line_number":39,"context_line":"               help\u003d\u0027How many times Watcher is trying to query again\u0027),"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_9b2c8448","side":"PARENT","line":36,"updated":"2019-06-03 16:53:44.000000000","message":"Moving these without deprecating them is a breaking change. You should instead deprecate them and provide an alias so if someone is using this configuration it will not break on upgrade but will be aliased to CONF.watcher_datasources.query_max_retries.\n\nhttps://docs.openstack.org/oslo.config/latest/reference/deprecating.html\n\nSo I believe in this case you\u0027d define deprecated_group\u003d\u0027gnocchi_client\u0027 on these two options. It might be worth having a test case for that as well.\n\nYou should also have an upgrade release note.","commit_id":"88fb097539f0939d7cbfc13e64c38d3ed0a3c07e"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"7cd0753162285bee718967058c978415c3c84b45","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    cfg.StrOpt(\u0027region_name\u0027,"},{"line_number":34,"context_line":"               help\u003d\u0027Region in Identity service catalog to use for \u0027"},{"line_number":35,"context_line":"                    \u0027communication with the OpenStack service.\u0027),"},{"line_number":36,"context_line":"    cfg.IntOpt(\u0027query_max_retries\u0027,"},{"line_number":37,"context_line":"               default\u003d10,"},{"line_number":38,"context_line":"               mutable\u003dTrue,"},{"line_number":39,"context_line":"               help\u003d\u0027How many times Watcher is trying to query again\u0027),"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_7cbfc160","side":"PARENT","line":36,"in_reply_to":"9fb8cfa7_9b2c8448","updated":"2019-06-11 12:12:10.000000000","message":"Done","commit_id":"88fb097539f0939d7cbfc13e64c38d3ed0a3c07e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79496678b574365fe96e9dde08fcfcde009b52b9","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    cfg.StrOpt(\u0027region_name\u0027,"},{"line_number":34,"context_line":"               help\u003d\u0027Region in Identity service catalog to use for \u0027"},{"line_number":35,"context_line":"                    \u0027communication with the OpenStack service.\u0027),"},{"line_number":36,"context_line":"    cfg.IntOpt(\u0027query_max_retries\u0027,"},{"line_number":37,"context_line":"               default\u003d0,"},{"line_number":38,"context_line":"               deprecated_for_removal\u003dTrue,"},{"line_number":39,"context_line":"               deprecated_since\u003d\"2.0.0.0rc1\","}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_ae165154","line":36,"updated":"2019-06-11 23:49:44.000000000","message":"I don\u0027t think you actually need to define the option in both places. That\u0027s why I think you can use the deprecated_group kwarg and oslo.config should provide the alias automatically as described here:\n\nhttps://docs.openstack.org/oslo.config/latest/reference/deprecating.html","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"}],"watcher/datasources/base.py":[{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"60624a1556a0ef8fd0576597677f3c1e5bc93c7f","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        to the value of query_max_retries"},{"line_number":62,"context_line":"        :param f: The method that performs the actual querying for metrics"},{"line_number":63,"context_line":"        :param args: Array of arguments supplied to the method"},{"line_number":64,"context_line":"        :param kargs: The amount of arguments supplied to the method"},{"line_number":65,"context_line":"        :return: The value as retrieved from the external service"},{"line_number":66,"context_line":"        \"\"\""},{"line_number":67,"context_line":"        for i in range(CONF.watcher_datasources.query_max_retries):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_d8d24bd1","line":64,"range":{"start_line":64,"start_character":15,"end_line":64,"end_character":20},"updated":"2019-05-30 02:20:35.000000000","message":"kwargs","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"c6c5b6fcf10f088d90ebc5615394c8592cb78a22","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        to the value of query_max_retries"},{"line_number":62,"context_line":"        :param f: The method that performs the actual querying for metrics"},{"line_number":63,"context_line":"        :param args: Array of arguments supplied to the method"},{"line_number":64,"context_line":"        :param kargs: The amount of arguments supplied to the method"},{"line_number":65,"context_line":"        :return: The value as retrieved from the external service"},{"line_number":66,"context_line":"        \"\"\""},{"line_number":67,"context_line":"        for i in range(CONF.watcher_datasources.query_max_retries):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_61104a58","line":64,"range":{"start_line":64,"start_character":15,"end_line":64,"end_character":20},"in_reply_to":"bfb3d3c7_d8d24bd1","updated":"2019-05-30 07:33:17.000000000","message":"Done","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"60624a1556a0ef8fd0576597677f3c1e5bc93c7f","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            except Exception as e:"},{"line_number":71,"context_line":"                LOG.exception(e)"},{"line_number":72,"context_line":"                self.query_retry_reset(e)"},{"line_number":73,"context_line":"                time.sleep(CONF.watcher_datasources.query_timeout)"},{"line_number":74,"context_line":"        raise exception.DataSourceNotAvailable(datasource\u003dself.NAME)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_38060722","line":73,"range":{"start_line":73,"start_character":52,"end_line":73,"end_character":65},"updated":"2019-05-30 02:20:35.000000000","message":"I think we should log the query_timeout and query_max_retries.\nIf there are something wrong, we can find it through the log file.","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"c6c5b6fcf10f088d90ebc5615394c8592cb78a22","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            except Exception as e:"},{"line_number":71,"context_line":"                LOG.exception(e)"},{"line_number":72,"context_line":"                self.query_retry_reset(e)"},{"line_number":73,"context_line":"                time.sleep(CONF.watcher_datasources.query_timeout)"},{"line_number":74,"context_line":"        raise exception.DataSourceNotAvailable(datasource\u003dself.NAME)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_cc236da6","line":73,"range":{"start_line":73,"start_character":52,"end_line":73,"end_character":65},"in_reply_to":"bfb3d3c7_38060722","updated":"2019-05-30 07:33:17.000000000","message":"Done","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"60624a1556a0ef8fd0576597677f3c1e5bc93c7f","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                LOG.exception(e)"},{"line_number":72,"context_line":"                self.query_retry_reset(e)"},{"line_number":73,"context_line":"                time.sleep(CONF.watcher_datasources.query_timeout)"},{"line_number":74,"context_line":"        raise exception.DataSourceNotAvailable(datasource\u003dself.NAME)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    @abc.abstractmethod"},{"line_number":77,"context_line":"    def query_retry_reset(self, exception):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_587adbb9","line":74,"range":{"start_line":74,"start_character":63,"end_line":74,"end_character":67},"updated":"2019-05-30 02:20:35.000000000","message":"Name isn\u0027t a member of base class.","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"c6c5b6fcf10f088d90ebc5615394c8592cb78a22","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                LOG.exception(e)"},{"line_number":72,"context_line":"                self.query_retry_reset(e)"},{"line_number":73,"context_line":"                time.sleep(CONF.watcher_datasources.query_timeout)"},{"line_number":74,"context_line":"        raise exception.DataSourceNotAvailable(datasource\u003dself.NAME)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    @abc.abstractmethod"},{"line_number":77,"context_line":"    def query_retry_reset(self, exception):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_c115764a","line":74,"range":{"start_line":74,"start_character":63,"end_line":74,"end_character":67},"in_reply_to":"bfb3d3c7_587adbb9","updated":"2019-05-30 07:33:17.000000000","message":"Done","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cd0ea78df63cc84af2f66d444b06b47d749da2f6","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        num_retries \u003d CONF.watcher_datasources.query_max_retries"},{"line_number":72,"context_line":"        timeout \u003d CONF.watcher_datasources.query_timeout"},{"line_number":73,"context_line":"        for i in range(num_retries):"},{"line_number":74,"context_line":"            try:"},{"line_number":75,"context_line":"                return f(*args, **kwargs)"},{"line_number":76,"context_line":"            except Exception as e:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_7b83d005","line":73,"updated":"2019-06-03 16:53:44.000000000","message":"Is there a test for any of this in the base class? I could think of a few tests, such as:\n\n1. test that retries are disabled via config\n2. test that we retry and then succeed on the next attempt\n3. test that we retry until timeout and fail","commit_id":"0c814f7315271bd73343ccb708a2fa4d19837b32"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"7cd0753162285bee718967058c978415c3c84b45","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        num_retries \u003d CONF.watcher_datasources.query_max_retries"},{"line_number":72,"context_line":"        timeout \u003d CONF.watcher_datasources.query_timeout"},{"line_number":73,"context_line":"        for i in range(num_retries):"},{"line_number":74,"context_line":"            try:"},{"line_number":75,"context_line":"                return f(*args, **kwargs)"},{"line_number":76,"context_line":"            except Exception as e:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_7c96e1f2","line":73,"in_reply_to":"9fb8cfa7_7b83d005","updated":"2019-06-11 12:12:10.000000000","message":"I though about this as well but it would end up verifying the behavior of a for loop which did not seem very interesting.","commit_id":"0c814f7315271bd73343ccb708a2fa4d19837b32"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"73b9e4cae46e549b944470f1fa269909278bd7f6","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        num_retries \u003d CONF.watcher_datasources.query_max_retries"},{"line_number":72,"context_line":"        timeout \u003d CONF.watcher_datasources.query_timeout"},{"line_number":73,"context_line":"        for i in range(num_retries):"},{"line_number":74,"context_line":"            try:"},{"line_number":75,"context_line":"                return f(*args, **kwargs)"},{"line_number":76,"context_line":"            except Exception as e:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_8e9cad0e","line":73,"in_reply_to":"9fb8cfa7_7c96e1f2","updated":"2019-06-11 23:38:34.000000000","message":"For all of the tests I proposed? It\u0027s less about testing how a for loop works and more about testing the logic within the loop.","commit_id":"0c814f7315271bd73343ccb708a2fa4d19837b32"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"c64a7db04c38d0be6b812ad8b9c454050da00d0d","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        num_retries \u003d CONF.watcher_datasources.query_max_retries"},{"line_number":72,"context_line":"        timeout \u003d CONF.watcher_datasources.query_timeout"},{"line_number":73,"context_line":"        for i in range(num_retries):"},{"line_number":74,"context_line":"            try:"},{"line_number":75,"context_line":"                return f(*args, **kwargs)"},{"line_number":76,"context_line":"            except Exception as e:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_5fbe53ff","line":73,"in_reply_to":"9fb8cfa7_8e9cad0e","updated":"2019-06-12 13:47:36.000000000","message":"Done","commit_id":"0c814f7315271bd73343ccb708a2fa4d19837b32"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cd0ea78df63cc84af2f66d444b06b47d749da2f6","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            except Exception as e:"},{"line_number":77,"context_line":"                LOG.exception(e)"},{"line_number":78,"context_line":"                self.query_retry_reset(e)"},{"line_number":79,"context_line":"                LOG.warning(\"Retry {0} of {1} while retrieving metrics retry\""},{"line_number":80,"context_line":"                            \"in {2} seconds\".format(i, num_retries, timeout))"},{"line_number":81,"context_line":"                time.sleep(timeout)"},{"line_number":82,"context_line":"        raise exception.DataSourceNotAvailable(datasource\u003dself.NAME)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_bbbb88e3","line":79,"range":{"start_line":79,"start_character":76,"end_line":79,"end_character":77},"updated":"2019-06-03 16:53:44.000000000","message":"need a space here","commit_id":"0c814f7315271bd73343ccb708a2fa4d19837b32"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"7cd0753162285bee718967058c978415c3c84b45","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            except Exception as e:"},{"line_number":77,"context_line":"                LOG.exception(e)"},{"line_number":78,"context_line":"                self.query_retry_reset(e)"},{"line_number":79,"context_line":"                LOG.warning(\"Retry {0} of {1} while retrieving metrics retry\""},{"line_number":80,"context_line":"                            \"in {2} seconds\".format(i, num_retries, timeout))"},{"line_number":81,"context_line":"                time.sleep(timeout)"},{"line_number":82,"context_line":"        raise exception.DataSourceNotAvailable(datasource\u003dself.NAME)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_9c9b9516","line":79,"range":{"start_line":79,"start_character":76,"end_line":79,"end_character":77},"in_reply_to":"9fb8cfa7_bbbb88e3","updated":"2019-06-11 12:12:10.000000000","message":"Done","commit_id":"0c814f7315271bd73343ccb708a2fa4d19837b32"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cd0ea78df63cc84af2f66d444b06b47d749da2f6","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                LOG.warning(\"Retry {0} of {1} while retrieving metrics retry\""},{"line_number":80,"context_line":"                            \"in {2} seconds\".format(i, num_retries, timeout))"},{"line_number":81,"context_line":"                time.sleep(timeout)"},{"line_number":82,"context_line":"        raise exception.DataSourceNotAvailable(datasource\u003dself.NAME)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @abc.abstractmethod"},{"line_number":85,"context_line":"    def query_retry_reset(self, exception_instance):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_dba51cb7","line":82,"range":{"start_line":82,"start_character":58,"end_line":82,"end_character":67},"updated":"2019-06-03 16:53:44.000000000","message":"Does watcher support out-of-tree datasources via extension point? If so, they could be broken with this (well not broken but the error message wouldn\u0027t be helpful either). Couldn\u0027t self.__class__.__name__ be used if self.NAME is blank (or just always?). I guess all of the in-tree datasources have a NAME defined so maybe this is already common practice for out of tree datasources.","commit_id":"0c814f7315271bd73343ccb708a2fa4d19837b32"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"73b9e4cae46e549b944470f1fa269909278bd7f6","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                LOG.warning(\"Retry {0} of {1} while retrieving metrics retry\""},{"line_number":80,"context_line":"                            \"in {2} seconds\".format(i, num_retries, timeout))"},{"line_number":81,"context_line":"                time.sleep(timeout)"},{"line_number":82,"context_line":"        raise exception.DataSourceNotAvailable(datasource\u003dself.NAME)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @abc.abstractmethod"},{"line_number":85,"context_line":"    def query_retry_reset(self, exception_instance):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_0ea99d22","line":82,"range":{"start_line":82,"start_character":58,"end_line":82,"end_character":67},"in_reply_to":"9fb8cfa7_3cce292d","updated":"2019-06-11 23:38:34.000000000","message":"\u003e No Watcher does not support out-of-tree datasources but does\n \u003e support many other out-of-tree components: https://docs.openstack.org/watcher/latest/contributor/plugin/base-setup.html\n\nOK I knew there were quite a few extension points so I wasn\u0027t sure about the data source.\n\n \u003e \n \u003e I think you raise a good point because it seems reasonable to me to\n \u003e be able to support datasources via the same plugin architecture.\n\nI\u0027m not necessarily advocating that - coming from nova where we really try to clamp down on the ability to extend nova so it\u0027s the total opposite - was just wondering.","commit_id":"0c814f7315271bd73343ccb708a2fa4d19837b32"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"7cd0753162285bee718967058c978415c3c84b45","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                LOG.warning(\"Retry {0} of {1} while retrieving metrics retry\""},{"line_number":80,"context_line":"                            \"in {2} seconds\".format(i, num_retries, timeout))"},{"line_number":81,"context_line":"                time.sleep(timeout)"},{"line_number":82,"context_line":"        raise exception.DataSourceNotAvailable(datasource\u003dself.NAME)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @abc.abstractmethod"},{"line_number":85,"context_line":"    def query_retry_reset(self, exception_instance):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_3cce292d","line":82,"range":{"start_line":82,"start_character":58,"end_line":82,"end_character":67},"in_reply_to":"9fb8cfa7_dba51cb7","updated":"2019-06-11 12:12:10.000000000","message":"No Watcher does not support out-of-tree datasources but does support many other out-of-tree components: https://docs.openstack.org/watcher/latest/contributor/plugin/base-setup.html\n\nI think you raise a good point because it seems reasonable to me to be able to support datasources via the same plugin architecture.","commit_id":"0c814f7315271bd73343ccb708a2fa4d19837b32"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79496678b574365fe96e9dde08fcfcde009b52b9","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                      )"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def __init__(self, osc\u003dNone):"},{"line_number":60,"context_line":"        self.query_num_retries \u003d CONF.watcher_datasources.query_max_retries"},{"line_number":61,"context_line":"        self.query_timeout \u003d CONF.watcher_datasources.query_timeout"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def query_retry(self, f, *args, **kwargs):"},{"line_number":64,"context_line":"        \"\"\"Attempts to retrieve metrics from the external service"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_3914e943","line":61,"range":{"start_line":60,"start_character":8,"end_line":61,"end_character":67},"updated":"2019-06-11 23:49:44.000000000","message":"I don\u0027t think we need this if we use deprecated_group\u003d\"gnocchi_client\" on the options in the base [watcher_datasources] group.","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"017b8d63fd7c3ef2348724d8a67985ae6deb23b1","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                      )"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def __init__(self, osc\u003dNone):"},{"line_number":60,"context_line":"        self.query_num_retries \u003d CONF.watcher_datasources.query_max_retries"},{"line_number":61,"context_line":"        self.query_timeout \u003d CONF.watcher_datasources.query_timeout"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def query_retry(self, f, *args, **kwargs):"},{"line_number":64,"context_line":"        \"\"\"Attempts to retrieve metrics from the external service"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_bd3d1c90","line":61,"range":{"start_line":60,"start_character":8,"end_line":61,"end_character":67},"in_reply_to":"9fb8cfa7_3914e943","updated":"2019-06-12 11:35:57.000000000","message":"Done","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79496678b574365fe96e9dde08fcfcde009b52b9","unresolved":false,"context_lines":[{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        num_retries \u003d self.query_num_retries"},{"line_number":76,"context_line":"        timeout \u003d self.query_timeout"},{"line_number":77,"context_line":"        for i in range(num_retries):"},{"line_number":78,"context_line":"            try:"},{"line_number":79,"context_line":"                return f(*args, **kwargs)"},{"line_number":80,"context_line":"            except Exception as e:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_b929b98a","line":77,"updated":"2019-06-11 23:49:44.000000000","message":"I still tend to think there should be tests for the logic in this loop, i.e. retry and succeed on next attempt and retry until timeout and fail.","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"}],"watcher/datasources/ceilometer.py":[{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"4ee7c877f19ffd68ed3864576d9dde88999cc749","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                          \"value\": end_timestamp})"},{"line_number":130,"context_line":"        return query"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def query_retry_reset(self, exception):"},{"line_number":133,"context_line":"        if isinstance(exception, exc.HTTPUnauthorized):"},{"line_number":134,"context_line":"            self.osc.reset_clients()"},{"line_number":135,"context_line":"            self.ceilometer \u003d self.osc.ceilometer()"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_1b9bfd17","line":132,"range":{"start_line":132,"start_character":32,"end_line":132,"end_character":41},"updated":"2019-05-30 03:28:05.000000000","message":"I suggest this var should be named such as exception_instance instead of exception, because \u0027exception\u0027 may be ambiguous by see Line 26 \"from watcher.common import exception\". \nYesterday I forgot this place.","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"c6c5b6fcf10f088d90ebc5615394c8592cb78a22","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                          \"value\": end_timestamp})"},{"line_number":130,"context_line":"        return query"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def query_retry_reset(self, exception):"},{"line_number":133,"context_line":"        if isinstance(exception, exc.HTTPUnauthorized):"},{"line_number":134,"context_line":"            self.osc.reset_clients()"},{"line_number":135,"context_line":"            self.ceilometer \u003d self.osc.ceilometer()"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_2c6249d9","line":132,"range":{"start_line":132,"start_character":32,"end_line":132,"end_character":41},"in_reply_to":"bfb3d3c7_1b9bfd17","updated":"2019-05-30 07:33:17.000000000","message":"Done","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"}],"watcher/datasources/gnocchi.py":[{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"60624a1556a0ef8fd0576597677f3c1e5bc93c7f","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class GnocchiHelper(base.DataSourceBase):"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    NAME \u003d \u0027gnocchi\u0027"},{"line_number":36,"context_line":"    METRIC_MAP \u003d dict(host_cpu_usage\u003d\u0027compute.node.cpu.percent\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_db0a451e","line":33,"range":{"start_line":33,"start_character":6,"end_line":33,"end_character":19},"updated":"2019-05-30 02:20:35.000000000","message":"No define for query_retry_reset?","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"192fe0b82d58deb86e3cf0b73dd2c579c5b86f04","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class GnocchiHelper(base.DataSourceBase):"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    NAME \u003d \u0027gnocchi\u0027"},{"line_number":36,"context_line":"    METRIC_MAP \u003d dict(host_cpu_usage\u003d\u0027compute.node.cpu.percent\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_991cc078","line":33,"range":{"start_line":33,"start_character":6,"end_line":33,"end_character":19},"in_reply_to":"bfb3d3c7_8c67b5e9","updated":"2019-05-31 02:30:35.000000000","message":"Why not do it like ceilometer?","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"fe2959a3626054b59b7a90f3574096e42e7a0842","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class GnocchiHelper(base.DataSourceBase):"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    NAME \u003d \u0027gnocchi\u0027"},{"line_number":36,"context_line":"    METRIC_MAP \u003d dict(host_cpu_usage\u003d\u0027compute.node.cpu.percent\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_d7cc3f36","line":33,"range":{"start_line":33,"start_character":6,"end_line":33,"end_character":19},"in_reply_to":"bfb3d3c7_991cc078","updated":"2019-05-31 05:44:14.000000000","message":"Because it was not done before so I do not know if that is necessary or beneficial with the Gnocchi client.","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"2784b67de043dfa44ee1d3c7a3dc1b73319dbfe5","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class GnocchiHelper(base.DataSourceBase):"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    NAME \u003d \u0027gnocchi\u0027"},{"line_number":36,"context_line":"    METRIC_MAP \u003d dict(host_cpu_usage\u003d\u0027compute.node.cpu.percent\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_570b6f28","line":33,"range":{"start_line":33,"start_character":6,"end_line":33,"end_character":19},"in_reply_to":"bfb3d3c7_b7c0abe2","updated":"2019-05-31 06:08:35.000000000","message":"Yes we could do that, but the one doing that should try to test in on devstack / teststack to see if it actually works with Gnocchi client.","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"da560435e915c12e5c3263aef541564283808d9c","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class GnocchiHelper(base.DataSourceBase):"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    NAME \u003d \u0027gnocchi\u0027"},{"line_number":36,"context_line":"    METRIC_MAP \u003d dict(host_cpu_usage\u003d\u0027compute.node.cpu.percent\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_b7c0abe2","line":33,"range":{"start_line":33,"start_character":6,"end_line":33,"end_character":19},"in_reply_to":"bfb3d3c7_d7cc3f36","updated":"2019-05-31 05:54:47.000000000","message":"After this patch be merged, We can summit another to modify gnocchi.","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"c6c5b6fcf10f088d90ebc5615394c8592cb78a22","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class GnocchiHelper(base.DataSourceBase):"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    NAME \u003d \u0027gnocchi\u0027"},{"line_number":36,"context_line":"    METRIC_MAP \u003d dict(host_cpu_usage\u003d\u0027compute.node.cpu.percent\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_8c67b5e9","line":33,"range":{"start_line":33,"start_character":6,"end_line":33,"end_character":19},"in_reply_to":"bfb3d3c7_db0a451e","updated":"2019-05-30 07:33:17.000000000","message":"Could add but would just be \u0027pass\u0027.","commit_id":"9a4f502b4f46a3042b0ec3250567fc89556f3afd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79496678b574365fe96e9dde08fcfcde009b52b9","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        self.osc \u003d osc if osc else clients.OpenStackClients()"},{"line_number":53,"context_line":"        self.gnocchi \u003d self.osc.gnocchi()"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        if CONF.gnocchi_client.query_max_retries is not 0:"},{"line_number":56,"context_line":"            LOG.warning(\"Gnocchi query_max_retries config option is \""},{"line_number":57,"context_line":"                        \"deprecated use watcher_datasources.query_max_retries \""},{"line_number":58,"context_line":"                        \"instead.\")"},{"line_number":59,"context_line":"            self.query_num_retries \u003d CONF.gnocchi_client.query_max_retries"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        if CONF.gnocchi_client.query_timeout is not 0:"},{"line_number":62,"context_line":"            LOG.warning(\"Gnocchi query_timeout config option is \""},{"line_number":63,"context_line":"                        \"deprecated use watcher_datasources.query_timeout \""},{"line_number":64,"context_line":"                        \"instead.\")"},{"line_number":65,"context_line":"            self.query_timeout \u003d CONF.gnocchi_client.query_timeout"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def check_availability(self):"},{"line_number":68,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_2e02610c","line":65,"range":{"start_line":55,"start_character":0,"end_line":65,"end_character":66},"updated":"2019-06-11 23:49:44.000000000","message":"I don\u0027t think we need this if we use deprecated_group properly.","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b1899c6ee2518c76557304e1264e2ad5372515a2","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        self.osc \u003d osc if osc else clients.OpenStackClients()"},{"line_number":53,"context_line":"        self.gnocchi \u003d self.osc.gnocchi()"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        if CONF.gnocchi_client.query_max_retries is not 0:"},{"line_number":56,"context_line":"            LOG.warning(\"Gnocchi query_max_retries config option is \""},{"line_number":57,"context_line":"                        \"deprecated use watcher_datasources.query_max_retries \""},{"line_number":58,"context_line":"                        \"instead.\")"},{"line_number":59,"context_line":"            self.query_num_retries \u003d CONF.gnocchi_client.query_max_retries"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        if CONF.gnocchi_client.query_timeout is not 0:"},{"line_number":62,"context_line":"            LOG.warning(\"Gnocchi query_timeout config option is \""},{"line_number":63,"context_line":"                        \"deprecated use watcher_datasources.query_timeout \""},{"line_number":64,"context_line":"                        \"instead.\")"},{"line_number":65,"context_line":"            self.query_timeout \u003d CONF.gnocchi_client.query_timeout"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def check_availability(self):"},{"line_number":68,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_f9b5f132","line":65,"range":{"start_line":55,"start_character":0,"end_line":65,"end_character":66},"in_reply_to":"9fb8cfa7_2e02610c","updated":"2019-06-11 23:56:10.000000000","message":"I removed these and added deprecated_group\u003d\u0027gnocchi_client\u0027 to the moved options and I see that the override test is failing:\n\nwatcher.tests.datasources.test_gnocchi_helper.TestGnocchiHelper.test_gnocchi_config_compat\n------------------------------------------------------------------------------------------\n\nCaptured traceback:\n~~~~~~~~~~~~~~~~~~~\n    b\u0027Traceback (most recent call last):\u0027\n    b\u0027  File \"/home/osboxes/git/watcher/.tox/py36/lib/python3.6/site-packages/mock/mock.py\", line 1329, in patched\u0027\n    b\u0027    return func(*args, **keywargs)\u0027\n    b\u0027  File \"/home/osboxes/git/watcher/watcher/tests/datasources/test_gnocchi_helper.py\", line 159, in test_gnocchi_config_compat\u0027\n    b\"    group\u003d\u0027gnocchi_client\u0027)\"\n    b\u0027  File \"/home/osboxes/git/watcher/.tox/py36/lib/python3.6/site-packages/oslo_config/cfg.py\", line 2051, in __inner\u0027\n    b\u0027    result \u003d f(self, *args, **kwargs)\u0027\n    b\u0027  File \"/home/osboxes/git/watcher/.tox/py36/lib/python3.6/site-packages/oslo_config/cfg.py\", line 2434, in set_override\u0027\n    b\u0027    opt_info \u003d self._get_opt_info(name, group)\u0027\n    b\u0027  File \"/home/osboxes/git/watcher/.tox/py36/lib/python3.6/site-packages/oslo_config/cfg.py\", line 2845, in _get_opt_info\u0027\n    b\u0027    raise NoSuchOptError(opt_name, group)\u0027\n    b\u0027oslo_config.cfg.NoSuchOptError: no such option query_max_retries in group [gnocchi_client]\u0027\n    b\u0027\u0027\n\n\nBut I\u0027m pretty sure that\u0027s how you are supposed to move options and keep an alias working, because once I build the docs I see this for the moved options:\n\n query_max_retries¶\n\n    Type\n\n        integer\n    Default\n\n        10\n    Minimum Value\n\n        1\n    Mutable\n\n        This option can be changed without restarting.\n\n    How many times Watcher is trying to query again\n\n    Deprecated Variations¶\n\n    Group\n    \t\n\n    Name\n\n    gnocchi_client\n    \t\n\n    query_max_retries\n\nWe could ask someone from the oslo team to confirm or if there is another way to test the alias, or just test it manually in devstack.","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"c64a7db04c38d0be6b812ad8b9c454050da00d0d","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        self.osc \u003d osc if osc else clients.OpenStackClients()"},{"line_number":53,"context_line":"        self.gnocchi \u003d self.osc.gnocchi()"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        if CONF.gnocchi_client.query_max_retries is not 0:"},{"line_number":56,"context_line":"            LOG.warning(\"Gnocchi query_max_retries config option is \""},{"line_number":57,"context_line":"                        \"deprecated use watcher_datasources.query_max_retries \""},{"line_number":58,"context_line":"                        \"instead.\")"},{"line_number":59,"context_line":"            self.query_num_retries \u003d CONF.gnocchi_client.query_max_retries"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        if CONF.gnocchi_client.query_timeout is not 0:"},{"line_number":62,"context_line":"            LOG.warning(\"Gnocchi query_timeout config option is \""},{"line_number":63,"context_line":"                        \"deprecated use watcher_datasources.query_timeout \""},{"line_number":64,"context_line":"                        \"instead.\")"},{"line_number":65,"context_line":"            self.query_timeout \u003d CONF.gnocchi_client.query_timeout"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def check_availability(self):"},{"line_number":68,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_b8a1aafa","line":65,"range":{"start_line":55,"start_character":0,"end_line":65,"end_character":66},"in_reply_to":"9fb8cfa7_9f24d5b0","updated":"2019-06-12 13:47:36.000000000","message":"Tested your method in a test environment, works fine.","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"10fc08f42b2bfd998be8c5ea28d93b26776d8941","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        self.osc \u003d osc if osc else clients.OpenStackClients()"},{"line_number":53,"context_line":"        self.gnocchi \u003d self.osc.gnocchi()"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        if CONF.gnocchi_client.query_max_retries is not 0:"},{"line_number":56,"context_line":"            LOG.warning(\"Gnocchi query_max_retries config option is \""},{"line_number":57,"context_line":"                        \"deprecated use watcher_datasources.query_max_retries \""},{"line_number":58,"context_line":"                        \"instead.\")"},{"line_number":59,"context_line":"            self.query_num_retries \u003d CONF.gnocchi_client.query_max_retries"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        if CONF.gnocchi_client.query_timeout is not 0:"},{"line_number":62,"context_line":"            LOG.warning(\"Gnocchi query_timeout config option is \""},{"line_number":63,"context_line":"                        \"deprecated use watcher_datasources.query_timeout \""},{"line_number":64,"context_line":"                        \"instead.\")"},{"line_number":65,"context_line":"            self.query_timeout \u003d CONF.gnocchi_client.query_timeout"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def check_availability(self):"},{"line_number":68,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_ff85c707","line":65,"range":{"start_line":55,"start_character":0,"end_line":65,"end_character":66},"in_reply_to":"9fb8cfa7_b8a1aafa","updated":"2019-06-12 14:00:05.000000000","message":"Yeah the patch on top also shows it working as expected:\n\nhttp://logs.openstack.org/56/664756/1/check/watcher-tempest-basic_optim/27f1ed1/controller/logs/screen-watcher-decision-engine.txt.gz#_Jun_12_02_53_19_102902\n\nJun 12 02:53:19.102902 ubuntu-bionic-rax-ord-0007495051 watcher-decision-engine[2170]: WARNING oslo_config.cfg [-] Deprecated: Option \"query_max_retries\" from group \"gnocchi_client\" is deprecated. Use option \"query_max_retries\" from group \"watcher_datasources\".\nJun 12 02:53:19.103315 ubuntu-bionic-rax-ord-0007495051 watcher-decision-engine[2170]: DEBUG watcher.common.service [-] watcher_datasources.query_max_retries \u003d 1 {{(pid\u003d2170) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2585}}\nJun 12 02:53:19.103834 ubuntu-bionic-rax-ord-0007495051 watcher-decision-engine[2170]: WARNING oslo_config.cfg [-] Deprecated: Option \"query_timeout\" from group \"gnocchi_client\" is deprecated. Use option \"query_timeout\" from group \"watcher_datasources\".\nJun 12 02:53:19.104181 ubuntu-bionic-rax-ord-0007495051 watcher-decision-engine[2170]: DEBUG watcher.common.service [-] watcher_datasources.query_timeout \u003d 5 {{(pid\u003d2170) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2585}}","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d23c0c9c39d8cc2756b33d747701d703658d0f64","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        self.osc \u003d osc if osc else clients.OpenStackClients()"},{"line_number":53,"context_line":"        self.gnocchi \u003d self.osc.gnocchi()"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        if CONF.gnocchi_client.query_max_retries is not 0:"},{"line_number":56,"context_line":"            LOG.warning(\"Gnocchi query_max_retries config option is \""},{"line_number":57,"context_line":"                        \"deprecated use watcher_datasources.query_max_retries \""},{"line_number":58,"context_line":"                        \"instead.\")"},{"line_number":59,"context_line":"            self.query_num_retries \u003d CONF.gnocchi_client.query_max_retries"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        if CONF.gnocchi_client.query_timeout is not 0:"},{"line_number":62,"context_line":"            LOG.warning(\"Gnocchi query_timeout config option is \""},{"line_number":63,"context_line":"                        \"deprecated use watcher_datasources.query_timeout \""},{"line_number":64,"context_line":"                        \"instead.\")"},{"line_number":65,"context_line":"            self.query_timeout \u003d CONF.gnocchi_client.query_timeout"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def check_availability(self):"},{"line_number":68,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_9f24d5b0","line":65,"range":{"start_line":55,"start_character":0,"end_line":65,"end_character":66},"in_reply_to":"9fb8cfa7_f9b5f132","updated":"2019-06-12 01:32:35.000000000","message":"Testing manually here:\n\nhttps://review.opendev.org/#/c/664756/","commit_id":"2913bb9c64271a1107785ca3b2a4a646698d6090"}],"watcher/tests/datasources/test_base.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c51998048018048c494346202bea71c1fbf7890a","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class TestBaseDatasourceHelper(base.BaseTestCase):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    @mock.patch.object(datasource.DataSourceBase, \u0027query_retry_reset\u0027)"},{"line_number":32,"context_line":"    def test_query_retry(self, m_reset):"},{"line_number":33,"context_line":"        exc \u003d Exception()"},{"line_number":34,"context_line":"        method \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_bff74f8b","line":31,"updated":"2019-06-12 14:07:21.000000000","message":"nit: rather than mock this globally, just mock your helper variable.","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"2e69f6a38d9dca680db95927129f06dd828e5456","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class TestBaseDatasourceHelper(base.BaseTestCase):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    @mock.patch.object(datasource.DataSourceBase, \u0027query_retry_reset\u0027)"},{"line_number":32,"context_line":"    def test_query_retry(self, m_reset):"},{"line_number":33,"context_line":"        exc \u003d Exception()"},{"line_number":34,"context_line":"        method \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_5968ab1b","line":31,"in_reply_to":"9fb8cfa7_bff74f8b","updated":"2019-06-12 18:35:24.000000000","message":"Done","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c51998048018048c494346202bea71c1fbf7890a","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        # first call will fail but second will succeed"},{"line_number":36,"context_line":"        method.side_effect \u003d [exc, True]"},{"line_number":37,"context_line":"        # Max 2 attempts"},{"line_number":38,"context_line":"        cfg.CONF.set_override(\"query_max_retries\", 2,"},{"line_number":39,"context_line":"                              group\u003d\u0027watcher_datasources\u0027)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        helper \u003d datasource.DataSourceBase()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_df332361","line":38,"updated":"2019-06-12 14:07:21.000000000","message":"You should also either mock out the time.sleep call or set the timeout config option to 0 otherwise this test is really sleeping and doesn\u0027t need to be.","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"c413fe8d7569fb0b6145d7c827f63be4e03b5ce3","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        # first call will fail but second will succeed"},{"line_number":36,"context_line":"        method.side_effect \u003d [exc, True]"},{"line_number":37,"context_line":"        # Max 2 attempts"},{"line_number":38,"context_line":"        cfg.CONF.set_override(\"query_max_retries\", 2,"},{"line_number":39,"context_line":"                              group\u003d\u0027watcher_datasources\u0027)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        helper \u003d datasource.DataSourceBase()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_330878d8","line":38,"in_reply_to":"9fb8cfa7_7334b0de","updated":"2019-06-12 16:37:00.000000000","message":"Ah, so there was cleanup being done. Cool.","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"2e69f6a38d9dca680db95927129f06dd828e5456","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        # first call will fail but second will succeed"},{"line_number":36,"context_line":"        method.side_effect \u003d [exc, True]"},{"line_number":37,"context_line":"        # Max 2 attempts"},{"line_number":38,"context_line":"        cfg.CONF.set_override(\"query_max_retries\", 2,"},{"line_number":39,"context_line":"                              group\u003d\u0027watcher_datasources\u0027)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        helper \u003d datasource.DataSourceBase()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_d9533b6a","line":38,"in_reply_to":"9fb8cfa7_824234aa","updated":"2019-06-12 18:35:24.000000000","message":"Done","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dbd4ef4ca660f74cd93727abeb2a0ba5b50334ac","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        # first call will fail but second will succeed"},{"line_number":36,"context_line":"        method.side_effect \u003d [exc, True]"},{"line_number":37,"context_line":"        # Max 2 attempts"},{"line_number":38,"context_line":"        cfg.CONF.set_override(\"query_max_retries\", 2,"},{"line_number":39,"context_line":"                              group\u003d\u0027watcher_datasources\u0027)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        helper \u003d datasource.DataSourceBase()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_7334b0de","line":38,"in_reply_to":"9fb8cfa7_824234aa","updated":"2019-06-12 16:25:13.000000000","message":"Way ahead of you :)\n\nhttps://review.opendev.org/664750","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"2e69f6a38d9dca680db95927129f06dd828e5456","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        # first call will fail but second will succeed"},{"line_number":36,"context_line":"        method.side_effect \u003d [exc, True]"},{"line_number":37,"context_line":"        # Max 2 attempts"},{"line_number":38,"context_line":"        cfg.CONF.set_override(\"query_max_retries\", 2,"},{"line_number":39,"context_line":"                              group\u003d\u0027watcher_datasources\u0027)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        helper \u003d datasource.DataSourceBase()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_f95abf80","line":38,"in_reply_to":"9fb8cfa7_df332361","updated":"2019-06-12 18:35:24.000000000","message":"Done","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"e2840156d2fdcebce3379b8c44b83d451ee70b7c","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        # first call will fail but second will succeed"},{"line_number":36,"context_line":"        method.side_effect \u003d [exc, True]"},{"line_number":37,"context_line":"        # Max 2 attempts"},{"line_number":38,"context_line":"        cfg.CONF.set_override(\"query_max_retries\", 2,"},{"line_number":39,"context_line":"                              group\u003d\u0027watcher_datasources\u0027)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        helper \u003d datasource.DataSourceBase()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_824234aa","line":38,"in_reply_to":"9fb8cfa7_df332361","updated":"2019-06-12 14:52:29.000000000","message":"Using set_override like this in unit tests is racy. The global conf object won\u0027t reset at the end of the test and this value will persist for subsequent tests.\n\nYou could add a manual cleanup, but I would suggest just using the config fixture: https://docs.openstack.org/oslo.config/latest/reference/fixture.html","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c51998048018048c494346202bea71c1fbf7890a","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.assertTrue(helper.query_retry(f\u003dmethod))"},{"line_number":44,"context_line":"        m_reset.assert_called_once_with(exc)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @mock.patch.object(datasource.DataSourceBase, \u0027query_retry_reset\u0027)"},{"line_number":47,"context_line":"    def test_query_retry_exception(self, m_reset):"},{"line_number":48,"context_line":"            exc \u003d Exception()"},{"line_number":49,"context_line":"            method \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_df0c8395","line":46,"updated":"2019-06-12 14:07:21.000000000","message":"same about mocking the helper variable rather than the class","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"2e69f6a38d9dca680db95927129f06dd828e5456","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.assertTrue(helper.query_retry(f\u003dmethod))"},{"line_number":44,"context_line":"        m_reset.assert_called_once_with(exc)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @mock.patch.object(datasource.DataSourceBase, \u0027query_retry_reset\u0027)"},{"line_number":47,"context_line":"    def test_query_retry_exception(self, m_reset):"},{"line_number":48,"context_line":"            exc \u003d Exception()"},{"line_number":49,"context_line":"            method \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_994943b8","line":46,"in_reply_to":"9fb8cfa7_df0c8395","updated":"2019-06-12 18:35:24.000000000","message":"Done","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c51998048018048c494346202bea71c1fbf7890a","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @mock.patch.object(datasource.DataSourceBase, \u0027query_retry_reset\u0027)"},{"line_number":47,"context_line":"    def test_query_retry_exception(self, m_reset):"},{"line_number":48,"context_line":"            exc \u003d Exception()"},{"line_number":49,"context_line":"            method \u003d mock.Mock()"},{"line_number":50,"context_line":"            # only third call will succeed"},{"line_number":51,"context_line":"            method.side_effect \u003d [exc, exc, True]"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_9fa5aba4","line":48,"updated":"2019-06-12 14:07:21.000000000","message":"The indenting is off here.","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"2e69f6a38d9dca680db95927129f06dd828e5456","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @mock.patch.object(datasource.DataSourceBase, \u0027query_retry_reset\u0027)"},{"line_number":47,"context_line":"    def test_query_retry_exception(self, m_reset):"},{"line_number":48,"context_line":"            exc \u003d Exception()"},{"line_number":49,"context_line":"            method \u003d mock.Mock()"},{"line_number":50,"context_line":"            # only third call will succeed"},{"line_number":51,"context_line":"            method.side_effect \u003d [exc, exc, True]"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_39ca971a","line":48,"in_reply_to":"9fb8cfa7_9fa5aba4","updated":"2019-06-12 18:35:24.000000000","message":"Done","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c51998048018048c494346202bea71c1fbf7890a","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            # only third call will succeed"},{"line_number":51,"context_line":"            method.side_effect \u003d [exc, exc, True]"},{"line_number":52,"context_line":"            # Max 2 attempts"},{"line_number":53,"context_line":"            cfg.CONF.set_override(\"query_max_retries\", 2,"},{"line_number":54,"context_line":"                                  group\u003d\u0027watcher_datasources\u0027)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"            helper \u003d datasource.DataSourceBase()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_7f4237ad","line":53,"updated":"2019-06-12 14:07:21.000000000","message":"same about mocking or configuring the timeout so the test doesn\u0027t actually sleep","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"2e69f6a38d9dca680db95927129f06dd828e5456","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            # only third call will succeed"},{"line_number":51,"context_line":"            method.side_effect \u003d [exc, exc, True]"},{"line_number":52,"context_line":"            # Max 2 attempts"},{"line_number":53,"context_line":"            cfg.CONF.set_override(\"query_max_retries\", 2,"},{"line_number":54,"context_line":"                                  group\u003d\u0027watcher_datasources\u0027)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"            helper \u003d datasource.DataSourceBase()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_59cd0b2f","line":53,"in_reply_to":"9fb8cfa7_7f4237ad","updated":"2019-06-12 18:35:24.000000000","message":"Done","commit_id":"8e7399465bf686bcd17dbd1255a321bcfb5318a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7c62538a61d724b6bb6cdbdc4caf9657de62721a","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class TestBaseDatasourceHelper(base.BaseTestCase):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    @mock.patch.object(datasource, \u0027CONF\u0027)"},{"line_number":32,"context_line":"    def test_query_retry(self, m_conf):"},{"line_number":33,"context_line":"        exc \u003d Exception()"},{"line_number":34,"context_line":"        method \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fb8cfa7_1443da14","line":31,"updated":"2019-06-12 19:06:52.000000000","message":"Mocking global CONF like this is probably not what we want. If you did this because of Ben\u0027s comment about using set_override, I think that\u0027s OK because the ConfFixture is resetting between test runs:\n\nhttps://github.com/openstack/watcher/blob/46a36d1ad73ca9024ee99c8b1c9cd29c3fea14e0/watcher/tests/conf_fixture.py#L40\n\nAnyway, I think mocking the global conf is likely just as racy as set_override and I don\u0027t think set_override actually had an issue.","commit_id":"9749c6808a4670223f6e801298cfe3ae37b1d413"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"5442122ff97f6ee59c60a5bc18eddd7685bd10a9","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class TestBaseDatasourceHelper(base.BaseTestCase):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    @mock.patch.object(datasource, \u0027CONF\u0027)"},{"line_number":32,"context_line":"    def test_query_retry(self, m_conf):"},{"line_number":33,"context_line":"        exc \u003d Exception()"},{"line_number":34,"context_line":"        method \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fb8cfa7_1448ba84","line":31,"in_reply_to":"9fb8cfa7_1443da14","updated":"2019-06-12 19:36:58.000000000","message":"So with set_override the setting returns to the default after the method returns? Then this is indeed just as racy, I thought Ben meant the change to the config would be persistent between methods.","commit_id":"9749c6808a4670223f6e801298cfe3ae37b1d413"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"57c5de3c7f64df0a009b5a13944b1ab7e3b50288","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class TestBaseDatasourceHelper(base.BaseTestCase):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    @mock.patch.object(datasource, \u0027CONF\u0027)"},{"line_number":32,"context_line":"    def test_query_retry(self, m_conf):"},{"line_number":33,"context_line":"        exc \u003d Exception()"},{"line_number":34,"context_line":"        method \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fb8cfa7_e8ac2aee","line":31,"in_reply_to":"9fb8cfa7_1448ba84","updated":"2019-06-12 19:52:20.000000000","message":"The fixture will reset the config between test cases (on tearDown essentially). I\u0027m assuming Ben didn\u0027t realize we were using a config fixture already that reset global config between test cases and maybe just assumed you were overriding config globally without the reset.","commit_id":"9749c6808a4670223f6e801298cfe3ae37b1d413"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7c62538a61d724b6bb6cdbdc4caf9657de62721a","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self.assertTrue(helper.query_retry(f\u003dmethod))"},{"line_number":46,"context_line":"        helper.query_retry_reset.assert_called_once_with(exc)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    @mock.patch.object(datasource, \u0027CONF\u0027)"},{"line_number":49,"context_line":"    def test_query_retry_exception(self, m_conf):"},{"line_number":50,"context_line":"        exc \u003d Exception()"},{"line_number":51,"context_line":"        method \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fb8cfa7_745336e3","line":48,"updated":"2019-06-12 19:06:52.000000000","message":"same","commit_id":"9749c6808a4670223f6e801298cfe3ae37b1d413"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f049e75a341ece14629f51dda38fa40aac9ef9fb","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from watcher.datasources import base as datasource"},{"line_number":24,"context_line":"from watcher.tests import base"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"CONF \u003d cfg.CONF"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class TestBaseDatasourceHelper(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_6bc2745b","line":26,"updated":"2019-06-12 21:03:48.000000000","message":"This isn\u0027t used.","commit_id":"4410dd2e26225dd9a5bc41af54cf5e8a6dba4c2c"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"4fca33c9b6da812f317cf7a8782a12eabc5f4f9b","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from watcher.datasources import base as datasource"},{"line_number":24,"context_line":"from watcher.tests import base"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"CONF \u003d cfg.CONF"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class TestBaseDatasourceHelper(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_2bc8ef71","line":26,"in_reply_to":"9fb8cfa7_6bc2745b","updated":"2019-06-13 13:55:26.000000000","message":"Done","commit_id":"4410dd2e26225dd9a5bc41af54cf5e8a6dba4c2c"}]}
