)]}'
{"monasca_agent/collector/checks/services_checks.py":[{"author":{"_account_id":15799,"name":"Ben Motz","email":"ben.launchpad@ouat.co.uk","username":"bmotz"},"change_message_id":"1e3f598ab67f2bd0531d60f29efb6973c2c54143","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    def check(self, instance):"},{"line_number":83,"context_line":"        if not self.pool_started:"},{"line_number":84,"context_line":"            self.start_pool()"},{"line_number":85,"context_line":"        if threading.activeCount() \u003e MAX_ALLOWED_THREADS:"},{"line_number":86,"context_line":"            raise Exception(\"Thread number ({0}) exceeds maximum ({1}). Skipping this check.\".format(threading.activeCount(),"},{"line_number":87,"context_line":"                                                                                                     MAX_ALLOWED_THREADS))"},{"line_number":88,"context_line":"        self._process_results()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_c1fa0075","line":85,"updated":"2015-11-27 10:15:55.000000000","message":"Although configuring a pool size \u003e 200 seems unlikely, would it be worth comparing against max(MAX_ALLOWED_THREADS, self.pool_size) to be on the safe side?","commit_id":"e0672106067f13329340c19ff808dc77c96ca338"},{"author":{"_account_id":15799,"name":"Ben Motz","email":"ben.launchpad@ouat.co.uk","username":"bmotz"},"change_message_id":"e56a9d04a4ba66c8bd8634d77a4d15e4c7aedae4","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    def check(self, instance):"},{"line_number":83,"context_line":"        if not self.pool_started:"},{"line_number":84,"context_line":"            self.start_pool()"},{"line_number":85,"context_line":"        if threading.activeCount() \u003e MAX_ALLOWED_THREADS:"},{"line_number":86,"context_line":"            raise Exception(\"Thread number ({0}) exceeds maximum ({1}). Skipping this check.\".format(threading.activeCount(),"},{"line_number":87,"context_line":"                                                                                                     MAX_ALLOWED_THREADS))"},{"line_number":88,"context_line":"        self._process_results()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_b484c1d2","line":85,"in_reply_to":"9a8ffd7b_454e77c2","updated":"2015-12-03 12:40:26.000000000","message":"Of the options you suggested, I don\u0027t think you need to increase MAX_ALLOWED_THREADS (200 seems reasonable) - it\u0027s just that this seems like a way for misconfiguration to produce slightly non-obvious failures.\n\nHow about changing the exception message to additionally say something like \"you may need to reduce threads_count in the configuration file\"?","commit_id":"e0672106067f13329340c19ff808dc77c96ca338"},{"author":{"_account_id":12443,"name":"David Schroeder","email":"openstack@a7n.net","username":"dschroeder"},"change_message_id":"bd18f8d523a0719a492fbb51946151940e01796e","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    def check(self, instance):"},{"line_number":83,"context_line":"        if not self.pool_started:"},{"line_number":84,"context_line":"            self.start_pool()"},{"line_number":85,"context_line":"        if threading.activeCount() \u003e MAX_ALLOWED_THREADS:"},{"line_number":86,"context_line":"            raise Exception(\"Thread number ({0}) exceeds maximum ({1}). Skipping this check.\".format(threading.activeCount(),"},{"line_number":87,"context_line":"                                                                                                     MAX_ALLOWED_THREADS))"},{"line_number":88,"context_line":"        self._process_results()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a8ffd7b_454e77c2","line":85,"in_reply_to":"9a8ffd7b_c1fa0075","updated":"2015-12-01 18:47:25.000000000","message":"That\u0027s a good thought, but also comparing against self.pool_size would ultimately throw the Exception with every check instance.\n\nLet\u0027s say one Agent plugin specifies a max_threads of 250.  With that one plugin, plus one thread for the Collector itself, that\u0027s a constant minimum threading.activeCount() of 251, and this condition would always fail.  Add in other ServicesCheck-based plugins, and that could potentially mean a total thread count of well over 250.\n\nI\u0027d like to think that requiring excess of 200 threads for the Collector would be an extreme edge case, one which would not require a more easily-configured limit, but if it is indeed too low, we could 1) simply increase the default MAX_ALLOWED_THREADS here, or 2) make this a configurable value in agent.yaml, \"max_collector_threads\" or something similar, which would either directly override/replace MAX_ALLOWED_THREADS, or paired with max(), effectively provide a new ceiling.\n\nDo you have a preference?","commit_id":"e0672106067f13329340c19ff808dc77c96ca338"}]}
